New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improvements to bash completion #4528
Conversation
If a partial filename, or an flag or option argument is invoked, those completions will still take place, but by default, to aid the user in the discovery of subcommands, pressing tab immediately after ipython will list *only* the subcommands as possible completions
pinging @juliantaylor who wrote the original completer, and @ngoldbaum, who was the last to poke at it to enable zsh completion |
This is a significant usability improvement. Works just fine under zsh. |
+1 |
looks nice, maybe one could add this to the subcommand completion to get a space after them:
|
thanks to @juliantaylor for providing the patch
Thanks @juliantaylor, I played with it a bit trying to get this functionality yesterday, but couldn't get a clean enough of a patch. Your solution works nicely, so I've added that to this PR. |
EDIT: disregard this, I made a mistake applying the patch. Hmm, the patch @ivanov just applied broke completion for me. Perhaps I've messed something up - can someone else reproduce this? It behaves the same in bash and zsh, as far as I can tell. $ ipython note<tab>
$ ipython notebook qtconsole console kernel profile locate history nbconvert Before the patch, I got a nice ordered list: $ ipython <tab><tab>
console kernel nbconvert profile
history locate notebook qtconsole
$ ipython or a sensible completion:
|
works for me |
Hmm, please disregard my last comment, it looks like I messed something up last night. |
improvements to bash completion
I'm really exited that the bash completion has been updated, however, you missed to add the options for nbconvert! |
sweet, I've got another PR coming that improves bash completion in other ways, so I'll add it to that one, thanks, @jakobgager |
thanks @jakobgager for pointing this out in ipython#4528
I also tried to write such an update (see https://github.com/jakobgager/IPy_bash_complete). Unfortunately, I didn't succeeded to implement |
new `ipython history clear` subcommand This new subcommand is equivalent to ipython history trim --HistoryTrim.keep=0, which is now supported (and also has a more convenient --keep alias) This command comes with a fix to bash completion of flags for ipython history subcmd also included is a tiny fix for nbconvert completion that was pointed out by @jakobgager in #4528 also included is a change to our utils.io.ask_yes_no function that allows for specifying the behavior of a KeyboardInterrupt.
improvements to bash completion
thanks @jakobgager for pointing this out in ipython#4528
new `ipython history clear` subcommand This new subcommand is equivalent to ipython history trim --HistoryTrim.keep=0, which is now supported (and also has a more convenient --keep alias) This command comes with a fix to bash completion of flags for ipython history subcmd also included is a tiny fix for nbconvert completion that was pointed out by @jakobgager in ipython#4528 also included is a change to our utils.io.ask_yes_no function that allows for specifying the behavior of a KeyboardInterrupt.
[x] added nbconvert and history subcommands
[x] generalized subcommand completer logic
[x] profile, history, locate commands now have completions
[x] bash completion: ipython shows only subcmds
If a partial filename, or an flag or option argument is invoked, those
completions will still take place, but by default, to aid the user in the
discovery of subcommands, pressing tab immediately after ipython will list
only the subcommands as possible completions