wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

Report operating system name, to enable native default key bindings

Open krobelus opened this issue 1 month ago • 3 comments

Is your feature request related to a problem? Please describe.

Native apps running on macOS have different default key bindings than the ones running on other OSs. I'd like to do the same in terminal apps.

Describe the solution you'd like

Kitty already has the kitty-query-os_name XTGETTCAP request, but I'd like to have a terminal-agnostic one (query-os-name or query-system-name) that returns

  • query-os-name=uname=$(uname) if WezTerm is running on Unix-like systems
  • query-os-name=Windows if on Windows
  • likewise for any other/future OSs (use uname if possible, else we can come up with a name)

I'd also be fine with dropping uname= prefix; I thought it helps to make the behavior extremely obvious.

Describe alternatives you've considered I guess we could advertise a "keybinding flavor" instead though that's probably too vague.

Additional context

  • https://github.com/kovidgoyal/kitty/issues/9217
  • https://codeberg.org/dnkl/foot/pulls/2217/

cc authors of terminals relevant to my use case (detecting whether the client OS is macOS or not) @christianparpart @gnachman @mitchellh (I wasn't sure if everyone is on https://gitlab.freedesktop.org/terminal-wg/)

krobelus avatar Nov 12 '25 15:11 krobelus

cc @rockorager who is a maintainer on Ghostty who represents the bulk of VT specifications.

mitchellh avatar Nov 12 '25 16:11 mitchellh

I think this is a good idea in general. I do think dropping uname would be better and the spec for this just says it's the output of uname on Unix-likes, otherwise some other platform specific name ("Windows").

rockorager avatar Nov 23 '25 13:11 rockorager

Ok, dropping uname= sounds fine to me, since I don't have a use case where I'd need to know whether the system is an arbitrary Unix. Both Python and NodeJS use win32 for Windows but I'm fine with either.

krobelus avatar Nov 23 '25 18:11 krobelus