wez / wezterm

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

\033[=0;1u not working as expected #3593

Open unxed opened 1 year ago

unxed commented 1 year ago

What Operating System(s) are you seeing this problem on?

Linux X11

Which Wayland compositor or X11 Window manager(s) are you using?

Muffin

WezTerm version

wezterm 20230415-235902-6ec11393

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

Try

printf '\033[=31u\033[=0;1u'

This should enable kitty enhanced keyboard mode and disable back. After it, try to press arrow keys (up arrow, for example) in bash. You will get "A" char instead of scrolling to previously typed command.

To Reproduce

1.

printf '\033[=31u\033[=0;1u'
  1. Press UpArrow

Configuration

no config

Expected Behavior

kitty mode should be disabled, up arrow should show previously typed command

Logs

No response

Anything else?

No response

unxed commented 2 months ago

Workaround: use \033[>31u and \033[<u instead.

jmdevin commented 1 month ago

@wez this seems to be affecting vim directly, though I don't know if you want a separate bug report. Vim uses ^[[=0;1u to disable the kitty protocol when it exits (see here: link). The fact that =0;1u is not working means that starting and then exiting vim break a lot of the keys in the terminal. This is on wezterm 20240203-110809-5046fc22 and vim 9.1.0720.

Right now I'm working around it in vim itself by editing t_TE to the value @unxed provided, but it's not very convenient.