wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
17.77k stars 795 forks source link

Leader key shortcuts not working after upgrade #1744

Closed humboldtux closed 2 years ago

humboldtux commented 2 years ago

What Operating System(s) are you seeing this problem on?

Linux X11

WezTerm version

wezterm 20220321-074757-aba3da6a

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

After upgrading wezterm to 20220321-* , my leader key shortcuts don't work anymore.

To Reproduce

Using the following configuration,, With wezterm <= 20220101, my leader key shortcuts worked.

Using the following configuration, upgrading to wezterm 20220321-*, my leader key shortcuts stopped working.

Using the following configuration and Downgrading to 20220101, my leader key shortcuts work again.

Configuration

local wezterm = require 'wezterm';

return {
  enable_tab_bar = true,
  hide_tab_bar_if_only_one_tab = true,

  font = wezterm.font("JetBrainsMono Nerd Font Mono"),

  color_scheme = "nord",

  inactive_pane_hsb = {
    saturation = 0.9,
    brightness = 0.7,
  },

  disable_default_key_bindings = true,
  -- timeout_milliseconds defaults to 1000 and can be omitted
  leader = { key="a", mods="CTRL", timeout_milliseconds=1000 },
  keys = {
    -- Send "CTRL-A" to the terminal when pressing CTRL-A, CTRL-A
    {key="a", mods="LEADER|CTRL", action=wezterm.action{SendString="\x01"}},
    {key="t", mods="LEADER", action=wezterm.action{SpawnTab="CurrentPaneDomain"}},
    {key="o", mods="LEADER", action=wezterm.action{SplitHorizontal={domain="CurrentPaneDomain"}}},
    {key="v", mods="LEADER", action=wezterm.action{SplitVertical={domain="CurrentPaneDomain"}}},
    {key="h", mods="LEADER", action=wezterm.action{ActivatePaneDirection="Left"}},
    {key="l", mods="LEADER", action=wezterm.action{ActivatePaneDirection="Right"}},
    {key="j", mods="LEADER", action=wezterm.action{ActivatePaneDirection="Down"}},
    {key="k", mods="LEADER", action=wezterm.action{ActivatePaneDirection="Up"}},
    {key="f", mods="LEADER", action=wezterm.action{Search={CaseSensitiveString=""}}},
    {key="-", mods="LEADER", action="DecreaseFontSize"},
    {key="_", mods="LEADER", action="IncreaseFontSize"},
    {key="=", mods="LEADER", action="ResetFontSize"},
    {key="w", mods="LEADER", action=wezterm.action{CloseCurrentPane={confirm=true}}},
    {key="z", mods="LEADER", action="TogglePaneZoomState"},
    {key="PageUp", mods="SHIFT", action=wezterm.action{ScrollByPage=-1}},
    {key="PageDown", mods="SHIFT", action=wezterm.action{ScrollByPage=1}},
    {key="Tab", mods="CTRL", action=wezterm.action{ActivateTabRelative=1}},
    {key="Tab", mods="CTRL|SHIFT", action=wezterm.action{ActivateTabRelative=-1}},
    {key="c", mods="CTRL|SHIFT", action=wezterm.action{CopyTo="Clipboard"}},
    {key="v", mods="CTRL|SHIFT", action=wezterm.action{PasteFrom="Clipboard"}},
    {key="LeftArrow", mods="CTRL|SHIFT", action=wezterm.action{AdjustPaneSize={"Left", 1}}},
    {key="RightArrow", mods="CTRL|SHIFT", action=wezterm.action{AdjustPaneSize={"Right", 1}}},
    {key="UpArrow", mods="CTRL|SHIFT", action=wezterm.action{AdjustPaneSize={"Up", 1}}},
    {key="DownArrow", mods="CTRL|SHIFT", action=wezterm.action{AdjustPaneSize={"Down", 1}}},
  }
}

Expected Behavior

I want Ctrl+a shortcuts to work.

Logs

 2022-03-21T18:30:22.885Z WARN  wezterm_gui > while attempting to ask existing instance to spawn: Running GUI is a different executable from us, will start a new one
 2022-03-21T18:30:22.894Z INFO  wezterm_mux_server_impl::local > setting up /run/user/1000/wezterm/gui-sock-197339
 2022-03-21T18:30:23.019Z INFO  wezterm_gui::termwindow        > OpenGL initialized! Mesa Intel(R) UHD Graphics 630 (CFL GT2) 4.6 (Compatibility Profile) Mesa 20.3.5 is_context_loss_possible=false wezterm version: 20220321-074757-aba3da6a

Anything else?

No response

wez commented 2 years ago

I tried your config and CTRL-A, t creates a new tab, and CTRL-A CTRL-A sends \x01. What isn't working for you?

martinsrso commented 2 years ago

Hey @wez, I have the same problem. I use dvorak layout and I saw the keyboards default shortcut mapped by to QWERTY. Then I had cmd+' to quit per example. I use the newest version of wezterm a 20220319-142410.

bew commented 2 years ago

I'm pretty sure the behavior you both see is explained by the new distinction between the physical key and the mapped key, and the default now being a physical key (on the qwerty layout), instead of the mapped key (on the layout configured in the OS): https://wezfurlong.org/wezterm/config/keys.html#physical-vs-mapped-key-assignments

martinsrso commented 2 years ago

I tested this behavior and that isn't working.

When I used { key = "mapped:r", mods = "SUPER", action = wezterm.action({ SpawnTab = "CurrentPaneDomain" }) }, every key tested works except t.

wez commented 2 years ago

@martinsrso please open a separate issue with information about your setup, thanks!

humboldtux commented 2 years ago

Thank you @bew, i am using a Azerty FR layout, and totally overlooked this new configuration feature. Updated my configuration and everything is working as expected with latest Wezterm.

Sorry about that.

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.