-
Notifications
You must be signed in to change notification settings - Fork 157
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
make Control-w and alt-backspace behave more like bash #632
Conversation
'man bash' documents this as: unix-word-rubout (C-w) Kill the word behind point, using white space as a word boundary. The killed text is saved on the kill-ring. zsh does not have a concept of small/big words, but its 'word' is slightly bigger than nushell's small word, because it includes -./_ and a few other punctuation marks. fish's control-w is slightly larger than nushell's small word in that it seems to delete up to the next / (and doesn't need an extra control-w to delete the '/' 'thing/').
On MacOS, vscode generates control-alt-h in response to alt+backspace. This is handled in bash as cut-smallword-left and in zsh as cut-word-left (zsh doesn't seem to have a concept of small/big words). Fish treats this as cut small word left (fish bigwords include anything up to /, and its small words stop on any punctuation).
from https://github.com/nushell/nushell/pull/10288/files#diff-5c0320ebb54cd8ffd7059eb0178377c5139877d21457f6903439e7caf2e5b40eL585, looks like there might be an additional change to add here to be on par between the two PRs? 😮 |
okey, looks about right compared to nushell/nushell#10288 👍 |
Currently in nushell, we think a word doesn't contains reedline/src/core_editor/line_buffer.rs Line 262 in ebd653b
|
Would it be valuable to add a medium-word concept and leave it up to the end user to configure, or should nushell just "get it right" by default with no configuration? (I think that making this change is out of scope for this pr, but if there is an easy way to avoid people carrying patches locally, it is worth exploring) |
I think we can just change the definition of our "word", if we make it configurable, there are too much things we needs to do: should a word contains I'd like to borrow the idea from fish (https://fishshell.com/docs/current/interactive.html#shared-bindings):
I've played with fish, and found in fish, a word doesn't contain
|
I've switched back to using bash, and I've lost momentum on this. I'm going to close this PR. I will leave the branch up in case anyone wants to cherry-pick from it. |
see nushell/nushell#10288 for more context
From the commit messages:
As mentioned in my nushell PR, I realise that keybindings are the kind of thing that can cause holy wars, so I'm happy to back out any changes that people dislike.