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

Mapping unicode characters with Ctrl doesn't work (but Alt does) #5765

Closed
kristian-clausal opened this issue Feb 1, 2023 · 5 comments · Fixed by #4939
Closed

Mapping unicode characters with Ctrl doesn't work (but Alt does) #5765

kristian-clausal opened this issue Feb 1, 2023 · 5 comments · Fixed by #4939
Labels
C-bug Category: This is a bug

Comments

@kristian-clausal
Copy link

kristian-clausal commented Feb 1, 2023

Summary

Mapping "C-ö" or "C-å" does not work, but "A-ö" and "A-å" does.

Reproduction Steps

MATE Terminal, Helix built from source today.

config.toml:

theme = "gruvbox"

[editor]
true-color = true
rulers = [80]

[editor.indent-guides]
render = true
character = "" # Some characters that work well: "▏", "┆", "┊", "⸽"
skip-levels = 1

[keys.normal]
h = "insert_mode"
...

[keys.insert]
"C-ö" = "normal_mode"

I'm using a Finnish keyboard layout (with modifications) and I will be continuing using a Finnish keyboard layout, so it would be handy to rebind characters on the keyboard, and Ctrl is in a much more comfortable position, so it's a shame that it doesn't seem to work. I could have sworn that it worked for a hot minute earlier today, but I am probably confusing it with an attempt to use Alt-ö instead, which does work, as does Alt-å. Ctrl-p (just to test) works fine.

I checked what is actually written in config.toml (in case something funky like decomposing ö into o+combinding diaresis happened), and it's just Unicode decimal point 246.

Helix log

The log did not contain anything pertinent. Mostly complaining I haven't bothered to install a .toml LSP.

Platform

Linux Mint 20.2

Terminal Emulator

MATE 1.24.0

Helix Version

22.12-200-g0f562dfe

@kristian-clausal kristian-clausal added the C-bug Category: This is a bug label Feb 1, 2023
@pascalkuthe
Copy link
Member

The discussion in #5718 might be related. K would guess that this would be fixed by #4939

@kristian-clausal
Copy link
Author

After this I tried out C-ret, C-comma (as "C-,") and C-period (as "C-."), which didn't work. C-minus is probably reserved by the terminal, seeing as how it changed size when I tried it. Alt works as expected.

@pascalkuthe
Copy link
Member

Yeah like I said there are some keybindings that are handeled by the terminal emulator and forwarded in a certain way to helix. There is nothing we can do about that. The only workaround is #4939 which uses a specical protocol supported by some terminal emulators to recive raw keyevents. Even then some emulators may still intercept some keybindings if they are bound to emulator specific functionality (like zomming in your example). Therre is nothing we can do about that

@kirawi kirawi added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 5, 2023
@the-mikedavis the-mikedavis removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 11, 2023
@kristian-clausal
Copy link
Author

Tried out the newest commits, and didn't work (as expected), but still, gotta try.

Some clarification: so the issue is that (basic) terminals just don't have support for Ctrl plus anything that isn't in a specific subset of ASCII? Is the "fix" just "use kitty"?

@pascalkuthe
Copy link
Member

There is fundamentally nothing a tui application can do about this problem except implement a protocols the emulator supports. Besides kitty this protocol is also supported by a few other emulators like wezterm, see https://sw.kovidgoyal.net/kitty/keyboard-protocol/. There seems to be issues (with a cautiously positive response) for implementing the feature in iterm2 and alacrity. But for now you do need to switch to an emulator that supports the protocol if you want to create these bindings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants