{
int need_flush = FALSE;
- /* Only set 'ttymouse' automatically if it was not set
- * by the user already. */
- if (!option_was_set((char_u *)"ttym"))
- {
-# ifdef TTYM_SGR
- if (version >= 277)
- set_option_value((char_u *)"ttym", 0L,
- (char_u *)"sgr", 0);
- else
-# endif
- /* if xterm version >= 95 use mouse dragging */
- if (version >= 95)
- set_option_value((char_u *)"ttym", 0L,
- (char_u *)"xterm2", 0);
- }
-
/* if xterm version >= 141 try to get termcap codes */
if (version >= 141)
{
* 256, libvterm supports even more. */
if (mch_getenv((char_u *)"COLORS") == NULL)
may_adjust_color_count(256);
+# ifdef FEAT_MOUSE_SGR
+ /* Libvterm can handle SGR mouse reporting. */
+ if (!option_was_set((char_u *)"ttym"))
+ set_option_value((char_u *)"ttym", 0L,
+ (char_u *)"sgr", 0);
+# endif
+ }
+
+ /* Only set 'ttymouse' automatically if it was not set
+ * by the user already. */
+ if (!option_was_set((char_u *)"ttym"))
+ {
+# ifdef FEAT_MOUSE_SGR
+ if (version >= 277)
+ set_option_value((char_u *)"ttym", 0L,
+ (char_u *)"sgr", 0);
+ else
+# endif
+ /* if xterm version >= 95 use mouse dragging */
+ if (version >= 95)
+ set_option_value((char_u *)"ttym", 0L,
+ (char_u *)"xterm2", 0);
}
/* Detect terminals that set $TERM to something like