Skip to content

completion: use os.path.split for zsh script basename - #488

Open
r3wretrhy wants to merge 1 commit into
pydoit:masterfrom
r3wretrhy:fix-zsh-completion-windows-basename
Open

r3wretrhy wants to merge 1 commit into
pydoit:masterfrom
r3wretrhy:fix-zsh-completion-windows-basename

Conversation

@r3wretrhy

Copy link
Copy Markdown

Bash completion already takes the script basename with os.path.split(sys.argv[0])[1] (#451). The zsh generator still used sys.argv[0].split('/')[-1], so a Windows path such as C:\Python\Scripts\doit.exe is copied whole into the completion script.

Use the same os.path.split as bash.

The added test fails with a literal / split (C: appears in the script) and passes with os.path.split.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant