summaryrefslogtreecommitdiff
path: root/src/term.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/term.c b/src/term.c
index 71b19116c..a83f50679 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1643,6 +1643,7 @@ set_termname(term)
{KS_CIS, "IS"}, {KS_CIE, "IE"},
{KS_TS, "ts"}, {KS_FS, "fs"},
{KS_CWP, "WP"}, {KS_CWS, "WS"},
+ {KS_CSI, "SI"}, {KS_CEI, "EI"},
{(enum SpecialKey)0, NULL}
};
@@ -3400,6 +3401,31 @@ cursor_off()
}
/*
+ * Set cursor shape to match Insert mode.
+ */
+ void
+term_cursor_shape()
+{
+ static int showing_insert_mode = MAYBE;
+
+ if (!full_screen || *T_CSI == NUL || *T_CEI == NUL)
+ return;
+
+ if (State & INSERT)
+ {
+ if (showing_insert_mode != TRUE)
+ out_str(T_CSI); /* disable cursor */
+ showing_insert_mode = TRUE;
+ }
+ else
+ {
+ if (showing_insert_mode != FALSE)
+ out_str(T_CEI); /* disable cursor */
+ showing_insert_mode = FALSE;
+ }
+}
+
+/*
* Set scrolling region for window 'wp'.
* The region starts 'off' lines from the start of the window.
* Also set the vertical scroll region for a vertically split window. Always