0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.2662: there is no way to avoid some escape sequences

Problem:    There is no way to avoid some escape sequences.
Solution:   Suppress escape sequences when the --not-a-term argument is used.
            (Gary Johnson)
This commit is contained in:
Bram Moolenaar
2021-03-27 12:11:33 +01:00
parent bb5d87c850
commit 7007e31bde
4 changed files with 50 additions and 10 deletions

View File

@@ -995,6 +995,19 @@ is_not_a_term()
return params.not_a_term;
}
/*
* Return TRUE when the --not-a-term argument was found or the GUI is in use.
*/
static int
is_not_a_term_or_gui()
{
return params.not_a_term
#ifdef FEAT_GUI
|| gui.in_use
#endif
;
}
// When TRUE in a safe state when starting to wait for a character.
static int was_safe = FALSE;
@@ -1528,9 +1541,7 @@ getout(int exitval)
#endif
// Position the cursor on the last screen line, below all the text
#ifdef FEAT_GUI
if (!gui.in_use)
#endif
if (!is_not_a_term_or_gui())
windgoto((int)Rows - 1, 0);
#if defined(FEAT_EVAL) || defined(FEAT_SYN_HL)
@@ -1640,9 +1651,7 @@ getout(int exitval)
}
// Position the cursor again, the autocommands may have moved it
#ifdef FEAT_GUI
if (!gui.in_use)
#endif
if (!is_not_a_term_or_gui())
windgoto((int)Rows - 1, 0);
#ifdef FEAT_JOB_CHANNEL