microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.94k stars 8.35k forks source link

ColorTool: Add ps1xml as an accepted extension #5650

Open WSLUser opened 4 years ago

WSLUser commented 4 years ago

Description of the new feature/enhancement

If you are using Windows Powershell, you'll discover that Windows Terminal changes it's default color scheme. However you are unable to change it back. This is due to a custom scheme extension which you can view in PowerShell ISE under Tools - Options. You can export the built-in themes but ColorTool won't allow you to use them. Per ColorTool doc, only json, .itermcolors, and ini file extensions are accepted. So add the option to read those files in, this may require cooperation with the PowerShell team. Ideally we'd be able to convert the color schemes to json so we can read them into Windows Terminal (ideally these should be added to defaults.json once we can export to json).

A clear and concise description of what the problem is that the new feature would solve.

Lets you continue to use the Windows PowerShell color themes if you enjoy using them.

Proposed technical implementation details (optional)

A clear and concise description of what you want to happen.

I want my Windows Powershell profile in WT to keep the same color scheme it originally had and/or change it to one of the other defaults listed in ISE.

zadjii-msft commented 4 years ago

This sounds like an excellent request for colortool to be able to support reading that file format as well. We'd be happy to accept a community contribution here 😄

WSLUser commented 4 years ago

I looked at the file, I think if xml was supported in general, this would be fine (as long as we don't hardcode to just .xml).

WSLUser commented 4 years ago

https://github.com/microsoft/terminal/blob/master/src/tools/ColorTool/ColorTool/SchemeParsers/XmlSchemeParser.cs appears to be a good start.

WSLUser commented 4 years ago

https://stackoverflow.com/questions/26706941/convert-xml-to-specific-json-structure-with-powershell even better start.

WSLUser commented 4 years ago

Fortunately, a couple of the themes are available from Concfg, just not my preferred one. ColorTool will need to strip out the editor portion of the color settings, but keep the terminal settings.

WSLUser commented 4 years ago

Also I should looked closer at defaults.jsonwhich has "Campbell Powershell". Not identical but close enough (bright colors were configured instead of dark colors)