tui: 'guicursor': use DECSCUSR for xterm-likes (#7576)

Anything claiming to be an xterm gets DECSCUSR. This is the only
reasonable choice unless/until we get more reliable detection (#7490).

ref #6997
closes #7550
This commit is contained in:
Justin M. Keyes 2017-11-17 22:24:01 +01:00 committed by GitHub
parent ee031eb525
commit 07931ed1c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 11 deletions

View File

@ -14,8 +14,6 @@
#include "nvim/event/rstream.h" #include "nvim/event/rstream.h"
#define PASTETOGGLE_KEY "<Paste>" #define PASTETOGGLE_KEY "<Paste>"
#define FOCUSGAINED_KEY "<FocusGained>"
#define FOCUSLOST_KEY "<FocusLost>"
#define KEY_BUFFER_SIZE 0xfff #define KEY_BUFFER_SIZE 0xfff
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS

View File

@ -1453,12 +1453,10 @@ static void patch_terminfo_bugs(TUIData *data, const char *term,
data->unibi_ext.set_cursor_style = unibi_find_ext_str(ut, "Ss"); data->unibi_ext.set_cursor_style = unibi_find_ext_str(ut, "Ss");
} }
if (-1 == data->unibi_ext.set_cursor_style) { if (-1 == data->unibi_ext.set_cursor_style) {
// The DECSCUSR sequence to change the cursor shape is widely // The DECSCUSR sequence to change the cursor shape is widely supported by
// supported by several terminal types and should be in many // several terminal types. https://github.com/gnachman/iTerm2/pull/92
// teminfo entries. See // xterm extension: vertical bar
// https://github.com/gnachman/iTerm2/pull/92 for more. if (!konsole && ((xterm && !vte_version) // anything claiming xterm compat
// xterm even has an extended version that has a vertical bar.
if (!konsole && (true_xterm // per xterm ctlseqs doco (since version 282)
// per MinTTY 0.4.3-1 release notes from 2009 // per MinTTY 0.4.3-1 release notes from 2009
|| putty || putty
// per https://bugzilla.gnome.org/show_bug.cgi?id=720821 // per https://bugzilla.gnome.org/show_bug.cgi?id=720821
@ -1470,9 +1468,8 @@ static void patch_terminfo_bugs(TUIData *data, const char *term,
// per analysis of VT100Terminal.m // per analysis of VT100Terminal.m
|| iterm || iterm_pretending_xterm || iterm || iterm_pretending_xterm
|| teraterm // per TeraTerm "Supported Control Functions" doco || teraterm // per TeraTerm "Supported Control Functions" doco
// Allows forcing the use of DECSCUSR on linux type terminals, such as // Some linux-type terminals (such as console-terminal-emulator
// console-terminal-emulator from the nosh toolset, which does indeed // from the nosh toolset) implement implement the xterm extension.
// implement the xterm extension:
|| (linuxvt && (xterm_version || (vte_version > 0) || colorterm)))) { || (linuxvt && (xterm_version || (vte_version > 0) || colorterm)))) {
data->unibi_ext.set_cursor_style = data->unibi_ext.set_cursor_style =
(int)unibi_add_ext_str(ut, "Ss", "\x1b[%p1%d q"); (int)unibi_add_ext_str(ut, "Ss", "\x1b[%p1%d q");