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
49.35k stars 3k forks source link

key binding "ctrl+`" creates an invalid character #4624

Open Spoutnik97 opened 1 year ago

Spoutnik97 commented 1 year ago

Check for existing issues

Describe the bug / provide steps to reproduce it

I would like to open the terminal panel with the keybinding "ctrl+`" 'like on VSCode, but instead of opening a new panel, Zed write an "invalid character" in the current file. This character is invisible on Zed, but visible on VsCode

image

I don't understand how to debug this

Environment

Zed: v0.94.4 (stable) OS: macOS 13.4.0 Memory: 16 GiB Architecture: x86_64

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

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

No response

JosephTLyons commented 1 year ago

Hmmm, I actually can't reproduce this @Spoutnik97. Would you feel comfortable pasting in your settings.json and keymap.json contents?

JosephTLyons commented 1 year ago

Actually, can you also clarify the keybinding you're using?

Spoutnik97 commented 1 year ago

My settings.json : // Zed settings // // For information on how to configure Zed, see the Zed // documentation: https://zed.dev/docs/configuring-zed // // To see all of Zed's default settings without changing your // custom settings, run theopen default settingscommand // from the command palette or fromZedapplication menu. { "base_keymap": "VSCode", "theme": "One Dark", "buffer_font_size": 15, "formatter": { "external": { "command": "eslint", "arguments": [ "{buffer_path}" ] } }, "language_overrides": { "TypeScript": { "format_on_save": { "external": { "command": "eslint", "arguments": [ "{buffer_path}" ] } }, "formatter": "language_server" } } }

keymap.json :

[
  {
    "bindings": {
      "ctrl-ù": "workspace::ToggleBottomDock",
      "ctrl-t": "assistant::Assist"
    }
  },
  {
    "context": "Editor",
    "bindings": {
      "alt-up": "editor::MoveLineUp",
      "alt-down": "editor::MoveLineDown",
      "alt-shift-down": "editor::DuplicateLine",
    }
  }
]

Just to clarify, I am using an AZERTY (french keyboard on macos). I am using the "ctrl+`" keybinding

juliangarnier commented 1 month ago

I have a similar problem when typing "ctrl-"` on an AZERTY french keyboard on macos, I can't see the character, but some invisible characters are being added to the document (you can see the characters count go up)

https://github.com/user-attachments/assets/09a0fdfd-f729-4e18-8b61-283c4e04fd53

Temporary solution

The solution was to actually type "ctrl-<" as listed in the "View" menu, even if the default key bindings is configured with :

"ctrl-`": "terminal_panel::ToggleFocus",

Screenshot 2024-09-19 at 16 31 22

Screenshot 2024-09-19 at 16 24 52

Pretty sure this is a duplicate of #5195 and #5196.

Could this be resolved by #17031?