Documentation TCANSI error

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
I didn't see any checkboxes in the Tcmd Option dialog for TCANSI, so I manually edited my tcmd.ini file.

I set ANSI=No in the [4NT] section and added TCANSI=Yes in the [TakeCommand] section.

I got the following startup error
upload_2016-7-26_17-12-33.png


So I changed the named from TCANSI to ANSI and that fixed it.

The help file has this text:
INI Directives:



TCANSI=NO|yes - Enable ANSI escape sequence support for all console applications running in Take Command tab windows. Take Command will inject a dll (ANSI32.dll or ANSI64.dll) into the console applications it starts. Note that if you have enabled TCANSI in Take Command, you should disable ANSI support in TCC (OPTION / Windows).
 
May 20, 2008
11,411
99
Syracuse, NY, USA
Under "Tabs" there's an "ANSI Colors" checkbox. I checked it back when the feature was announced. In TCMD.INI I have two of "ANSI=Yes", one in the "4NT" section, one in the "TakeCommand" section.
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
This is really cool. I have a PROMPT that uses ANSI to colorize my prompt. And every time I launch CMD from within TCC (or a batch script that leaves me in CMD after it runs) I always got this really ugly prompt because of the escape sequences in the prompt that got inherited but not evaluated.

Now I get a colorized prompt in CMD also! Now if I can figure out how to dynamically change the color...

Code:
prompt=`^e[37;%@if[%@remote[%_disk] eq 0,42,41];1m[$P]^e[33;40;1m$s`

CMD doesn't like the %@if[] in the prompt. I use it to change the background color of the $P to red for network drives and green for local drives.
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
I figured it out.
Code:
reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t REG_EXPAND_SZ /d "%%USERPROFILE%%\autoexec.cmd" /f
echo @prompt=$e[37;44;1m[$P]$e[33;40;1m$s>%USERPROFILE%\autoexec.cmd

I changed the background color to blue when running in CMD. Very nice. Thank you for that suggestion.
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
One thing I noticed is that the colors on the console disappear when CMD launches. When I exit CMD, its blue background prompt stays on the console display.
upload_2016-7-26_18-31-12.png

upload_2016-7-26_18-31-51.png

upload_2016-7-26_18-32-36.png
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,466
88
Albuquerque, NM
prospero.unm.edu
One thing I noticed is that the colors on the console disappear when CMD launches. When I exit CMD, its blue background prompt stays on the console display.

CMD.EXE has always done that, AFAIK. I don't think it has anything to do with Take Command or TCC. You're just more likely to notice when starting CMD.EXE from TCC because TCC makes it easier to display multiple colors in the first place.
 
May 20, 2008
11,411
99
Syracuse, NY, USA
One thing I noticed is that the colors on the console disappear when CMD launches. When I exit CMD, its blue background prompt stays on the console display.

No surprise. That prompt is history ... already in the console screen buffer.

TCMD isn't doing the interpretation of the ANSI sequences. CMD is ... because ANSI.DLL has been injected into it. If you have the means, you can inject it manually and do the same thing without TCMD. Here's an example in a real console. 2828 is CMD's PID.

upload_2016-7-26_19-37-26.png
 
Similar threads
Thread starter Title Forum Replies Date
C Copy (sys) error Support 3
T Error: This page can’t be displayed Make sure the web address //ieframe.dll/dnserrordiagoff.htm# is correct. Support 8
kb6ojs How to? "Specified Account Already Exists" error installing TCMD v27 Support 12
samintz How to? Abort on error DO loop Support 10
mfarah Fixed The DATE command produces the wrong error message. Support 1
vefatica ON ERROR terminates DO loop. Support 0
C Google intregration error Support 4
C FB intregration error Support 0
gworley rd (Remove Directory) gives interesting error: Support 2
D How to? Skip removing directory (RMDIR) without error message Support 2
Dmitry L. Kobyakov Documentation Error in the Help: the WINDOW command Support 0
M Strange error messages from TCC in FTP copy Support 7
vefatica Error message from TOUCH Support 2
R FIND command error Support 9
fpefpe Python dll error Support 3
D error in help documentation? Support 0
R FOR usage error from TCC but not from CMD Support 16
K_Meinhard Help file error Support 1
X small translation error. Support 0
W pdir returns diff results between tcc and tcmd - one is an error msg Support 5
Dmitry L. Kobyakov From old version: had the setup's error been corrected? Support 6
vefatica Why no error message? Support 2
vefatica ON ERROR and pipes? Support 8
MickeyF Why does this batch file give me 'unknown command "else"' error? Support 17
Joe Caverly TASKDIALOG Help link error Support 1
J Error "Contents lost before copy" Support 3
vefatica What's causing this error? Support 4
vefatica Error 203? Support 4
C Activation Error. Support 2
J Error running Python at command line Support 9
Joe Caverly PSHELL Error? Support 16
M Fixed PSHELL command returns error Support 2
vefatica REGDIR, strange error message Support 7
O Error in plugin /u Support 2
O TPIPE: Error -Can´t access textpipeengine.dll Support 24
fpefpe How to? script error Support 1
fpefpe How to? script error Support 0
D Error 0xc0000142 and FAR Manager Support 10
F Powershell call fails with "Scripting Integrator 2016 (PowerShell)" license error Support 9
cgunhouse FTP Error Support 5
C How to? Error updating from 20.00.16 to 20.00.21 Support 10
vefatica Missing post and security error Support 4
vefatica WAD ON ERROR GOTO ... Support 11
dcantor Documentation Documentation error in UNSET Support 0
vefatica Error updating Support 2
C tpipe /simple=28 error Support 5
B Fixed Error messages from TCMD.INI Support 2
Alpengreis [Bug?] View (V) Prefs Error (TC 18.00.27 x64) Support 4
Bill de Haan HTTP Protocol error. 407 Proxy Authentication Required. Support 3
vefatica DO /S ... suppress error? Support 1

Similar threads