$e]0 (Operating System Controls) is for changing the title, ansicon is in act but it can't take over TCC's ANSI logics.
Reference:
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
with ansicon ( http://adoxa.110mb.com/ansicon/ ), I can make use of ANSI escape codes in prompt to have a colorful prompt.
It works in Windows cmd.exe and ReactOS cmd.exe, but I found that it doesn't work in TCC and LE.
It fails even have "usebackq" in FOR (code from RosBE):
for /f "usebackq tokens=3" %%i in (`"gcc -v 2>&1 | find "gcc version""`) do set _ROSBE_GCCVERSION=%%i
for /f "usebackq tokens=2" %%i in (`"gcc -v 2>&1 | find "Target""`) do set _ROSBE_GCCTARGET=%%i
Re: not working
but with this script, it proves CMD not only have %CD% unchanged, but really not changing "current directory" by CD/CHDIR:
@echo off
setlocal enabledelayedexpansion
for /R %%i in (.) do call :disprpath "%%~i"
endlocal
GOTO :EOF
rem sub disprpath(filename)
:disprpath...
Re: not working
quote from http://ss64.com/nt/setlocal.html :
With delayed expansion the caret ^ escapes each special character all the time, not just for one command.
This makes it possible to work with HTML and XML formatted strings in a variable.
Re: not working
For the second problem, even if I use !CD! instead of %CD%, CMD won't change %CD% variable to "current directory where recursive FOR loop goes". Because CMD does not "Change Directory" in recursive FOR loop, but lookup files in subdirectories in "Current Directory" where "FOR...
Re: not working
and this one match original usage of variables:
@echo off
setlocal enabledelayedexpansion
for /R %%i in (.) do call :disprpath "%%~i"
endlocal
GOTO :EOF
rem sub disprpath(filename)
:disprpath
call :rpath "%~1"
echo %rpath%
GOTO :EOF
rem sub rpath(filename)...
Re: not working
This one should work:
@echo off
setlocal enabledelayedexpansion
for /R %%i in (.) do (
call :rpath "%%~i"
echo !rpath!
)
endlocal
GOTO :EOF
rem sub rpath(filename) OUT: %rpath%
:rpath
rem debug print %1 here
echo (rpath: %1)
SET rpath=%~1
set...
Re: not working
Because it is very minor and easily fixed for both CMD and TCC in script, mention this behavior somewhere in documentation is enough.
and another minor different, if I use variable to store FOR command, the FOR extended variable will be killed.
[F:\app_related\TCCLE]set...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.