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
vi-mode: ^D logs you out. #2219
Comments
It logs out, yes, but why should it "erase to the end of line"? That's what "D" (i.e. shift and "d") should do, in normal mode, and it does. What ^D (i.e. "\cd" in fish's notation and "C-d" in emacs') does in vim (with an empty vimrc) is in normal mode scroll down a page/screen, keeping the cursor at the beginning of the line. In insert mode, it shifts the current line to the left. Neither of which is particularly applicable to a shell. What does it do in e.g. zsh's vi mode? |
Yes, sorry you are completely correctly. However, what ^D does in bash is not boot you out :) It tries to run the current command. |
Okay, in zsh, after In bash's vi-mode ( (All this is through trial with bash 4.3.39, readline 6.3.008, zsh 5.0.8 on archlinux) So now that we've found out that apparently there's no standard way to handle "^D" in a shell vi-mode, we should think about what it should do. What's a nice thing to have bound to ^D? |
Not log you out! :) |
How about just doing the same thing it does in emacs mode? ("delete-or-exit", though I can only get it to do the "or-exit" part, it does nothing instead of deleting if the line isn't empty) See #2255 - if we don't have a compelling alternative, the vi bindings should do what the default bindings do. |
Personally, I really like ^D for logging out. For completeness: ^D actually inserts an "end-of-file" character, which is interpreted by some shells as an |
|
Yes, [ctrl-D] should only cause the shell to exit in vi normal (i.e., command rather than insert) mode if the command line is empty. Why aren't we fixing such trivial issues sooner? |
This just removes the special vi binding and hence falls back upon the shared one. Fixes fish-shell#2219.
It should erase to the end of line.
The text was updated successfully, but these errors were encountered: