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

On mac, default to OS-native keybinds #5754

Open
Ivorforce opened this issue Jun 25, 2024 · 4 comments
Open

On mac, default to OS-native keybinds #5754

Ivorforce opened this issue Jun 25, 2024 · 4 comments
Labels
docs Primarily or only affects documentation

Comments

@Ivorforce
Copy link

Ivorforce commented Jun 25, 2024

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 Ivorforce added the enhancement New feature or request label Jun 25, 2024
@wez
Copy link
Owner

wez commented Jul 13, 2024

I'm not going to do this, because wezterm is a cross-platform application intended to work the same way across multiple platforms with the same configuration file.

In addition, I also face criticism about the number of existing key assignments and I'm not happy to add even more.

What I think may be a reasonable middle ground is to collect together a list of things like this into a configuration snippet that can be easily found and enabled by those users that want it.

@wez wez added docs Primarily or only affects documentation and removed enhancement New feature or request labels Jul 13, 2024
@Ivorforce
Copy link
Author

I would argue that defaulting to native keybinds would be less confusing for most users than keybinds that areconsistent across OSs, because most users are more comfortable with interaction in native OS apps than any 3rd party app.

I agree though that an easily accessible way to decide for yourself, via snippets or presets, would be a decent middle ground.

@mfriedenhagen
Copy link

Maybe just adding this as a recipe in the documentation would be enough :-)
I added these as well because sometimes colleagues who watch my terminal might need a bit larger fonts :-)

    { mods = "CMD", key = "+", action = act.IncreaseFontSize },
    { mods = "CMD", key = "-", action = act.DecreaseFontSize },

@politicus
Copy link

Here is my contribution.

Nothing more than a short factual compilation of what I experienced since installing Wezterm a few days ago.

  • First phase: "wow looks very cool, lets watch this video and follow along. Installation went well and I played a little bit with different themes until I found the one I wanted.

  • Second phase: the last two hours. Decided to become a little more serious about it and set some key bindings. Long story short, I ended answering my needs (making Wezterm key bindings as close as these used to use in iTerm) after watching too many Youtube videos of Wezterm users, reading Wetzerm user settings files on Github, used perplexity.ai to finally find an answer on this Github issues. (Many thanks to @Ivorforce btw).

I do share @wez opinion as it totally make sense. A better/faster/easier way to make Wezterm my own would have help my onboarding as a new user.

What I think may be a reasonable middle ground is to collect together a list of things like this into a configuration snippet that can be easily found and enabled by those users that want it.

Very nice idea. Also has to be easy to find in the documentation as setting new key bindings is something any new user does quite fast after installing a new application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Primarily or only affects documentation
Projects
None yet
Development

No branches or pull requests

4 participants