ANSI Escape Code does not works with (start) command

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
WiVi71
Posts: 19
Joined: 06 Jan 2020 02:33

ANSI Escape Code does not works with (start) command

#1 Post by WiVi71 » 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?

T3RRY
Posts: 250
Joined: 06 May 2020 10:14

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

#2 Post by T3RRY » 16 Nov 2020 12:40

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

miskox
Posts: 630
Joined: 28 Jun 2010 03:46

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

#3 Post by miskox » 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

T3RRY
Posts: 250
Joined: 06 May 2020 10:14

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

#4 Post by T3RRY » 17 Nov 2020 08:55

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.

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

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

#5 Post by jeb » 18 Nov 2020 06:31

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

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

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

#6 Post by penpen » 18 Nov 2020 07:29

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

Post Reply