DEV Community

Cover image for Beautify your Windows Terminal 🦄

Beautify your Windows Terminal 🦄

Anup Aglawe on May 31, 2020

Edit - ⚠️ With the newer version of oh-my-posh, and significant changes from V2, this article is outdated. Note that this will still work perfectl...
Collapse
 
moopet profile image
Ben Sinclair

The Windows Terminal is a modern, fast, efficient, powerful, and productive terminal application

It's modern in the sense that it's relatively recent. It's not particularly modern in terms of features.

But as for fast... try to cat a long file in Windows Terminal or run a bunch of dir commands in a loop, and then try the same thing on a Mac or Linux machine. I tried a large file the other day, something that took 0.6 seconds on a Mac took 26 seconds on Windows. 26 seconds! That's not just slow, it's glacial. it's about 50 times slower. You can watch the screen scroll up like you're looking at a dir /w on a PC1512. It's not down to the individual machine's specs, or whether it's running WSL or anything, this is down to the way Terminal works.

I'm sure it'll get better. But it's definitely not fast.

Collapse
 
nikoheikkila profile image
Niko Heikkilä

I've opened a couple of large files in Windows Terminal and Vim. No performance issues on typing or scrolling whatsoever. iTerm2 on my MacBook Pro might be a bit faster.

Real benchmarks would be helpful here. Of course, the Terminal being open-source any lagging issues would be easy to verify.

Collapse
 
anupa profile image
Anup Aglawe

