# ifdef HAVE_OUTFUNTYPE
# define TPUTSFUNCAST (outfuntype)
# else
-# define TPUTSFUNCAST (int (*)())
+# define TPUTSFUNCAST (int (*)(int))
# endif
# endif
#endif
len = out_pos;
out_pos = 0;
ui_write(out_buf, len);
+#ifdef FEAT_JOB_CHANNEL
+ if (ch_log_output)
+ {
+ out_buf[len] = NUL;
+ ch_log(NULL, "raw terminal output: \"%s\"", out_buf);
+ ch_log_output = FALSE;
+ }
+#endif
}
}
/*
* Output "c" like out_char(), but don't flush when p_wd is set.
*/
- static void
-out_char_nf(unsigned c)
+ static int
+out_char_nf(int c)
{
- out_buf[out_pos++] = c;
+ out_buf[out_pos++] = (unsigned)c;
if (out_pos >= OUT_SIZE)
out_flush();
+ return (unsigned)c;
}
/*
void
term_settitle(char_u *title)
{
+#ifdef FEAT_JOB_CHANNEL
+ ch_log_output = TRUE;
+#endif
// t_ts takes one argument: column in status line
OUT_STR(tgoto((char *)T_TS, 0, 0)); // set title start
out_str_nf(title);
if (termcap_active && tmode != TMODE_SLEEP
&& cur_tmode != TMODE_SLEEP)
{
+#ifdef FEAT_JOB_CHANNEL
+ ch_log_output = TRUE;
+#endif
if (tmode != TMODE_RAW)
{
out_str(T_BD); // disable bracketed paste mode
{
if (full_screen && !termcap_active)
{
+#ifdef FEAT_JOB_CHANNEL
+ ch_log_output = TRUE;
+#endif
out_str(T_TI); // start termcap mode
out_str(T_CTI); // start "raw" mode
out_str(T_KS); // start "keypad transmit" mode
// get them.
check_for_codes_from_term();
}
+#endif
+#ifdef FEAT_JOB_CHANNEL
+ ch_log_output = TRUE;
#endif
out_str(T_BD); // disable bracketed paste mode
out_str(T_KE); // stop "keypad transmit" mode
&& starting == 0
&& *T_CRV != NUL)
{
+#ifdef FEAT_JOB_CHANNEL
+ ch_log_output = TRUE;
+#endif
LOG_TR(("Sending CRV request"));
out_str(T_CRV);
termrequest_sent(&crv_status);
// width, that will be (1, 2). This function has the side effect that
// changes cursor position, so it must be called immediately after
// entering termcap mode.
+#ifdef FEAT_JOB_CHANNEL
+ ch_log_output = TRUE;
+#endif
LOG_TR(("Sending request for ambiwidth check"));
// Do this in the second row. In the first row the returned sequence
// may be CSI 1;2R, which is the same as <S-F3>.
// sequence is ignored and the cursor does not move. If the terminal
// handles test sequence incorrectly, a garbage string is displayed and
// the cursor does move.
+#ifdef FEAT_JOB_CHANNEL
+ ch_log_output = TRUE;
+#endif
LOG_TR(("Sending xterm compatibility test sequence."));
// Do this in the third row. Second row is used by ambiguous
// chararacter width check.
// Only request foreground if t_RF is set.
if (rfg_status.tr_progress == STATUS_GET && *T_RFG != NUL)
{
+#ifdef FEAT_JOB_CHANNEL
+ ch_log_output = TRUE;
+#endif
LOG_TR(("Sending FG request"));
out_str(T_RFG);
termrequest_sent(&rfg_status);
// Only request background if t_RB is set.
if (rbg_status.tr_progress == STATUS_GET && *T_RBG != NUL)
{
+#ifdef FEAT_JOB_CHANNEL
+ ch_log_output = TRUE;
+#endif
LOG_TR(("Sending BG request"));
out_str(T_RBG);
termrequest_sent(&rbg_status);
{
if (*T_VS != NUL && *T_CVS != NUL)
{
+#ifdef FEAT_JOB_CHANNEL
+ ch_log_output = TRUE;
+#endif
out_str(T_VS);
out_str(T_CVS);
screen_start(); // don't know where cursor is now
&& *T_CSH != NUL
&& *T_CRS != NUL)
{
+#ifdef FEAT_JOB_CHANNEL
+ ch_log_output = TRUE;
+#endif
LOG_TR(("Sending cursor style request"));
out_str(T_CRS);
termrequest_sent(&rcs_status);
&& term_props[TPR_CURSOR_BLINK].tpr_status == TPR_YES
&& *T_CRC != NUL)
{
+#ifdef FEAT_JOB_CHANNEL
+ ch_log_output = TRUE;
+#endif
LOG_TR(("Sending cursor blink mode request"));
out_str(T_CRC);
termrequest_sent(&rbm_status);
{
char *key_name = key_names[xt_index_out];
+#ifdef FEAT_JOB_CHANNEL
+ ch_log_output = TRUE;
+#endif
LOG_TR(("Requesting XT %d: %s", xt_index_out, key_name));
sprintf(buf, "\033P+q%02x%02x\033\\", key_name[0], key_name[1]);
out_str_nf((char_u *)buf);