Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: New Windows 10 terminal  (Read 5573 times)

0 Members and 1 Guest are viewing this topic.

Salmon Trout

  • Guest
New Windows 10 terminal
« on: June 30, 2019, 05:09:08 AM »
I wonder if anyone has tried the New Windows Terminal? It's in the Microsoft Store (Win 10 only). I know it's just an alpha release, but it seems fairly complete.



Very configurable; the settings are in a JSON file. I have been using JSONedit, free, at http://tomeko.net/software/JSONedit/



I find it handy to have tabs available, not only for the defaults (Powershell, cmd.exe, and any WSL installs you have), but also I have added "profiles" which leverage the WSL.exe command to have ssh logins to my Raspberry Pi, a Debian box, and my Seagate NAS.

Lots of fun playing around!

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: New Windows 10 terminal
« Reply #1 on: July 01, 2019, 07:44:49 AM »
For some reason, it has never occurred to me to use the SSH that is part of the Ubuntu distribution (or really any WSL distribution) instead of PuTTY. Well, until now. The capability to add Profiles seems to be the biggest feature IMO of this new Terminal.

Of course now I'm down the rabbit hole.

I couldn't get the command line to work directly, instead it would always start the distro bash itself, but not run ssh- even though the same wsl command in command prompt did in fact start SSH.

So I thought I'd create a shell script. Then decided to go a step further and use perl, so I could use the Net::SSH::Perl module Easy enough. Even found a script for it. How hard could it be?

Well, I think I almost got that bit to work- 2 hours later. down the rabbit hole to run a 8 line perl script. Just waiting on cpan to finally install Net::SSH::Perl not that I sorted out the prerequisites. Not sure why the Terminal profile isn't working to run a command directly, though.

My only real complaint about the application itself though is that the tabs are in the titlebar. I've always disliked that trend (Thanks Google Chrome...) In this case, It means moving the window requires using the area right next to the caption buttons.
I was trying to dereference Null Pointers before it was cool.

Salmon Trout

  • Guest
Re: New Windows 10 terminal
« Reply #2 on: July 01, 2019, 02:30:14 PM »
Of course now I'm down the rabbit hole.

Yup. A whole Saturday.

Quote
I couldn't get the command line to work directly, instead it would always start the distro bash itself, but not run ssh- even though the same wsl command in command prompt did in fact start SSH.

Note: each profile must have a unique GUID, I got mine from a web GUI generator.

Odd. I did it like this... in a profile, the "commandline" string value is like this

(you aren't using bash.exe are you? Use wsl.exe.)

-u name is your username in the wsl distro
-l name is your remote host username

wsl.exe -d Legacy -u mike -e ssh 192.168.0.5 -l mike

you have to get the wsl -d distro name right, mine is "Legacy", it's WSL Ubuntu from before the distros got in the Windows Store. Find out your name(s) by doing wsl -l at the cmd prompt. Should work, I think.

Quote
My only real complaint about the application itself though is that the tabs are in the titlebar. I've always disliked that trend (Thanks Google Chrome...) In this case, It means moving the window requires using the area right next to the caption buttons.

In the settings JSON, in the Global section, change the Boolean value showTabsInTitlebar to false

Hope this helps.

Salmon Trout

  • Guest
Re: New Windows 10 terminal
« Reply #3 on: July 01, 2019, 03:39:02 PM »
Quote
wsl.exe -d Legacy -u mike -e ssh 192.168.0.5 -l mike

Everything after -e is the wsl bash command


BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: New Windows 10 terminal
« Reply #4 on: July 01, 2019, 05:32:53 PM »
Thanks, I think it must have been the guid, changing it worked. I imagine what happened is it ended up somehow using data from both- I think I had considered the GUID but figured it couldn't matter since it did use the new name in the drop down; but when selected must have been identifying it based on GUID and therefore grabbing the command line for the standard Ubuntu profile.


Quote
In the settings JSON, in the Global section, change the Boolean value showTabsInTitlebar to false
Brilliant, my only real issue has a config!
I was trying to dereference Null Pointers before it was cool.

Salmon Trout

  • Guest
Re: New Windows 10 terminal
« Reply #5 on: July 02, 2019, 01:07:52 AM »
Re the GUID, that was my learning path, too. I just copied the whole WSL profile and tinkered around, but initially left the GUID the same, like you. I wish the tab text could be customised to say e.g. "Pi", Debian", "WSL", etc. but you can change the icons. As supplied the icon paths look like ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png. On my install that leads to a png in
C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_0.2.1715.0_x64__8wekyb3d8bbwe\ProfileIcons,
but you can make it any path you like e.g. c:\myicons\debian.png.

Salmon Trout

  • Guest
Re: New Windows 10 terminal
« Reply #6 on: July 02, 2019, 03:09:42 AM »


The ability to set a custom icon for each profile means that each tab can have its own visual identity, but what appears as tab text is inconsistent; the ssh session on the Debian machine has the Debian prompt, but the Pi retains the wsl.exe command line.