wez / wezterm

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

Review and adopt http://www.leonerd.org.uk/hacks/fixterms/ #63

Open wez opened 4 years ago

wez commented 4 years ago

This page has a plan for fixing input in terminals: http://www.leonerd.org.uk/hacks/fixterms/

bew commented 4 years ago

Hello, with the latest commits, what is missing to be complete?

wez commented 4 years ago

I think this is probably done, but would appreciate feedback from someone that would notice the difference!

I believe that neovim will natively recognize CSI-u key bindings.

There probably should be a terminfo variant for CSI-u.

wez commented 4 years ago

What's left to call this done is to review this doc and verify that we're conforming when csi-u mode is enabled: https://gitlab.freedesktop.org/gnachman/specifications/-/blob/feature_reporting/proposals/feature-reporting/csi_u.md

alexherbo2 commented 3 years ago

Hello,

I was wondering how to see the list of options and their default values. I was looking for CSI u mode and was only able to find a reference in the change log to enable it.

~/.config/wezterm/wezterm.lua

return {
  enable_csi_u_key_encoding = true
}
wez commented 3 years ago

I was wondering how to see the list of options and their default values.

Ideally, the docs will have a clear section on each option. I try to make a point of covering the major features as they are completed.

In this case, it's not quite complete because it does require making another pass over the spec and then writing up the docs; one of the other items on my list here is work in progress in documenting all of the supported escape sequences input and output, and this is related.

If you wanted to go snooping for options, it's slightly awkward because the definition in code is in Rust, and there's a little bit of automated translation from lua. If you prefer reading code, the config/src directory is where the main Config struct is defined. Alternatively, if you run: RUST_LOG=trace wezterm 2> /tmp/wezterm.trace and search for Config in /tmp/wezterm.trace you'll see the effective Config struct being used by wezterm.

ariasuni commented 3 years ago

Kitty adopted a slightly different version of fixterms, according to them:

The protocol is based on initial work in fixterms, however, it corrects various issues in that proposal, listed at the bottom of this document. For public discussion of this spec, see #3248.

stevenxxiu commented 3 years ago

Thanks for this. I was trying to do this manually yesterday, and didn't see WezTerm's flag for this.

For some keys WezTerm appears to have not implemented the spec for:

Key Combo Spec (my reading) WezTerm's output
Alt + UpArrow \x1b[1;3A \x1b\x1b[A
Alt + LeftArrow \x1b[1;3B \x1b\x1b[B
Alt + RightArrow \x1b[1;3D \x1b\x1b[D
Alt + DownArrow \x1b[1;3C \x1b\x1b[C
Alt + Home \x1b[1;3H \x1b\x1b[H
Alt + End \x1b[1;3F \x1b\x1b[F
Ctrl + Shift + UpArrow \x1b[1;6A N/A
Ctrl + Shift + DownArrow \x1b[1;6B N/A
Ctrl + Shift + LeftArrow \x1b[1;6D N/A
Ctrl + Shift + RightArrow \x1b[1;6C N/A