patch 8.2.1595: cannot easily see what Vim sends to the terminal
Problem: Cannot easily see what Vim sends to the terminal.
Solution: Write output to the channel log if it contains terminal control
sequences. Avoid warnings for tputs() argument.
diff --git a/src/globals.h b/src/globals.h
index 7dbc49e..7477992 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1898,6 +1898,10 @@
# define REPEATED_MSG_LOOKING 1
# define REPEATED_MSG_SAFESTATE 2
+// This flag is set when outputting a terminal control code and reset in
+// out_flush() when characters have been written.
+EXTERN int ch_log_output INIT(= FALSE);
+
#define FOR_ALL_CHANNELS(ch) \
for ((ch) = first_channel; (ch) != NULL; (ch) = (ch)->ch_next)
#define FOR_ALL_JOBS(job) \