vscode-powershell icon indicating copy to clipboard operation
vscode-powershell copied to clipboard

Please allow me to change the terminal theme/colors programmatically

Open NickVH-MS opened this issue 3 years ago • 3 comments

Prerequisites

  • [X] I have written a descriptive issue title.
  • [X] I have searched all issues to ensure it has not already been reported.

Summary

I would like to change the theme/colors of vscode (or at least the powershell terminal window) programmatically. Is there some code.cmd command line option for this? Or maybe something could be added to the $PsEditor that lets me set the vscode theme?

I am able to do this with the powershell_ise, but can't get parity when migrating to the code plugin. The reason I need this is because I have several entirely different powershell uses/environments that need to be open at once. Azure TiP vs Tshell vs Windows build window, etc. If I can't set a color scheme per-window then I confuse myself.

The only workaround I have so far is even more copies of the portable vscode install, each with their own settings. Is there a better way?

Proposed Design

Add some function to the $PsEditor that lets me set the vscode theme (by string name?)

NickVH-MS avatar Jul 13 '22 07:07 NickVH-MS

Thanks @NickVH-MS we would consider a more generalized approach to setting VSCode settings from the PSEditor

SydneyhSmith avatar Jul 13 '22 18:07 SydneyhSmith

Thanks @SydneyhSmith, that would be great. I'm looking forward to such an enhancement for the $PSEditor.

NickVH-MS avatar Jul 15 '22 07:07 NickVH-MS

even more copies of the portable vscode install, each with their own settings

Yes. You can have that same effect with zero portable installs. You can use:

code --profile name

My wrapper explicitly sets directories, but I think that's optional. So a few options are:

  1. Declare your theme in your workspace file, verses the global one
  2. --user-data (this has been around, but now it's easier)
  3. --profile and --temp-profile ( this is new in the last 1-2 patches )
  4. and even newer (from: 1.73 ) option is another settings, that I'm not totally sure how it compares. https://code.visualstudio.com/updates/v1_73#_settings-profiles ( Even newer, in the insider build )

I think the one in 1.73 is for multiple settings on a single profile and/or syncing. If you go the --profile route, you can have multiple global profiles.

ninmonkey avatar Nov 29 '22 20:11 ninmonkey