Skip to content

Escape sequence to report operating system #8201

@krobelus

Description

@krobelus

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

I want to add platform-native default key bindings to fish shell.
For example if the terminal is running on macOS, alt-backspace should delete the last word and on other platforms ctrl-backspace should do that.
I believe this should be based on the client system the terminal is running on.
For example, when I run kitty -e ssh some-linux-host fish on macOS, the shell should be able to detect that.

Describe the solution you'd like

If it doesn't already exist, maybe something similar to XTVERSION but printing the operating system name from uname.

$ printf '\x1b[>1q'; cat -v
^[P>|Linux^[\

Could also make the request encoding include uname or OS, to make it obvious. That would probably require using a different command type. Happy to look at some alternatives tomorrow.

Describe alternatives you've considered

fish could map both alt-backspace and ctrl-backspace to the same thing.
That's not ideal because we want the other key to do something else (delete an entire shell-quoted argument).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions