Bug in vt101 Alternate Screen Buffer?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
jeb
Expert
Posts: 1055
Joined: 30 Aug 2007 08:05
Location: Germany, Bochum

Bug in vt101 Alternate Screen Buffer?

#1 Post by jeb » 17 Feb 2020 01:36

Hi,

my win10 crashes reproducible by leaving the alternate screen buffer. :(
The alternate screen could be useful for switching between different outputs or for games, because it doesn't support scrolling/scrollbars.

My first crash sample, but only when I ask for user input.

Code: Select all

@echo off 
setlocal 

for /F "delims=#" %%E in ('"prompt #$E# & for %%E in (1) do rem"') do set "\e=%%E"

REM *** Enter Alternate Screen Buffer
echo %\e%[?1049h
REM *** Crashes only when set /p in the "alternate screen buffer"
REM *** The input for set /p has to be user input  (Redirections works)
set /p inp=Enter to crash

REM *** Leave Alternate Screen Buffer
echo %\e%[?1049l

echo Never reached this

REM *** Other ways to wait/get user input works, like
REM *** pause
REM *** choice
REM *** xcopy %~f0 %~f0 /L /W

Or even worse

Code: Select all

@echo off 
setlocal 
for /F "delims=#" %%E in ('"prompt #$E# & for %%E in (1) do rem"') do set "\e=%%E"

REM *** Enter Alternate Screen Buffer
echo %\e%[?1049h

REM *** Leave Alternate Screen Buffer
echo %\e%[?1049l

REM *** Enter Alternate Screen Buffer
echo %\e%[?1049h
This seems to work, but only until you press enter on the command line, then it closes the cmd window.

Tested with Microsoft Windows [Version 10.0.17134.1246].

These tests are so simple, I can't believe that this is a problem on all Win10 installations, else nobody can't used this ever without detecting this. :?:

What are the results on your pc?


jeb

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Bug in vt101 Alternate Screen Buffer?

#2 Post by aGerman » 17 Feb 2020 03:50

I'll try if I'm back home. Your Win10 version is outdated since end of 2018 though. If I can reproduce on a recent version I'll file an issue over there
https://github.com/microsoft/terminal/issues

Steffen

jeb
Expert
Posts: 1055
Joined: 30 Aug 2007 08:05
Location: Germany, Bochum

Re: Bug in vt101 Alternate Screen Buffer?

#3 Post by jeb » 17 Feb 2020 04:00

aGerman wrote:
17 Feb 2020 03:50
Your Win10 version is outdated since end of 2018 though.
Thanks, didn't know that. But the updates are controlled by the company.

For my own computers there isn't such a problem.
The last windows I used was Win7, after that I'm only using linux.

jeb

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Bug in vt101 Alternate Screen Buffer?

#4 Post by aGerman » 17 Feb 2020 04:12

But the updates are controlled by the company.
Same here. So I really have to try out at home :lol:

Steffen

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: Bug in vt101 Alternate Screen Buffer?

#5 Post by penpen » 17 Feb 2020 05:50

Works perfectly on my system.
Hopefully that was just a patched bug.


penpen

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Bug in vt101 Alternate Screen Buffer?

#6 Post by aGerman » 17 Feb 2020 10:32

Can't reproduce it either. V. 10.0.18363.657 x64. Seems it has been fixed meanwhile.

Steffen

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: Bug in vt101 Alternate Screen Buffer?

#7 Post by dbenham » 18 Feb 2020 10:11

I have an even older version at work - 10.0.16299.1625 - also under company control.

Both of jeb's scripts crash the terminal for me. I haven't tried at home yet.

jfl
Posts: 226
Joined: 26 Oct 2012 06:40
Location: Saint Hilaire du Touvet, France
Contact:

Re: Bug in vt101 Alternate Screen Buffer?

#8 Post by jfl » 20 Feb 2020 08:18

Same for me:
- Crashes on company-managed computer with Windows 10.0.16299.1625
- Works fine on another one managed by me, with Windows 10.0.19041.84

On the system that crashes, there's an error saying "Console Window Host has stopped working."
So apparently the problem is with conhost.exe, not with cmd.exe.
=> It should not happen if you install the new Windows Terminal on the old system.
... But I failed to install it: I got error "The .msixbundle is not supported. To resolve this error, update to Windows 10 1809 (or later) or rebuild the app bundle as .appxbundle."

lazna
Posts: 62
Joined: 27 Dec 2012 10:54

Re: Bug in vt101 Alternate Screen Buffer?

#9 Post by lazna » 01 Jan 2023 05:43

Both scripts working on my 10.0.19045.2193

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Bug in vt101 Alternate Screen Buffer?

#10 Post by aGerman » 01 Jan 2023 12:06

I looked it up. Seems this has been fixed with update 1809 (10.0.17763), finally rolled out on November 13, 2018.
Reference: https://github.com/microsoft/terminal/issues/162

Steffen

Post Reply