Agree with you ( that's the description microsoft gave ).
Let's hope it gets better.

Collapse
 
akhileshbalaji profile image
Akhilesh Balaji

Hey, this is really cool!

I have set it up, and it was working fine. However, there seems to be some issue with the PSWRITECOLOR module. If I add too many lines that haven't returned anything, the banner gets distorted:
Normal:

Too many lines:

Is there any way to fix this? Would really appreciate some help.

Thanks in advance.

Collapse
 
anupa profile image
Anup Aglawe

This is wierd. I'm not sure about it either.

I will tag you if I find the fix👍

Collapse
 
akhileshbalaji profile image
Akhilesh Balaji

It appears to be a problem with the newline character. That's what is compressing the lines above it. I disabled both of the extensions, and kept typing the command

echo "`n"

and the above characters got compressed, but this didn't happen when I didn't set a newline. Interesting...

Collapse
 
akhileshbalaji profile image
Akhilesh Balaji

I've finally figured it out. Just replace Set-Newline or any newline characters with Write-Color -Text " ". It works perfectly.

Collapse
 
gdariodh profile image
Gabriel Díaz

I love it the post but i couldn't set the emojis in the prompt, i have only themes :(

i have problem to set the paradox theme config emoji, because the file is a json and mark syntaxis error, is there someone that help me to set emoji in the prompt terminal?

Collapse
 
anupa profile image
Anup Aglawe • Edited

My guess would be that updated version of oh-my-posh is cause of the problem.
As someone reported, they have depreciated set-theme command in the latest version. You could read their docs for newer syntax - github.com/JanDeDobbeleer/oh-my-posh

Anyways, Were you able to locate and edit oh-my-posh theme configuration file to add emojis as start symbol?

Did you add the following lines in paradox theme file?
'
$sl.PromptSymbols.StartSymbol = [char]::ConvertFromUtf32(0x01F984) + [char]::ConvertFromUtf32(0x0001F525) + ' '
$sl.PromptSymbols.PromptIndicator = [char]::ConvertFromUtf32(0x01F680) +[char]::ConvertFromUtf32(0x276F)

'

Collapse
 
anupa profile image
Anup Aglawe

Looked at their documentation, transition from V2 to v3 of oh-my-posh is quite significant.

It would take some time for me to update the article.

Thread Thread
 
gdariodh profile image
Gabriel Díaz

i think same, i have the "3.147.0 oh-my-posh", i tried to follow lines in paradox theme file but the json gave me syntax error :(. Could be the file to set emojis have changed

Thread Thread
 
gdariodh profile image
Gabriel Díaz • Edited

That's paradox json screenshot

dev-to-uploads.s3.amazonaws.com/up...

Thread Thread
 
shivamchandra75 profile image
shivamchandra75

I am having the same error please share if you get the solution

Collapse
 
happytodev profile image
HappyToDev • Edited

Hello Anup, thanks for this post.
I have some trouble like on the screenshot here.
Could you telle me what's wrong ?
I precise, I already installed fonts asked in prerequisites.

dev-to-uploads.s3.amazonaws.com/i/...

Collapse
 
anupa profile image
Anup Aglawe
   "fontFace": "Cascadia Code PL",
Enter fullscreen mode Exit fullscreen mode

Did you add this in your settings.json?

Collapse
 
happytodev profile image
HappyToDev

I'm pretty sure ... not :D
Thanks, I forgot this.
It works now ! ;-)

Collapse
 
notblong profile image
Bao Long

Hi, for anyone have issue with "Set-Theme Paradox"
The term 'Set-Theme' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

see it here: github.com/microsoft/terminal/issu...

Collapse
 
proagoa profile image
Harleq Dreamy

I do get the weird symbols on my themes. And also at the banner part I don't know where to put that in. You say $psenvmodule path is where I find it. But I don't known what that means and also you say in another comment it's in powershell profile. But I do the ctrl + , and I don't find anything of the sort.

So everything works, except I need to set theme every time I log in. I get strange symbols, I tried doing "git clone github.com/microsoft/cascadia-code..." in the powershell but nothing seems to come into effect, maybe I need to restard?
also I don't know what to do with the banner, where to find the file how to set it up.

Collapse
 
danielagiorgio profile image
Daniela Giorgio • Edited

If you want to install the font you have to download the first zip on this page and open it github.com/microsoft/cascadia-code... then open ttf folder, double click on CascadiaCodePL and click install.
The banner part is a bit confusing yep, my profile is at "C:\Users\YOURNAME\Documents\WindowsPowerShell"
I easily created it by typing "notepad $PROFILE" on Windows Powershell. Then I pasted OP's profile (pastebin.com/JAX3Ce23) inside it.

Collapse
 
emadsaber profile image
emadsaber

Thanks very much for your effort. I prefer something like Cmder

Collapse
 
sgdxa profile image
𝗗 𝗶 𝗸 𝗼

Now just below your $psenvmodule path add the following lines to display your customized banner.

where is the location?

Collapse
 
anupa profile image
Anup Aglawe

In powershell profile

Collapse
 
sgdxa profile image
𝗗 𝗶 𝗸 𝗼 • Edited

got it, thank you

Thread Thread
 
anupa profile image
Anup Aglawe

Here is link to my ps profile - pastebin.com/JAX3Ce23

Collapse
 
edarioq profile image
Edgar Quintero

FYI some of these commands are no longer supported, for example Set-Theme is deprecated

Collapse
 
shekhsaifuddin007 profile image
Shekh Saifuddin • Edited

How can get rid of this weird message?

dev-to-uploads.s3.amazonaws.com/i/...

Collapse
 
anupa profile image
Anup Aglawe

Make sure in your settings.json ...you have -noLogo flag.
"commandline": "powershell.exe -NoLogo -NoExit",

Collapse
 
shekhsaifuddin007 profile image
Shekh Saifuddin • Edited

Where are the settings.json located.? I can't find this, BTW I'm using PowerShell 7.1.0
not WindowsPowerShell

Thread Thread
 
anupa profile image
Anup Aglawe

I'm talking about windows terminal settings, which can be accessed from the terminal dropdown.

Thread Thread
 
shekhsaifuddin007 profile image
Shekh Saifuddin

yah.! it's gone from Windows Terminal 😊 but still, have on PowerShell and WindowsPowerShell 😢

Thread Thread
 
malviez profile image
malviez • Edited
  1. Right click powershell shortcut
  2. Hit property
  3. Open shortcut tab
  4. Add " -nologo" at the end of target address

The message will be gone in powershell.

Collapse
 
anupa profile image
Anup Aglawe

As far as I know it is not possible for cmd, but should be much easier for wsl, and there are many articles for the same.

Collapse
 
zakialfaridzi profile image
zakialfaridzi

Hi! love the article. But i was wondering how to change the emojis?

Collapse
 
anupa profile image
Anup Aglawe
$sl.PromptSymbols.StartSymbol = [char]::ConvertFromUtf32(0x01F984) + [char]::ConvertFromUtf32(0x0001F525) + ' '
$sl.PromptSymbols.PromptIndicator = [char]::ConvertFromUtf32(0x01F680) +[char]::ConvertFromUtf32(0x276F)
Enter fullscreen mode Exit fullscreen mode

The hexcodes (0x...) you see in this snippet represents emojis. Just google hex code of emojis you like and replace the above code.

Collapse
 
zakialfaridzi profile image
zakialfaridzi

ohh okay, thanks Anup!

Collapse
 
chrispinkney profile image
Chris Pinkney

Awesome, thanks!

However, the transparency affects disappear when the window is not focused, any ideas how to fix this?

Collapse
 
anupa profile image
Anup Aglawe

From their GitHub repo

unfortunately! System policy dictates that acrylic is only allowed on the actively focused window. Once the terminal loses focus, the system takes acrylic away from us.

Collapse
 
chrispinkney profile image
Chris Pinkney

Too bad! I tried to google it a bit before commenting and found similar answers but was hoping you'd somehow have a solution. Thank you!

Collapse
 
danielagiorgio profile image
Daniela Giorgio • Edited

thank you! I love it :)
powershell

