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

Terminal: emacs shortcuts not working: alt-f, ctrl-f, alt-b, etc. #14543

Closed
1 task done
bersace opened this issue Jul 16, 2024 · 7 comments · Fixed by #14556
Closed
1 task done

Terminal: emacs shortcuts not working: alt-f, ctrl-f, alt-b, etc. #14543

bersace opened this issue Jul 16, 2024 · 7 comments · Fixed by #14556
Labels
bug [core label] internationalization Feedback for human language support, translations, etc keymap / key binding Feedback for keyboard shortcuts, key mapping, etc linux

Comments

@bersace
Copy link

bersace commented Jul 16, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Hi,

zed is awesome, thanks.

I'm using bash and used to type ctrl-f/alt-f, etc. to move inside the readline editor. It's works perfectly in alacritty. However, in Zed, typeing ctrl-f inserts f. Same for alt-f.

I watched this behaviour with the following shortcuts:

  • alt-f
  • ctrl-f
  • alt-b
  • alt-u

I tried the following keymap without success:

  {
    "context": "Terminal",
    "bindings": {
      "ctrl-f": ["terminal::SendKeystroke", "ctrl-f"],
      "alt-f": ["terminal::SendKeystroke", "alt-f"]
    }
  }

Do you have a clue on what's happening ?

On this subject, default keybings uses a lot ctrl-k as a shortcut prefix. This slows down bare ctrl-k (kill line) in bash. It seems that the default-linux.json keymaps does not cohabitate well with terminal shortcuts.

Regards,
Étienne

Environment

Zed: v0.143.7 (Zed)
OS: Linux Wayland debian 12
Memory: 15.3 GiB
Architecture: x86_64

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
@bersace bersace added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Jul 16, 2024
@notpeter
Copy link
Member

Good morning,

Yes, the ctrl-k (cmd-k on mac) is a known outstanding issue:

Sorry to hear that terminal::SendKeystroke is not functioning for you. Do any ctrl/alt shortcuts work for you in terminal or are they all broken? Can you share some more details about your setup (Desktop Environment, Window Manager, keyboard layout, etc).

You may also want to vote for this issue too:

@bersace
Copy link
Author

bersace commented Jul 16, 2024

Thanks @notpeter for your anwser.

ctrl-u, ctrl-a and other are working.

I'm running GNOME on Wayland with a French AZERTY keymap. I have Ctrl and Caps lock swapped.

@notpeter

This comment was marked as outdated.

@bersace

This comment was marked as resolved.

@notpeter notpeter added linux internationalization Feedback for human language support, translations, etc keymap / key binding Feedback for keyboard shortcuts, key mapping, etc and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Jul 16, 2024
@Tomato6966
Copy link

Experiencing similar issue on windows.:

I did a cargo build + run on windows.

When i add a keymap (default is vscode) e.g. "ctrl-k ctrl-f": "editor::Format"
i first can't format the code when pressing the keymap, because there is the default map "ctrl-k" which focusses and toggles the searchbar, aka i can't create that keymap as i'm used to in vscode forexample
or when i want to add a comment line command for "ctrl-k ctrl-c" it's still the same aka all keymaps which have a "ctrl-k" in it, don't work, cause the searchbar will always get toggled first

Trying to override this keymap also doesn't work.

@notpeter
Copy link
Member

@bersace I merged PR #14556 from @CharlesChen0823 to fix this.

Turns out that change is unnecessary and this can be controlled via terminal.option_as_meta in settings.

In #15535 I'm reverting #14556 and changing the option_as_meta default to true.
This will land in Zed Preview later today and in Zed Stable in a week (2024-08-06).

Until then you can add the following to your settings:

  "terminal": {
    "option_as_meta": true
  },

@AntonRich
Copy link

AntonRich commented Dec 16, 2024

@notpeter thanks it worked. I had to delete the key settings though. Turning this option on worked by itself (which surprised me).

P.S. Only had to leave off ctrl+b binding as it would open the workspace panel (file observer).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] internationalization Feedback for human language support, translations, etc keymap / key binding Feedback for keyboard shortcuts, key mapping, etc linux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants