Skip to content

Commit

Permalink
Request xterm 'modifyOtherKeys' mode to opt-in CSI u key reporting
Browse files Browse the repository at this point in the history
Various terminal emulators now support this `CSI > 4 ; 1 m` sequence
to enable CSI u style reporting, opt into it on startup.

Closes mawww#4103
  • Loading branch information
mawww committed May 2, 2021
1 parent db9ef82 commit 47c0d20
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ncurses_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,8 @@ void NCursesUI::set_terminal_mode() const
fputs("\033=", stdout);
// force enable report focus events
fputs("\033[?1004h", stdout);
// request CSI u style key reporting
fputs("\033[>4;1m", stdout);
fflush(stdout);
}

Expand All @@ -420,6 +422,7 @@ void NCursesUI::restore_terminal_mode() const
tcsetattr(STDIN_FILENO, TCSAFLUSH, &m_original_termios);
fputs("\033>", stdout);
fputs("\033[?1004l", stdout);
fputs("\033[>4;0m", stdout);
fflush(stdout);
}

Expand Down

0 comments on commit 47c0d20

Please sign in to comment.