Skip to content

Commit 42be8dd

Browse files
committed
mingw.c: fix alternate screen using TERM=xterm-256color
With a recent MinGW64 update, the terminal does not switch between main screen buffer and alternate screen buffer correctly when TERM is set to "cygwin". In particular, after less and vim end, the command prompt is reset to the top of the terminal window and old text remains on the screen. My tests show that TERM=xterm-256color works as intended. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
1 parent 973699a commit 42be8dd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

compat/mingw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2822,7 +2822,7 @@ static void setup_windows_environment(void)
28222822

28232823
/* simulate TERM to enable auto-color (see color.c) */
28242824
if (!getenv("TERM"))
2825-
setenv("TERM", "cygwin", 1);
2825+
setenv("TERM", "xterm-256color", 1);
28262826

28272827
/* calculate HOME if not set */
28282828
if (!getenv("HOME")) {

0 commit comments

Comments
 (0)