zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
47.27k stars 2.73k forks source link

Can't type @ with danish keyboard in terminal #17971

Open porsager opened 3 days ago

porsager commented 3 days ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Trying to type @ using (alt + '), the normal way on a danish keyboard, will type ' instead.

Environment

Zed: v0.152.3 (Zed) OS: macOS 14.6.1 Memory: 32 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log


CharlesChen0823 commented 2 days ago

try with this comments

porsager commented 2 days ago

Oh - thanks a lot!! A bit disappointed in my search abilities now.

That did the trick, but what is the reason for making this change, and requiring a setting? It's a new thing, so why change the default? It seems odd terminal input is different than the editor.

jansol commented 1 day ago

That did the trick, but what is the reason for making this change, and requiring a setting? It's a new thing, so why change the default? It seems odd terminal input is different than the editor.

The reason is that in terminal applications (most notably vim, emacs) alt+something is frequently used as a hotkey. At the same time macOS uses alt+something to type alternate characters, say, "ß". On a PC keyboard this is usually no problem because you have AltGr for typing alternate characters which is distinct from Alt. On macOS however, you have two functionally identical Alt (Option) keys, so terminals have to manually reinterpret anything that involves them.

My usual solution is to mirror the PC layout in the terminal, i.e. make the right Alt act as AltGr and leave the left the way macOS wants it (window.option_as_alt = "OnlyRight" in Alacritty).

notpeter commented 1 day ago

We're working proper support for mapping distinct actions to left/right alt key (e.g. alt/alt_gr or alt/meta) as well better handling of dead keys '¨', '^', etc in certain locales. There's some more discussion here: