@@ -67,15 +67,20 @@ static int term_is_builtin(char_u *name);
67
67
static int term_7to8bit (char_u * p );
68
68
static void accept_modifiers_for_function_keys (void );
69
69
70
- # if 0 // Change to 1 to enable ch_log() calls for termresponse debugging.
71
- # define DEBUG_TERMRESPONSE
72
- # define LOG_TR (fmt ,...) \
73
- ch_log(NULL, "TermResp: %s " fmt, \
74
- must_redraw == UPD_NOT_VALID ? "NV" \
75
- : must_redraw == UPD_CLEAR ? "CL" : " ", ##__VA_ARGS__)
76
- # else
77
- # define LOG_TR (fmt ,...) do { /**/ } while (0 )
78
- # endif
70
+ #if 0 // Change to 1 to enable ch_log() calls for termresponse debugging.
71
+ # define DEBUG_TERMRESPONSE
72
+ # define LOG_TR1 (str ) \
73
+ ch_log(NULL, "TermResp: %s " str, \
74
+ must_redraw == UPD_NOT_VALID ? "NV" \
75
+ : must_redraw == UPD_CLEAR ? "CL" : " ")
76
+ # define LOG_TRN (fmt ,...) \
77
+ ch_log(NULL, "TermResp: %s " fmt, \
78
+ must_redraw == UPD_NOT_VALID ? "NV" \
79
+ : must_redraw == UPD_CLEAR ? "CL" : " ", __VA_ARGS__)
80
+ #else
81
+ # define LOG_TR1 (str ) do { /**/ } while (0 )
82
+ # define LOG_TRN (fmt ,...) do { /**/ } while (0 )
83
+ #endif
79
84
80
85
#ifdef HAVE_TGETENT
81
86
static char * invoke_tgetent (char_u * , char_u * );
@@ -1691,7 +1696,7 @@ may_adjust_color_count(int val)
1691
1696
{
1692
1697
int r = redraw_asap (UPD_CLEAR );
1693
1698
1694
- LOG_TR ("Received t_Co, redraw_asap(): %d" , r );
1699
+ LOG_TRN ("Received t_Co, redraw_asap(): %d" , r );
1695
1700
}
1696
1701
#else
1697
1702
redraw_asap (UPD_CLEAR );
@@ -2300,7 +2305,7 @@ set_termname(char_u *term)
2300
2305
full_screen = TRUE; // we can use termcap codes from now on
2301
2306
set_term_defaults (); // use current values as defaults
2302
2307
#ifdef FEAT_TERMRESPONSE
2303
- LOG_TR ("setting crv_status to STATUS_GET" );
2308
+ LOG_TR1 ("setting crv_status to STATUS_GET" );
2304
2309
crv_status .tr_progress = STATUS_GET ; // Get terminal version later
2305
2310
write_t_8u_state = FALSE;
2306
2311
#endif
@@ -4080,7 +4085,7 @@ may_req_termresponse(void)
4080
4085
&& * T_CRV != NUL )
4081
4086
{
4082
4087
MAY_WANT_TO_LOG_THIS ;
4083
- LOG_TR ("Sending CRV request" );
4088
+ LOG_TR1 ("Sending CRV request" );
4084
4089
out_str (T_CRV );
4085
4090
termrequest_sent (& crv_status );
4086
4091
// check for the characters now, otherwise they might be eaten by
@@ -4119,7 +4124,7 @@ check_terminal_behavior(void)
4119
4124
// changes cursor position, so it must be called immediately after
4120
4125
// entering termcap mode.
4121
4126
MAY_WANT_TO_LOG_THIS ;
4122
- LOG_TR ("Sending request for ambiwidth check" );
4127
+ LOG_TR1 ("Sending request for ambiwidth check" );
4123
4128
// Do this in the second row. In the first row the returned sequence
4124
4129
// may be CSI 1;2R, which is the same as <S-F3>.
4125
4130
term_windgoto (1 , 0 );
@@ -4148,7 +4153,7 @@ check_terminal_behavior(void)
4148
4153
// handles test sequence incorrectly, a garbage string is displayed and
4149
4154
// the cursor does move.
4150
4155
MAY_WANT_TO_LOG_THIS ;
4151
- LOG_TR ("Sending xterm compatibility test sequence." );
4156
+ LOG_TR1 ("Sending xterm compatibility test sequence." );
4152
4157
// Do this in the third row. Second row is used by ambiguous
4153
4158
// character width check.
4154
4159
term_windgoto (2 , 0 );
@@ -4199,7 +4204,7 @@ may_req_bg_color(void)
4199
4204
if (rfg_status .tr_progress == STATUS_GET && * T_RFG != NUL )
4200
4205
{
4201
4206
MAY_WANT_TO_LOG_THIS ;
4202
- LOG_TR ("Sending FG request" );
4207
+ LOG_TR1 ("Sending FG request" );
4203
4208
out_str (T_RFG );
4204
4209
termrequest_sent (& rfg_status );
4205
4210
didit = TRUE;
@@ -4210,7 +4215,7 @@ may_req_bg_color(void)
4210
4215
if (rbg_status .tr_progress == STATUS_GET && * T_RBG != NUL )
4211
4216
{
4212
4217
MAY_WANT_TO_LOG_THIS ;
4213
- LOG_TR ("Sending BG request" );
4218
+ LOG_TR1 ("Sending BG request" );
4214
4219
out_str (T_RBG );
4215
4220
termrequest_sent (& rbg_status );
4216
4221
didit = TRUE;
@@ -4828,7 +4833,7 @@ switch_to_8bit(void)
4828
4833
need_gather = TRUE; // need to fill termleader[]
4829
4834
}
4830
4835
detected_8bit = TRUE;
4831
- LOG_TR ("Switching to 8 bit" );
4836
+ LOG_TR1 ("Switching to 8 bit" );
4832
4837
}
4833
4838
4834
4839
#ifdef CHECK_DOUBLE_CLICK
@@ -4981,7 +4986,7 @@ handle_u7_response(int *arg, char_u *tp UNUSED, int csi_len UNUSED)
4981
4986
{
4982
4987
char * aw = NULL ;
4983
4988
4984
- LOG_TR ("Received U7 status: %s" , tp );
4989
+ LOG_TRN ("Received U7 status: %s" , tp );
4985
4990
u7_status .tr_progress = STATUS_GOT ;
4986
4991
did_cursorhold = TRUE;
4987
4992
if (arg [1 ] == 2 )
@@ -4998,7 +5003,7 @@ handle_u7_response(int *arg, char_u *tp UNUSED, int csi_len UNUSED)
4998
5003
{
4999
5004
int r = redraw_asap (UPD_CLEAR );
5000
5005
5001
- LOG_TR ("set 'ambiwidth', redraw_asap(): %d" , r );
5006
+ LOG_TRN ("set 'ambiwidth', redraw_asap(): %d" , r );
5002
5007
}
5003
5008
#else
5004
5009
redraw_asap (UPD_CLEAR );
@@ -5014,7 +5019,7 @@ handle_u7_response(int *arg, char_u *tp UNUSED, int csi_len UNUSED)
5014
5019
{
5015
5020
int value ;
5016
5021
5017
- LOG_TR ("Received compatibility test result: %s" , tp );
5022
+ LOG_TRN ("Received compatibility test result: %s" , tp );
5018
5023
xcc_status .tr_progress = STATUS_GOT ;
5019
5024
5020
5025
// Third row: xterm compatibility test.
@@ -5038,7 +5043,7 @@ handle_version_response(int first, int *arg, int argc, char_u *tp)
5038
5043
// version.
5039
5044
int version = arg [1 ];
5040
5045
5041
- LOG_TR ("Received CRV response: %s" , tp );
5046
+ LOG_TRN ("Received CRV response: %s" , tp );
5042
5047
crv_status .tr_progress = STATUS_GOT ;
5043
5048
did_cursorhold = TRUE;
5044
5049
@@ -5081,7 +5086,7 @@ handle_version_response(int first, int *arg, int argc, char_u *tp)
5081
5086
// terminals the request should be ignored.
5082
5087
if (version >= 141 && p_xtermcodes )
5083
5088
{
5084
- LOG_TR ("Enable checking for XT codes" );
5089
+ LOG_TR1 ("Enable checking for XT codes" );
5085
5090
check_for_codes = TRUE;
5086
5091
need_gather = TRUE;
5087
5092
req_codes_from_term ();
@@ -5251,7 +5256,7 @@ handle_version_response(int first, int *arg, int argc, char_u *tp)
5251
5256
&& * T_CRS != NUL )
5252
5257
{
5253
5258
MAY_WANT_TO_LOG_THIS ;
5254
- LOG_TR ("Sending cursor style request" );
5259
+ LOG_TR1 ("Sending cursor style request" );
5255
5260
out_str (T_CRS );
5256
5261
termrequest_sent (& rcs_status );
5257
5262
need_flush = TRUE;
@@ -5266,7 +5271,7 @@ handle_version_response(int first, int *arg, int argc, char_u *tp)
5266
5271
&& * T_CRC != NUL )
5267
5272
{
5268
5273
MAY_WANT_TO_LOG_THIS ;
5269
- LOG_TR ("Sending cursor blink mode request" );
5274
+ LOG_TR1 ("Sending cursor blink mode request" );
5270
5275
out_str (T_CRC );
5271
5276
termrequest_sent (& rbm_status );
5272
5277
need_flush = TRUE;
@@ -5638,7 +5643,7 @@ handle_csi(
5638
5643
{
5639
5644
initial_cursor_blink = (arg [1 ] == '1' );
5640
5645
rbm_status .tr_progress = STATUS_GOT ;
5641
- LOG_TR ("Received cursor blinking mode response: %s" , tp );
5646
+ LOG_TRN ("Received cursor blinking mode response: %s" , tp );
5642
5647
key_name [0 ] = (int )KS_EXTRA ;
5643
5648
key_name [1 ] = (int )KE_IGNORE ;
5644
5649
* slen = csi_len ;
@@ -5771,7 +5776,7 @@ handle_osc(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen)
5771
5776
char * new_bg_val = (3 * '6' < * tp_r + * tp_g +
5772
5777
* tp_b ) ? "light" : "dark" ;
5773
5778
5774
- LOG_TR ("Received RBG response: %s" , tp );
5779
+ LOG_TRN ("Received RBG response: %s" , tp );
5775
5780
#ifdef FEAT_TERMRESPONSE
5776
5781
rbg_status .tr_progress = STATUS_GOT ;
5777
5782
# ifdef FEAT_TERMINAL
@@ -5793,7 +5798,7 @@ handle_osc(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen)
5793
5798
#if defined(FEAT_TERMRESPONSE ) && defined(FEAT_TERMINAL )
5794
5799
else
5795
5800
{
5796
- LOG_TR ("Received RFG response: %s" , tp );
5801
+ LOG_TRN ("Received RFG response: %s" , tp );
5797
5802
rfg_status .tr_progress = STATUS_GOT ;
5798
5803
fg_r = rval ;
5799
5804
fg_g = gval ;
@@ -5816,7 +5821,7 @@ handle_osc(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen)
5816
5821
}
5817
5822
if (i == len )
5818
5823
{
5819
- LOG_TR ("not enough characters for RB" );
5824
+ LOG_TR1 ("not enough characters for RB" );
5820
5825
return FAIL ;
5821
5826
}
5822
5827
return OK ;
@@ -5846,7 +5851,7 @@ handle_dcs(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen)
5846
5851
{
5847
5852
int i , j ;
5848
5853
5849
- LOG_TR ("Received DCS response: %s" , (char * )tp );
5854
+ LOG_TRN ("Received DCS response: %s" , (char * )tp );
5850
5855
j = 1 + (tp [0 ] == ESC );
5851
5856
if (len < j + 3 )
5852
5857
i = len ; // need more chars
@@ -5903,7 +5908,7 @@ handle_dcs(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen)
5903
5908
(number & 1 ) ? FALSE : TRUE;
5904
5909
rcs_status .tr_progress = STATUS_GOT ;
5905
5910
#endif
5906
- LOG_TR ("Received cursor shape response: %s" , tp );
5911
+ LOG_TRN ("Received cursor shape response: %s" , tp );
5907
5912
5908
5913
key_name [0 ] = (int )KS_EXTRA ;
5909
5914
key_name [1 ] = (int )KE_IGNORE ;
@@ -5922,7 +5927,7 @@ handle_dcs(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen)
5922
5927
{
5923
5928
// These codes arrive many together, each code can be
5924
5929
// truncated at any point.
5925
- LOG_TR ("not enough characters for XT" );
5930
+ LOG_TR1 ("not enough characters for XT" );
5926
5931
return FAIL ;
5927
5932
}
5928
5933
return OK ;
@@ -6274,7 +6279,7 @@ check_termcode(
6274
6279
{
6275
6280
#ifdef DEBUG_TERMRESPONSE
6276
6281
if (resp == -1 )
6277
- LOG_TR ("Not enough characters for CSI sequence" );
6282
+ LOG_TR1 ("Not enough characters for CSI sequence" );
6278
6283
#endif
6279
6284
return resp ;
6280
6285
}
@@ -6565,7 +6570,7 @@ check_termcode(
6565
6570
}
6566
6571
6567
6572
#ifdef FEAT_TERMRESPONSE
6568
- LOG_TR ("normal character" );
6573
+ LOG_TR1 ("normal character" );
6569
6574
#endif
6570
6575
6571
6576
return 0 ; // no match found
@@ -7107,7 +7112,7 @@ req_more_codes_from_term(void)
7107
7112
char * key_name = key_names [xt_index_out ];
7108
7113
7109
7114
MAY_WANT_TO_LOG_THIS ;
7110
- LOG_TR ("Requesting XT %d: %s" , xt_index_out , key_name );
7115
+ LOG_TRN ("Requesting XT %d: %s" , xt_index_out , key_name );
7111
7116
if (key_name [2 ] != NUL )
7112
7117
sprintf (buf , "\033P+q%02x%02x%02x\033\\" , key_name [0 ], key_name [1 ], key_name [2 ]);
7113
7118
else
@@ -7161,7 +7166,7 @@ got_code_from_term(char_u *code, int len)
7161
7166
}
7162
7167
}
7163
7168
7164
- LOG_TR ("Received XT %d: %s" , xt_index_in , (char * )name );
7169
+ LOG_TRN ("Received XT %d: %s" , xt_index_in , (char * )name );
7165
7170
7166
7171
if (key_names [i ] != NULL )
7167
7172
{
0 commit comments