DEV Community

Cover image for How to customize the new Windows Terminal with Visual Studio Code

How to customize the new Windows Terminal with Visual Studio Code

Emanuele Bartolesi on June 23, 2019

A few days ago Microsoft released a very early version of the new Windows Terminal. The Windows Terminal is a new, modern, fast, efficient, powerfu...
Collapse
 
nikoheikkila profile image
Niko Heikkilä

It's a very promising terminal app which I will likely switch to once it matures.

The current version doesn't allow pressing AltGr with number keys which means I can't type certain important shell characters. Needs polishing, indeed.

Collapse
 
kasuken profile image
Emanuele Bartolesi

yes... very promising... let's see in the near future... :)

Collapse
 
alexanderviken profile image
Alexander Viken

The AltGr issue is fixed now it looks like. github.com/microsoft/terminal/issu...

Collapse
 
simbo1905 profile image
Simon Massey • Edited

We use the opens source “Git Bash” for windows on our office laptops. We then configure Visual Studio Code to use that as the integrated terminal. Then whenever we open a new Code window to switch to a different project we have an embedded bash in that Code window in the right folder. Git Bash as all the core tools (find, awk, sed, etc) and extras like ssh and gpg. This means that on legacy windows we have the same solid technology we use in the cloud. It also makes the windows experience the same as working at home on open source on a mac book pro. Git Bash also interacts with the clipboard to cut and paste into the terminal.

Collapse
 
themobiledev profile image
Chris McKay

We use Git Bash frequently in my office as well. Now, if I just figure out how to integrate it into Terminal without it opening up a new window...

Collapse
 
simbo1905 profile image
Simon Massey • Edited

Yes, you just change the setting in VS Code to tell it to use the bash.exe and when vs code sees any paths in any terminal text it turns them into links to open the files in the editor pane. I will dig the config out of the corporate wiki when I get a chance.

Thread Thread
 
simbo1905 profile image
Simon Massey
Thread Thread
 
themobiledev profile image
Chris McKay

Thanks!

Collapse
 
themobiledev profile image
Chris McKay

I started playing with it over the weekend. It's pretty nice, even in its early state. I've already set up a new SSH profile (goodbye PuTTY). I'm tempted to submit a PR to clean up the titlebar and borders.

Collapse
 
kechupslv profile image
Kalvis

Can you show me your settings JSON? I can't figure out how to link ssh with windows terminal.

Collapse
 
themobiledev profile image
Chris McKay

So, I first followed Scott Hanselman's instructions for getting SSh set up with a public key so that I wouldn't have to enter my username and password every time I opened up my SSH terminal. You can find those here:

hanselman.com/blog/HowToUseWindows...

After that, I created a new profile in Terminal by copying and pasting the PowerShell profile. You need to create a new guid value (there are free generators online) or else it will just open up the first profile it finds. Then, set the commandline parameter like this:

"commandline" : "ssh.exe @"

That's all there is to it.

Collapse
 
baruchiro profile image
Baruch Odem

What is the Acrylic properties?

Collapse
 
defman profile image
Sergey Kislyakov
Collapse
 
cholasimmons profile image
Chola • Edited

The trailer for Terminal had a segment where you could see some color coded text, VScode style, It looked like directly editing C++ code inside the Command window itself!
any ideas how to do this? C++ inside Terminal

Collapse
 
phduck profile image
Mads Gram

vim, nano, ed, emacs, xi or any of the other command line based editors.

Collapse
 
jyggorath profile image
jyggorath • Edited

After creating a new profile, I get the following error when opening the terminal app: "Failed to load settings" "Settings could not be loaded from file - temporarily using the default settings. Check for syntax errors, including trailing commas."

I have checked with a validator, and there is no JSON syntax error, it conforms with RFC4627.

And I can't see that any of the keys are wrong, they're all copy-pasted. I've tried using both \\ and / as directory separator in the path to the background image, but it doesn't seem to make a difference. And the background image does exist on that path. Also, I made sure the GUID was new and not used by any other profiles.

Collapse
 
blacklightpy profile image
Jyothish Kumar

I think it is because you probably modified the GUID by yourself. I used an online GUID generator to fix this problem. I don't know how GUIDs work but since there are generators out there, I tried out one and it worked.

Collapse
 
baso53 profile image
Sebastijan Grabar

I tried it out today for a few minutes and the first thing I noticed is that it is VERY early access. It froze on me once already (without typing any commands, just switching tabs) and also, the title bar (IMO) looks so bad that it's almost funny. Oh and yeah, I couldn't access the settings at all, it just asked me which program would I like to use to do so. But well, I figured out why it did while writing this comment :).

Collapse
 
cholasimmons profile image
Chola

"looks so bad" yet don't suggest how it can be improved?
I personally am feeling terminal, I love the prettiness of UWP's, almost like Electron programs.

Collapse
 
thatkazuki profile image
Desmond Edem

Any idea on how I can change the starting directory to my WSL home directory? Currently, I type cd ~ anytime I want to make this switch.

Thank you.

Collapse
 
rennex profile image
Renne Nissinen

Add this to your settings in the relevant profile: "startingDirectory": "//wsl$/Ubuntu/home/yourname" or whatever is the path that works in Explorer.

Collapse
 
dougbm profile image
Douglas Marquardt

Thanks! It works.

Collapse
 
eliandroribeiro profile image
Eliandro

I would suggest you to define the HOME environment variable. This worked for me with Git Bash.

stackoverflow.com/questions/322329...

Collapse
 
rachaelfi profile image
rachaelfi

How can I change just the font color?

Collapse
 
maymeow profile image
May Meow • Edited

Can you share those pictures you have used as background? :)

Collapse
 
kasuken profile image
Emanuele Bartolesi

I updated my post with the images at the end!!! :)

Collapse
 
maymeow profile image
May Meow

Thank You :)

Collapse
 
badasstechie profile image
Moses Odhiambo • Edited

How can I make the color of the title bar match the color scheme?

Collapse
 
attkinsonjakob profile image
Jakob Attkinson

Is there a way to save our custom settings to GH? (Either for sharing purposes, or just a backup)

Collapse
 
matbanke profile image
matbanke

In the "globals" section of the json you can set Columns and Rows. Anyone know if you can set the Windows Position so the window opens in the same spot every time?

Collapse
 
jeanlambert profile image
Jean Lambert

HI! Can I add custom commands?

Collapse
 
luizmoratelli profile image
Luiz Augusto Moratelli

It's possible to change the default terminal to ubuntu instead of power shell on open WT?

Collapse
 
seanatron profile image
Sean W

In the profiles.json file set the default profile GUID to the profile that corresponds to the Ubuntu profile. With this set, when you open the Terminal or use Ctrl + Shift + T, it will open Ubuntu by default.

Collapse
 
kt0594 profile image
kt0594 • Edited

how to change "startingDirectory" : "%USERPROFILE%" to custom directory