Collapse
 
zealotce profile image
zealotce • Edited

hello , do you have any plan to support "anaconda env" in powershell in windows terminal.

Collapse
 
barlerer profile image
Bar Lerer

How do I add emojis to Oh My Posh V3?
When I try to edit the theme, its a JSON file, and the lines you specified are not valid JSONs

Collapse
 
snarkcorn profile image
Adarsh Nair

what-a-life-what-a-meme.lifes-a-me...

I'm getting this for some reason, any particular reason why?

Collapse
 
anupa profile image
Anup Aglawe

I guess ASCII art text is throwing error.
Test if there is still the same error if text I used in the post is used.
I recommend this tool -
topster.net/ascii-generator/

Collapse
 
happytodev profile image
HappyToDev

If you will use this in VSCode Terminal, use by default PowerShell 7 version and don't forget to enter "Cascadia Code PL" in Terminal > Integrated: Font Family

And enjoy !

Collapse
 
kken94 profile image
Nicola Taddei

With new oh-my-posh version we need an article review :(.

PS: can you share your bg wallpaper? Thank you

Collapse
 
anupa profile image
Anup Aglawe

Sorry but I don't have enough time to rewrite the article.

Image source - facets.la

Collapse
 
alfdocimo profile image
Alfredo Narváez Docimo

This is so amazing, thank you thank you thank you!!! I thought the only way I could achieve a somewhat aesthetic terminal was using WSL and installing oh-my-zsh and whatnot. Massive thanks for real! 💙

Collapse
 
krrishdhaneja profile image
Krrish Dhaneja

can u share the pic in your terminal background?

Collapse
 
anupa profile image
Anup Aglawe • Edited

Check out this facets.la/. Some cool collection of images.

Collapse
 
sssinaaa profile image
vFlag

thank you so much

Collapse
 
rohitpatil5 profile image
Rohit Patil

Hey Anup,

Thanks for a great guide. Can you please also share the image which you have used as the background image for the terminal?
I liked it and want to use the same. :)

Collapse
 
anupa profile image
Anup Aglawe

Check out this facets.la/. Some cool collection of images.

Collapse
 
hongducdev profile image
Nguyễn Hồng Đức

Is it possible to modify the Oh-my-posh theme in 2023?