Page 1 of 1

ANSI Escape Code does not works with (start) command

Posted: 13 Nov 2020 14:29
by WiVi71

Code: Select all

@echo off
chcp 65001> nul
for /F %%A in ('echo prompt $E ^| cmd') do set ESC=%%A
echo %ESC%[2;2H[2,2]
pause> nul
(
	echo %ESC%[4;4H[4,4]
	pause> nul
)
(
	start "" http://example.org
	echo %ESC%[6;6H[6,6]
	pause> nul
)
Output:

Code: Select all


  [2,2]
  
    [4,4]
←[6;6H[6,6]
Tested on Microsoft Windows [Version 10.0.18363.592]

I'm not sure if this is my PC problem or Terminal bug.
Replacing command "start" to "explorer" didn't solve this problem :|

What are the results on your pc?

Re: ANSI Escape Code does not works with (start) command

Posted: 16 Nov 2020 12:40
by T3RRY
WiVi71 wrote:
13 Nov 2020 14:29

Code: Select all

@echo off
chcp 65001> nul
for /F %%A in ('echo prompt $E ^| cmd') do set ESC=%%A
echo %ESC%[2;2H[2,2]
pause> nul
(
	echo %ESC%[4;4H[4,4]
	pause> nul
)
(
	start "" http://example.org
	echo %ESC%[6;6H[6,6]
	pause> nul
)
Output:

Code: Select all


  [2,2]
  
    [4,4]
←[6;6H[6,6]
Tested on Microsoft Windows [Version 10.0.18363.592]

I'm not sure if this is my PC problem or Terminal bug.
Replacing command "start" to "explorer" didn't solve this problem :|

What are the results on your pc?
could not replicate.
windows 10 Version 10.0.18363.657

Re: ANSI Escape Code does not works with (start) command

Posted: 17 Nov 2020 07:57
by miskox
it doesn't work for me.

Windows 10, 64-bit, version 1903, build 18362.1139

Looks like build .657 solved the problem.

Saso

Re: ANSI Escape Code does not works with (start) command

Posted: 17 Nov 2020 08:55
by T3RRY
miskox wrote:
17 Nov 2020 07:57
it doesn't work for me.

Windows 10, 64-bit, version 1903, build 18362.1139

Looks like build .657 solved the problem.

Saso
Tried it on my newer machine - Microsoft Windows [Version 10.0.19041.572], the problem is present, however it only occurs when a start "" xyz.exe command occurs within the same code block; specifically with doublequotes. remove the doublequotes or the parentheses and the issue does not occur, same again if you leave an empty line between the echo and start commands or shift the start command outside the block.

Re: ANSI Escape Code does not works with (start) command

Posted: 18 Nov 2020 06:31
by jeb
Hi,

same failure on my system!
Tested on Microsoft Windows [Version 10.0.17763.1397] That's 1809 (What a stupid naming chaos)

But I simplified the code a bit

Code: Select all

@echo off

for /F %%A in ('echo prompt $E ^| cmd') do set "ESC=%%A"
cls
echo %ESC%[2;2H * [2,2] Works
(
    start "" https://example.com
    echo %ESC%[6;6H * [6,6] Fails
)
echo %ESC%[8;8H * [8,8] Works
If I remove the parenthesis or change the start command to

Code: Select all

start "" calc.exe
it works !

I've seen such an effect before and I'm sure that I discussed that with Dave, but I can't remember the thread :(
But I can remember that the problem was fixed in a newer windows version

jeb

Re: ANSI Escape Code does not works with (start) command

Posted: 18 Nov 2020 07:29
by penpen
I have Win10, german localization, Version 10.0.19042.630 (shouldn't that be the newsest?) and it doesn't work here.
I also tested if the cause is that the associations must be resolved by calling a text file and that also doesn't work properly on my system:

Code: Select all

:: ...
>"test.txt" rem:
(
	start "" test.txt
	echo %ESC%[8;8H[8,8]
)
penpen