Page 1 of 1

Bug in vt101 Alternate Screen Buffer?

Posted: 17 Feb 2020 01:36
by jeb
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

Re: Bug in vt101 Alternate Screen Buffer?

Posted: 17 Feb 2020 03:50
by aGerman
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

Re: Bug in vt101 Alternate Screen Buffer?

Posted: 17 Feb 2020 04:00
by jeb
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

Re: Bug in vt101 Alternate Screen Buffer?

Posted: 17 Feb 2020 04:12
by aGerman
But the updates are controlled by the company.
Same here. So I really have to try out at home :lol:

Steffen

Re: Bug in vt101 Alternate Screen Buffer?

Posted: 17 Feb 2020 05:50
by penpen
Works perfectly on my system.
Hopefully that was just a patched bug.


penpen

Re: Bug in vt101 Alternate Screen Buffer?

Posted: 17 Feb 2020 10:32
by aGerman
Can't reproduce it either. V. 10.0.18363.657 x64. Seems it has been fixed meanwhile.

Steffen

Re: Bug in vt101 Alternate Screen Buffer?

Posted: 18 Feb 2020 10:11
by dbenham
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.

Re: Bug in vt101 Alternate Screen Buffer?

Posted: 20 Feb 2020 08:18
by jfl
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."