From 49528da8a60f8fd38ca491d6ccec47dfccf5f23c Mon Sep 17 00:00:00 2001 From: Anton Sharonov Date: Sun, 14 Apr 2024 20:02:24 +0200 Subject: patch 9.1.0321: Garbled output on serial terminals with XON/XOFF flow control Problem: When used terminal with XON/XOFF flow control, vim tries to still make CTRL-S mapping available, which results in severe screen corruption, especially on large redraws, and even spurious inputs (John Tsiombikas) Solution: Disallow CTRL-S mapping if such terminal is recognized. Don't remove IXON from the bitmask inversion. (Anton Sharonov) *** When started like this: TERM=vt420 vim :set termcap shows "t_xon=y" map :echo "abc" does nothing (after output freezes and subsequent unfreezes it) *** When started like this: TERM=xterm vim :set termcap shows "t_xon=" map :echo "abc" works (after one see "abc" string echo-ed) fixes: #12674 closes: #14542 Signed-off-by: Anton Sharonov Signed-off-by: Christian Brabandt --- src/termdefs.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/termdefs.h') diff --git a/src/termdefs.h b/src/termdefs.h index f28fd199b1..2b65abb1ce 100644 --- a/src/termdefs.h +++ b/src/termdefs.h @@ -115,10 +115,11 @@ enum SpecialKey KS_SRI, // restore icon text KS_FD, // disable focus event tracking KS_FE, // enable focus event tracking - KS_CF // set terminal alternate font + KS_CF, // set terminal alternate font + KS_XON // terminal uses xon/xoff handshaking }; -#define KS_LAST KS_CF +#define KS_LAST KS_XON /* * the terminal capabilities are stored in this array @@ -224,6 +225,7 @@ extern char_u *(term_strings[]); // current terminal strings #define T_SRI (TERM_STR(KS_SRI)) // restore icon text #define T_FD (TERM_STR(KS_FD)) // disable focus event tracking #define T_FE (TERM_STR(KS_FE)) // enable focus event tracking +#define T_XON (TERM_STR(KS_XON)) // terminal uses xon/xoff handshaking typedef enum { TMODE_COOK, // terminal mode for external cmds and Ex mode -- cgit v1.2.3