WSL Ubuntu Terminal

Code:
     _x64: 1
   _admin: 1
_elevated: 1

TCC  24.02.49 x64   Windows 10 [Version 10.0.18362.116]
I have WSL Ubuntu Terminal pinned to my taskbar. I click it once, and it opens in TCMD as;

2341

The next time I click WSL Ubuntu Terminal, it opens in TCMD as;

2342

...or...

2343

I have Auto Attach Consoles enabled;

2340

Note also the tab titles, each launched by clicking on Ubuntu Terminal from my taskbar.

The results I get from opening a Ubuntu Terminal are not consistent, that is, one prompt works fine, the other is displaying ANSI Codes, the next prompt may or may not work fine, etc.

Note also that I have tried Ubuntu Terminal with legacy console enabled and disabled;

2344

What other options are there to try?

Joe
 

samintz

Scott Mintz
May 20, 2008
1,339
12
Solon, OH, USA
I am running a Docker shell inside of a Git Bash prompt. If I detach then re-attach, ANSI is no longer working similar to what you see.

Also, I prefer a black background with yellow text. Yet, if I start it in a tab, it keeps changing to white background and black text. If I set TCMD's settings to default, the window opens white. If I change the settings to be yellow on black, the window opens correctly, but as soon as I do a colorized directory listing it reverts to white background.

-- Update --
Apparently, there was a recent Windows update that updated the console. If I check the "Use legacy console..." checkbox, things start working correctly again.
2350
 
@Joe Caverly I see the same error as you when trying to use the ubuntu command (this is with 'TCC 20.11.46 x64 Windows 10 [Version 6.3.17763]') but both wsl and bash work to start an Ubuntu instance (it is the only distro I have installed). This happens under both Take Command and a stand-alone TCC instance but works fine from CMD. Strangely, if you do a DIR of that file that TCC identifies in the error message then it shows as a SYMLINK to itself?! whereas CMD shows it as a file of zero bytes. Colour me confused.
 
Interesting Joe, thanks for that. At least on my system I can make this work using

alias ubuntu=`"C:\Program Files\WindowsApps\CanonicalGroupLimited.UbuntuonWindows_1804.2019.521.0_x64__79rhkp1fndgsc\ubuntu.exe"`

but given that folder name YMMV.

I found that name using this PowerShell script: Simple script which uses NtObjectManager to extract information about UWP execution aliases from insider build 16226 and above. - which itself requires NtObjectManager 1.1.21 - to extract the information from the reparse point. There may be other ways of doing so.

@Rex any chance of native TCC support for this weird new aliasing mechanism from MS?
 
Well, that works!
Code:
c:\program files\windowsapps\canonicalgrouplimited.ubuntuonwindows_1804.2019.521.0_x64__79rhkp1fndgsc>dir

Volume in drive C is unlabeled    Serial number is acb2:6a48
Directory of  C:\Program Files\WindowsApps\CanonicalGroupLimited.UbuntuonWindows_1804.2019.521.0_x64__79rhkp1fndgsc\*

2019-06-12  11:39         <DIR>    .
2019-06-12  11:39         <DIR>    ..
2019-06-12  11:38         <DIR>    AppxMetadata
2019-06-12  11:38         <DIR>    Assets
2019-06-12  11:38         219,034  AppxBlockMap.xml
2019-06-12  11:38           3,790  AppxManifest.xml
2019-06-12  11:38          11,212  AppxSignature.p7x
2019-06-12  11:39     231,179,584  install.tar.gz
2019-05-19   0:36           5,384  resources.pri
2019-06-12  11:39         211,968  ubuntu.exe
         231,630,972 bytes in 6 files and 4 dirs    231,641,088 bytes allocated
     357,809,844,224 bytes free

c:\program files\windowsapps\canonicalgrouplimited.ubuntuonwindows_1804.2019.521.0_x64__79rhkp1fndgsc>ubuntu.exe
jlc@DESKTOP-H2JFFTF:~$


Something that I should have thought of earlier;
Code:
e:\utils>which /a ubuntu.exe
ubuntu.exe is an executable extension : start /pgm C:\Users\Joe Caverly\AppData\Local\Microsoft\WindowsApps\ubuntu.exe
ubuntu.exe is associated with : C:\Users\Joe Caverly\AppData\Local\Microsoft\WindowsApps\ubuntu.exe
ubuntu.exe is an executable extension : start /pgm C:\Program Files\WindowsApps\CanonicalGroupLimited.UbuntuonWindows_1804.2019.521.0_x64__79rhkp1fndgsc\ubuntu.exe
ubuntu.exe is associated with : C:\Users\Joe Caverly\AppData\Local\Microsoft\WindowsApps\ubuntu.exe
Joe