diff src/term.c @ 34132:8f94a72dfbed v9.1.0029

patch 9.1.0029: Cannot act on various terminal response codes Commit: https://github.com/vim/vim/commit/d7d560374b836e62e180914b6e85f0eb20557a54 Author: Danek Duvall <duvall@comfychair.org> Date: Sun Jan 14 20:19:59 2024 +0100 patch 9.1.0029: Cannot act on various terminal response codes Problem: Cannot act on various terminal response codes Solution: Add the TerminalResponseAll autocommand (Danek Duvall) closes: #13829 Signed-off-by: Danek Duvall <duvall@comfychair.org> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sun, 14 Jan 2024 20:30:04 +0100
parents 1629cc65d78d
children 36843e079f64
line wrap: on
line diff
--- a/src/term.c
+++ b/src/term.c
@@ -4986,6 +4986,8 @@ handle_u7_response(int *arg, char_u *tp 
 #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 +5597,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 +5625,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
 
@@ -5784,6 +5790,8 @@ handle_osc(char_u *tp, char_u *argp, int
 		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 +5890,8 @@ handle_dcs(char_u *tp, char_u *argp, int
 #ifdef FEAT_EVAL
 		set_vim_var_string(VV_TERMSTYLERESP, tp, *slen);
 #endif
+		apply_autocmds(EVENT_TERMRESPONSEALL,
+					(char_u *)"cursorshape", NULL, FALSE, curbuf);
 		break;
 	    }
 	}