Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port for PowerShell #90

Open
scottwillmoore opened this issue Jan 20, 2018 · 6 comments
Open

Port for PowerShell #90

scottwillmoore opened this issue Jan 20, 2018 · 6 comments

Comments

@scottwillmoore
Copy link

Issue type: feature
Related issues: none - that I could dig up

Description

Been playing around with PowerShell more and more at my job, home -- thought it would be great if we could work on creating a theme for Windows PowerShell - more specifically powershell.exe.

In addition to PowerShell - we could also aim to provide a theme for the Windows Command Prompt as well as a Windows Subsystem for Linux (WSL). All of these consoles use a similar terminal emulator, which means the method we use to create and set the theme will be similar - however it appears PowerShell defaults to a slightly different theme. In addition the WSL theme would need to be tailored for a Linux environment (possibly a direct copy of colour mapping used in other Linux terminal emulators).

From left to right below: PowerShell, Command Prompt, WSL.

image

Perhaps we should focus on the theme for PowerShell first - and create separate issues at a later date for both Command Prompt and WSL.

PowerShell

The PowerShell theme can be set using the interface above, or using a tool such as concfg (which allows themes to created using JSON), or by creating a custom PowerShell script which can be executed. We could use a mix of the methods mentioned above - I am more than happy to help with this part of the process.

The PowerShell colours can be seen above (middle window), but in addition I have created a script to display the various colours.

[enum]::GetValues([System.ConsoleColor]) | Foreach-Object {
    Write-Host -NoNewline ("{0,2} : " -f $_.value__)
    Write-Host -NoNewline -ForegroundColor $_ "████████████████████ "
    Write-Host ("{0,-12}" -f $_)
}

The output of this script can be seen below.

image

I personally believe that we should try to closely mimic the original PowerShell colour mapping - as these colours are used throughout existing PowerShell scripts and applications. Meaning could be lost if the colours were redefined (e.g. red for errors, yellow for warnings, etc).

Possibly the most horrifying part - is that PowerShell itself doesn't appear to adhere to it's own colour key with is provided in the System.ConsoleColor enun - just look at DarkMagenta or DarkYellow... My advice would be to match the colour mapping described in the enum - and then adjust the Screen Text and Screen Background settings to the colours that you would prefer (as seen in the settings dialog above).

For further reference - you can look at other PowerShell themes created for concfg. The JSON used to describe the default PowerShell theme can also be found in the concfg repository.

I am more than happy to create the theme and scripts required - but it would be great if you could define the colour mapping that you believe would suit the Nord theme the best. It may be better to get some screenshots of some applications for real world examples of the colour being used. The theme can always of course be adjusted over time.

@arcticicestudio
Copy link
Contributor

arcticicestudio commented Jan 20, 2018

Thanks for the great detailed feature request 👍

I'm always happy for any help to get a new port project started. I'll import my Win7 VirtualBox image and install PowerShell to see how their color system works to provide the mapping. As long as there is no official repository, users can transitionally use the content in this issue to use a theme prototype locally.

Please note that my current life situation doesn't allow me to spend as much time on my projects as before like announced on Twitter so I've added this port project to the Backlog Icebox for the time being. It might take some time to test things out, but I'll try to reserve some free time on the weekends.

@scottwillmoore
Copy link
Author

Great! No worries, there is no rush! I'm loving the VSCode and Vim themes that you have put together!

@gfiorav
Copy link

gfiorav commented Dec 27, 2018

Hi @arcticicestudio @scottwillmoore, I've been in this same pickle for some time now, but I've found a great solution I'd like to share here:

There's an official Windows tool to deal with themes in Powershell/Command prompt, and it turns out it supports .itermcolors files!!

Just download the Nord.itermcolors file from the official Arctic Studio repo, then download the ColorTool tool from the official Windows repo, and simply do:

.\path\to\ColorTool.exe -b \path\to\Nord.itermcolors

There you go, a perfect Arctic Studio Nord theme port for Powershell and Command prompt :)

Update for 2020:
Windows have released their new Windows Terminal which supports modern theming. You guys should check it out!

@thatnerdjosh
Copy link

That ColorTool utility doesn't seem to exist any longer @gfiorav, are there any updated solutions that you know of by any chance?

@axelitus
Copy link

axelitus commented Jul 2, 2020

@NerdsvilleCEO while reading a bit more in the repo README I found out that the tool still exists, the reference just changed because of repo structure changed: ColorTool. Don't know if it still works as described in this issue.

@nakshay
Copy link

nakshay commented Oct 28, 2020

Hi @arcticicestudio @scottwillmoore, I've been in this same pickle for some time now, but I've found a great solution I'd like to share here:

There's an official Windows tool to deal with themes in Powershell/Command prompt, and it turns out it supports .itermcolors files!!

Just download the Nord.itermcolors file from the official Arctic Studio repo, then download the ColorTool tool from the official Windows repo, and simply do:

.\path\to\ColorTool.exe -b \path\to\Nord.itermcolors

There you go, a perfect Arctic Studio Nord theme port for Powershell and Command prompt :)

This works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants