Skip to content
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

Bind Shift+Space to Space by default #8874

Closed
gpanders opened this issue Apr 13, 2022 · 2 comments
Closed

Bind Shift+Space to Space by default #8874

gpanders opened this issue Apr 13, 2022 · 2 comments

Comments

@gpanders
Copy link
Contributor

Fish version: 3.4.1
OS: macOS 12.3
Terminal: iTerm2

When using a terminal that supports the CSI u modifiers, Shift+Space is sent as \x1b[32;2u. This is the case for e.g. iTerm2. Unfortunately, Shift+Space is an extremely easy combination to mistype when one simply meant to insert a space. Consider the case when you're setting an environment variable:

set -U SOME_VAR foo

After typing Shift+r to enter R if I press Space while my finger is still holding shift, the sequence \x1b[32;2u is sent instead of a space. This happens quite often (for me, at least).

It is possible to tell fish to simply insert a space when this sequence is received:

bind \e\[32\;2u 'commandline -i " "'

I propose making the above binding a default as a convenience. I don't have any data for this assertion, but I would hazard a guess that most people would want Shift+Space to simply insert a space. Those who want to use that extra combination for something else can always map it themselves, though I'd bet that is a minority use case.

@krobelus
Copy link
Member

I don't have any data for this assertion, but I would hazard a guess that most people would want Shift+Space to simply insert a space.

I agree, because this makes it easier to type all caps.

So I think we definitely want that binding (I assume it doesn't collide with anything else).

What key sequence does Shift+Backspace send for you? This might have the same problem.


A related problem is that I get \e\[27\;5\;13~ when I press Control+Return in the foot terminal.
I often trigger this accidentally after a Control+F that accepts an autosuggestion.
Should probably map that too by default, to match the behavior of traditional terminals.

@gpanders
Copy link
Contributor Author

What key sequence does Shift+Backspace send for you?

\e[127;2u

@krobelus krobelus added this to the fish 3.5.0 milestone Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants