};
#endif
+#ifdef FEAT_TERMRESPONSE
/*
* List of DECRQM modes that Vim supports
*/
static const int dec_modes[] = {
2026, // Synchronized output
-#ifdef UNIX
+# ifdef UNIX
2048 // In-band terminal resize events
-#endif
+# endif
};
+#endif
#ifdef FEAT_TERMGUICOLORS
/*
}
}
-/*
- * Query the settings for the DEC modes we support via DECRQM.
- * Only sent once, and only when the terminal is known not to dislike it
- * (i.e. TPR_DECRQM is TPR_YES, or still TPR_UNKNOWN when the version response
- * has not yet been received).
- * The DECRPM responses are caught in handle_csi().
- */
- void
-may_req_decrqm(void)
-{
- if (decrqm_status.tr_progress == STATUS_GET
- && term_props[TPR_DECRQM].tpr_status != TPR_NO
- && can_get_termresponse()
- && starting == 0)
- {
- MAY_WANT_TO_LOG_THIS;
- LOG_TR1("Sending DECRQM requests");
- for (int i = 0; i < (int)ARRAY_LENGTH(dec_modes); i++)
- {
- vim_snprintf((char *)IObuff, IOSIZE, "\033[?%d$p", dec_modes[i]);
- out_str(IObuff);
- }
- termrequest_sent(&decrqm_status);
- // check for the characters now, otherwise they might be eaten by
- // get_keystroke()
- out_flush();
- (void)vpeekc_nomap();
- }
-}
-
#endif
/*
need_flush = TRUE;
}
+ // Only request DEC modes via DECRQM when the terminal is known to
+ // handle it. Not for Apple Terminal.app or GNU screen, they echo
+ // the trailing "p" to the screen. See issue #19852.
+ if (decrqm_status.tr_progress == STATUS_GET
+ && term_props[TPR_DECRQM].tpr_status == TPR_YES)
+ {
+ MAY_WANT_TO_LOG_THIS;
+ LOG_TR1("Sending DECRQM requests");
+ for (int i = 0; i < (int)ARRAY_LENGTH(dec_modes); i++)
+ {
+ vim_snprintf((char *)IObuff, IOSIZE, "\033[?%d$p", dec_modes[i]);
+ out_str(IObuff);
+ }
+ termrequest_sent(&decrqm_status);
+ need_flush = TRUE;
+ }
+
if (need_flush)
out_flush();
#endif