summaryrefslogtreecommitdiffstats
path: root/src/term.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c41
1 files changed, 38 insertions, 3 deletions
diff --git a/src/term.c b/src/term.c
index dd59fdf..8aa86ce 100644
--- a/src/term.c
+++ b/src/term.c
@@ -625,7 +625,7 @@ static tcap_entry_T builtin_kitty[] = {
#ifdef FEAT_TERMGUICOLORS
/*
- * Additions for using the RGB colors
+ * Additions for using the RGB colors and terminal font
*/
static tcap_entry_T builtin_rgb[] = {
// These are printf strings, not terminal codes.
@@ -637,6 +637,14 @@ static tcap_entry_T builtin_rgb[] = {
};
#endif
+#ifdef HAVE_TGETENT
+static tcap_entry_T special_term[] = {
+ // These are printf strings, not terminal codes.
+ {(int)KS_CF, "\033[%dm"},
+ {(int)KS_NAME, NULL} // end marker
+};
+#endif
+
/*
* iris-ansi for Silicon Graphics machines.
*/
@@ -1235,6 +1243,7 @@ static tcap_entry_T builtin_debug[] = {
{(int)KS_U7, "[U7]"},
{(int)KS_RFG, "[RFG]"},
{(int)KS_RBG, "[RBG]"},
+ {(int)KS_CF, "[CF%d]"},
{K_UP, "[KU]"},
{K_DOWN, "[KD]"},
{K_LEFT, "[KL]"},
@@ -1754,6 +1763,7 @@ get_term_entries(int *height, int *width)
{KS_CBE, "BE"}, {KS_CBD, "BD"},
{KS_CST, "ST"}, {KS_CRT, "RT"},
{KS_SSI, "Si"}, {KS_SRI, "Ri"},
+ {KS_CF, "CF"},
{(enum SpecialKey)0, NULL}
};
int i;
@@ -2113,6 +2123,10 @@ set_termname(char_u *term)
&& term_strings_not_set(KS_8U))
apply_builtin_tcap(term, builtin_rgb, TRUE);
#endif
+#ifdef HAVE_TGETENT
+ if (term_strings_not_set(KS_CF))
+ apply_builtin_tcap(term, special_term, TRUE);
+#endif
}
/*
@@ -3116,6 +3130,17 @@ term_set_winsize(int height, int width)
}
#endif
+ void
+term_font(int n)
+{
+ if (*T_CFO)
+ {
+ char buf[20];
+ sprintf(buf, (char *)T_CFO, 9 + n);
+ OUT_STR(buf);
+ }
+}
+
static void
term_color(char_u *s, int n)
{
@@ -4986,6 +5011,8 @@ handle_u7_response(int *arg, char_u *tp UNUSED, int csi_len UNUSED)
#ifdef FEAT_EVAL
set_vim_var_string(VV_TERMU7RESP, tp, csi_len);
#endif
+ apply_autocmds(EVENT_TERMRESPONSEALL,
+ (char_u *)"ambiguouswidth", NULL, FALSE, curbuf);
}
}
else if (arg[0] == 3)
@@ -5595,6 +5622,8 @@ handle_csi(
#endif
apply_autocmds(EVENT_TERMRESPONSE,
NULL, NULL, FALSE, curbuf);
+ apply_autocmds(EVENT_TERMRESPONSEALL,
+ (char_u *)"version", NULL, FALSE, curbuf);
key_name[0] = (int)KS_EXTRA;
key_name[1] = (int)KE_IGNORE;
}
@@ -5621,6 +5650,8 @@ handle_csi(
# ifdef FEAT_EVAL
set_vim_var_string(VV_TERMBLINKRESP, tp, *slen);
# endif
+ apply_autocmds(EVENT_TERMRESPONSEALL,
+ (char_u *)"cursorblink", NULL, FALSE, curbuf);
}
#endif
@@ -5737,8 +5768,8 @@ handle_osc(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen)
int rval, gval, bval;
rval = hexhex2nr(tp_r);
- gval = hexhex2nr(tp_b);
- bval = hexhex2nr(tp_g);
+ gval = hexhex2nr(tp_g);
+ bval = hexhex2nr(tp_b);
#endif
if (is_bg)
{
@@ -5784,6 +5815,8 @@ handle_osc(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen)
set_vim_var_string(is_bg ? VV_TERMRBGRESP
: VV_TERMRFGRESP, tp, *slen);
#endif
+ apply_autocmds(EVENT_TERMRESPONSEALL,
+ is_bg ? (char_u *)"background" : (char_u *)"foreground", NULL, FALSE, curbuf);
break;
}
if (i == len)
@@ -5882,6 +5915,8 @@ handle_dcs(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen)
#ifdef FEAT_EVAL
set_vim_var_string(VV_TERMSTYLERESP, tp, *slen);
#endif
+ apply_autocmds(EVENT_TERMRESPONSEALL,
+ (char_u *)"cursorshape", NULL, FALSE, curbuf);
break;
}
}