Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Windows 10 Bash

Aug
18
0
When I launch the Windows 10 Bash shell via TCC20 I am getting strange characters when I display and when I press the backspace. I am assuming this has to do with page type encoding possibly.

When I launch in windows natively I don't see these characters. How can I fix this when launching from a button in TCC?

Thanks,
Robb
 

Attachments

  • Bash TCC20.png
    Bash TCC20.png
    20.8 KB · Views: 267
Last edited:
I also noticed, when I use the attach tab option the native window that showed without the characters now shows the special characters once it is incorporated into TCC.

Robb
 
I'm a total bash ignoramus, but those look like ANSI sequences to me....
 
Yeah, indeed - the "box" sign could be <ESC>, so "<ESC>[01;32m" would be Light (Bright) Green text and "<ESC>[0m" stands for reset attribute (all attributes off).

See this URL: ANSI escape code
 
Based on the help file, is Ansi support from external not supported? Is this correct? Will this be changed, since the Ubuntu bash now supports ansi output?
 
I think the setting to control that is Options / Take Command / Tabs / ANSI colors. (You may need to restart Take Command after changing that option; I'm not sure.)
 
I wonder how, exactly, this works. If I start CMD (outside TCMD) and it inherits my user-environment-defined PROMPT ($e[32;1m$p$g$s$e[0m), I get a nonsense PROMPT. If I attach that console to TCMD, I still have a nonsense PROMPT. But if, in a TCMD/TCC tab, I "START /TAB CMD", I have the green prompt. Likewise, ANSI works if I Tabs\Run ... NewTab ... CMD.

What's the difference?
 
I wonder how, exactly, this works. If I start CMD (outside TCMD) and it inherits my user-environment-defined PROMPT ($e[32;1m$p$g$s$e[0m), I get a nonsense PROMPT. If I attach that console to TCMD, I still have a nonsense PROMPT. But if, in a TCMD/TCC tab, I "START /TAB CMD", I have the green prompt. Likewise, ANSI works if I Tabs\Run ... NewTab ... CMD.

What's the difference?

TCMD injects ANSIxx.dll into console apps that it starts. It does *not* inject it into ones that it attaches.
 
If I use the following to launch the bash.exe, that seems to fix the ANSI issue

tcc /k C:\Windows\System32\bash.exe

It's not surprising that TCMD can't inject the ANSI dll into bash.exe, because the Windows 10 bash.exe is not a Windows console app. It's a linux subsystem app, and the bash ANSI escape sequences are (normally) handled by the linux subsystem.

What is surprising is that running bash in a TCC session allows the injection. Conhost is doing something peculiar (and different depending on who starts the console session). And it isn't specific to TCC - running a CMD tab window in TCMD and then starting bash.exe also works.

Since Microsoft has not yet provided documentation (or APIs) on the internal workings of the linux subsystem (or conhost) it's difficult to determine what is by design and what is simply not working. It may be as simple as a timing issue, or it may be fundamentally impossible to implement.
 

Similar threads

Back
Top