You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider adding a WT_PROFILE env var pointing to settings file #4566
Area-SettingsIssues related to settings and customizability, for console or terminalHelp WantedWe encourage anyone to jump in on these.Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Product-TerminalThe new Windows Terminal.
If the settings UI is not planned until after 1.0, then I strongly recommend adding an environment variable with the path to the json settings file, so it can be edited with the editor of choice (vi, notepad, nano, emacs, whatever) from within the shell of choice without burning brain calories trying to find it buried in AppData. Also: Relying on the GUI menu is, well, unreliable, due to there being no guarantee of a valid file association for json files.
We've already got WT_SESSION env var -- something like WT_PROFILE would be useful.
Then from within cmd or powershell, I can easily edit settings with my preferred editor, or interactively using $settings = gc $env:WT_PROFILE | convertto-json and flipping settings on the object model directly before saving it back out.
Reacted by Tomas Restrepo, Chris Warwick, Rain Sallow (/u/ta11ow), Brian Scholer, Joel Bennett, Jared Kauppila, Dale Phurrough, Jon Goodger, Mateusz Łoskot, Mateusz Kadlubowski and 4 more
Aaron Kulbe (@akulbe)I think now there is only a defaults.json and you may create your own profiles.json file as a differential to this (things in your file will override the defaults).
There's a readonly defaults.json alongside the executable, and a user-editable one for overrides in your local app data folder.
Run the following one-liner in powershell to open the defaults.json file:
Does anyone actually have a use for WT_Session? Is it just so you can distinguish different terminal connections to the same (e.g. ssh) session? To me, the WT_Profile in #3589 would be really useful. This one, pointing to the config file (confusingly named profile.json), would also be useful but it feels less useful -- isn't there only one location (plus one for dev builds)?
While they are "discoverable" - for certain definitions of discoverability - I think they are unwieldy enough to benefit from an environment variable.
Joel Bennett (@Jaykul) I really like your idea for the active profile ID. What do you suggest for a name? I think WT_PROFILE is too close to WT_PROFILES (which matches the name of the json file, likewise for WT_DEFAULTS)
My expectation of a variable like WT_PROFILE would be that I could use it to change where Windows Terminal reads user settings from. I would use it to move this to my "dotfiles" repository where I keep various application settings so I can version and sync them across machines.
Based on how other, similar software works, I think it would make sense if Windows Terminal only read this environment variable at process start up and then monitored the path for changes. It would also be reasonable for Windows Terminal to detect changes to the environment "template" by handling WM_SETTINGCHANGE notifications. (Though, there are some subtle details to consider about when changes are applied. Lots of thoughts in #1125, "Feature Request: Terminal should listen for the WM_SETTINGCHANGE for environment variable updates".)
changed the title [-]Consider adding a WT_PROFILE env var pointing to settings file for 1.0 release[/-][+]Consider adding a WT_PROFILE env var pointing to settings file[/+]on Jun 26, 2020
What about WT_SettingsPath which could give back the path of the same file which gets opened by hitting ctrl+, ?
The path in the name would really limit the scope, and make most of the questions irrelevant. I realize that this is not the end solution but sounds like a great MVP.
If you only give back the currently used, and editable path, it will be up to the users to decide what do they want to do with it. This approach sounds supportable in the future, because if you change the path - to support roaming or whatever - or the file name, etc., WT must always know where the active settings are, because it had to read the content.
I'm editing the content of the settings.json in PSWinTerminal but figuring out if the running terminal is the GA version or it Preview isn't pretty. I'd to look for the parent process' path and look for the word preview in the folder name. With PowerShell this is easy, but with Windows PowerShell I had to use Get-CimInstance.
It would be really nice if I can simply just use WT_SettingsPath to get the path of the settings file.
Numerous times I tried to automate some settings / profiles edits on the Terminal settings themselves, and I usually lack informations about the current tab environment :
What is the current loaded profile / scheme ?
Is the host the preview package ?
I'm sure there are also more info we could export to env vars based on people needs.
This would be veery useful to manage the terminal settings / themes / profiles directly from the command line !
How do you find the editable defaults.json file if I run notepad (join-path ((dir (gcm wt.exe).source).target | split-path) defaults.json)
it pulls up the one that I can't edit. If I hit Alt-Settings, it opens a defaults.json file, but I can't save it.
Brad Rice (@bradrice) Yep, that's correct. You shouldn't be editing defaults.json. That file technically isn't even read by the Terminal - it's more of a reference of what the Terminal's hard-coded defaults are.
The problem I have with Powershell and Windows Terminal is using a theme for vim. I would love to ise gruvbox. For some reason my vim has these red backgrounds with red type and I can't read it, when I'm using code completion that is flagging me of an error in my typescript. Is there a way to make a powershell terminal behave more like a linix or mac terminal with regard to respecting a vim colorscheme?
You might be better off filing a new issue rather than bumping this old one. Probably best to include if you're using vim.exe or WSL vim, maybe a link to the vim scheme you're trying to use, and include your settings.json
Area-SettingsIssues related to settings and customizability, for console or terminalHelp WantedWe encourage anyone to jump in on these.Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Product-TerminalThe new Windows Terminal.
Activity
akulbe commentedon Feb 13, 2020
Oisin Grehan (@oising) Are you able to access settings at all? I no longer find a
profiles.jsonfile, and Ctrl-, no longer even pulls one up.oising commentedon Feb 13, 2020
Aaron Kulbe (@akulbe)
I think now there is only adefaults.jsonand you may create your ownprofiles.jsonfile as a differential to this (things in your file will override the defaults).There's a readonly
defaults.jsonalongside the executable, and a user-editable one for overrides in your local app data folder.Run the following one-liner in powershell to open the
defaults.jsonfile:The
profiles.jsonfile is in%LOCALAPPDATA%\packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\JustinGrote commentedon Feb 14, 2020
Conflicts with #3589 request, maybe have the variable be WT_CONFIGFILE?
Currently the location is pretty stable and discoverable, this change would only be relevant if you could also customize the path.
Jaykul commentedon Feb 20, 2020
Does anyone actually have a use for WT_Session? Is it just so you can distinguish different terminal connections to the same (e.g. ssh) session? To me, the WT_Profile in #3589 would be really useful. This one, pointing to the config file (confusingly named profile.json), would also be useful but it feels less useful -- isn't there only one location (plus one for dev builds)?
oising commentedon Feb 20, 2020
Well there are actually two config files, in different locations - I propose:
env var
WT_PROFILES(user editable) for:%LOCALAPPDATA%\packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\profiles.jsonenv var
WT_DEFAULTS(read only, for reference) for:%PROGRAMFILES%\WindowsApps\Microsoft.WindowsTerminal_0.9.433.0_x64__8wekyb3d8bbwe\defaults.jsonWhile they are "discoverable" - for certain definitions of discoverability - I think they are unwieldy enough to benefit from an environment variable.
Joel Bennett (@Jaykul) I really like your idea for the active profile ID. What do you suggest for a name? I think WT_PROFILE is too close to WT_PROFILES (which matches the name of the json file, likewise for WT_DEFAULTS)
chwarr commentedon Mar 8, 2020
On February 20, 2020, Oisin Grehan (@oising) said:
Can you expand on what you mean by a read-only environment variable? Windows, doesn't have anything like read-only environment variables AFAIK. A process is free to modify its own environment or to start children with custom environments.
My expectation of a variable like
WT_PROFILEwould be that I could use it to change where Windows Terminal reads user settings from. I would use it to move this to my "dotfiles" repository where I keep various application settings so I can version and sync them across machines.Based on how other, similar software works, I think it would make sense if Windows Terminal only read this environment variable at process start up and then monitored the path for changes. It would also be reasonable for Windows Terminal to detect changes to the environment "template" by handling
WM_SETTINGCHANGEnotifications. (Though, there are some subtle details to consider about when changes are applied. Lots of thoughts in #1125, "Feature Request: Terminal should listen for the WM_SETTINGCHANGE for environment variable updates".)10 remaining items
[-]Consider adding a WT_PROFILE env var pointing to settings file for 1.0 release[/-][+]Consider adding a WT_PROFILE env var pointing to settings file[/+]sassdawe commentedon Aug 28, 2020
Just to complicate things a little bit.
What about
WT_SettingsPathwhich could give back the path of the same file which gets opened by hittingctrl+,?The
pathin the name would really limit the scope, and make most of the questions irrelevant. I realize that this is not the end solution but sounds like a great MVP.If you only give back the currently used, and editable path, it will be up to the users to decide what do they want to do with it. This approach sounds supportable in the future, because if you change the path - to support roaming or whatever - or the file name, etc., WT must always know where the active settings are, because it had to read the content.
I'm editing the content of the
settings.jsonin PSWinTerminal but figuring out if the running terminal is the GA version or it Preview isn't pretty. I'd to look for the parent process' path and look for the wordpreviewin the folder name. With PowerShell this is easy, but with Windows PowerShell I had to use Get-CimInstance.It would be really nice if I can simply just use
WT_SettingsPathto get the path of the settings file.What do you think?
zadjii-msft commentedon Sep 29, 2020
From arqtiq in #7773
bradrice commentedon Mar 19, 2021
How do you find the editable defaults.json file if I run notepad (join-path ((dir (gcm wt.exe).source).target | split-path) defaults.json)
it pulls up the one that I can't edit. If I hit Alt-Settings, it opens a defaults.json file, but I can't save it.
zadjii-msft commentedon Mar 19, 2021
Brad Rice (@bradrice) Yep, that's correct. You shouldn't be editing
defaults.json. That file technically isn't even read by the Terminal - it's more of a reference of what the Terminal's hard-coded defaults are.bradrice commentedon Mar 19, 2021
The problem I have with Powershell and Windows Terminal is using a theme for vim. I would love to ise gruvbox. For some reason my vim has these red backgrounds with red type and I can't read it, when I'm using code completion that is flagging me of an error in my typescript. Is there a way to make a powershell terminal behave more like a linix or mac terminal with regard to respecting a vim colorscheme?
zadjii-msft commentedon Mar 19, 2021
You might be better off filing a new issue rather than bumping this old one. Probably best to include if you're using vim.exe or WSL vim, maybe a link to the vim scheme you're trying to use, and include your
settings.jsonsassdawe commentedon Mar 19, 2021
Brad Rice (@bradrice) you don't need the ALT button, a pure click on the Settings will open the
setting.json, which is editable.bradrice commentedon Mar 19, 2021
You're right Mike Griese (@zadjii-msft) , I should keep issues separate. Thanks David Sass (@sassdawe) that helped. I didn't see the link to the json file when I hit settings.