wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

On mac, default to OS-native keybinds

Open Ivorforce opened this issue 8 months ago • 3 comments

Is your feature request related to a problem? Please describe. macOS has very consistent keybinds across their apps. I would expect my terminal emulator to default to these keybinds to offer a native feeling user experience, without the need to learn the app's keybinds.

Describe the solution you'd like Wezterm should default to mac native keybinds. The ones I've missed, so far:

  • Option + left / right word cursor movement
  • Cmd + left / right line cursor movement
  • Cmd + shift + left / right tab selection

Describe alternatives you've considered Key rebinding in the config is possible:

local act = wezterm.action
config.keys = {
	{ mods = "OPT", key = "LeftArrow", action = act.SendKey({ mods = "ALT", key = "b" }) },
	{ mods = "OPT", key = "RightArrow", action = act.SendKey({ mods = "ALT", key = "f" }) },
	{ mods = "CMD", key = "LeftArrow", action = act.SendKey({ mods = "CTRL", key = "a" }) },
	{ mods = "CMD", key = "RightArrow", action = act.SendKey({ mods = "CTRL", key = "e" }) },
	{ mods = "CMD", key = "Backspace", action = act.SendKey({ mods = "CTRL", key = "u" }) },
	{ mods = "CMD|OPT", key = "LeftArrow", action = act.ActivateTabRelative(-1) },
	{ mods = "CMD|OPT", key = "RightArrow", action = act.ActivateTabRelative(1) },
	{ mods = "CMD|SHIFT", key = "LeftArrow", action = act.ActivateTabRelative(-1) },
	{ mods = "CMD|SHIFT", key = "RightArrow", action = act.ActivateTabRelative(1) },
}

Additional context I'm happy to submit a PR but I did not find a proper place. commands.rs seems relevant, but these keybinds would have to be OS-specific.

Ivorforce avatar Jun 25 '24 13:06 Ivorforce