-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Add "portable mode", where settings load from the install path #15051
Conversation
std::filesystem::path GetBaseSettingsPath() | ||
{ | ||
static auto baseSettingsPath = []() { | ||
if (IsPortableMode()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically this will always be false for IsPackaged
, because nobody can put down the portable mode marker file. However... i should probably add a check for packaging to avoid a file lookup.
Closes #1386? |
@@ -822,7 +822,7 @@ try | |||
// read settings.json from the Release stable file path if it exists. | |||
// Otherwise use default settings file provided from original settings file | |||
bool releaseSettingExists = false; | |||
if (firstTimeSetup) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally think this is the right choice. Every portable install starts anew.
This comment has been minimized.
This comment has been minimized.
HorizontalAlignment="Left" | ||
VerticalAlignment="Center" | ||
Orientation="Vertical"> | ||
<TextBlock x:Uid="Settings_UnsavedSettingsWarning" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks pretty bad with both of these warnings visible at the same time, but... also the unsaved warning literally never shows up. It's disabled hard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea we can workshop that if we ever get to doing the unsaved settings warning
I'll write up a more specific explanation of how both Unpackaged and Portable together close that issue and do it manually. Good call tho. :) |
I actually did, in the end, choose to make this one close the "distribution methods" issue. |
If this means we can have a direct download link from a microsoft website this could also close #7492 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like I really won out on this hostage exchange
|
||
namespace winrt::Microsoft::Terminal::Settings::Model | ||
{ | ||
// Returns a path like C:\Users\<username>\AppData\Local\Packages\<packagename>\LocalState | ||
// You can put your settings.json or state.json in this directory. | ||
bool IsPortableMode() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just so I'm clear here - if we start in portable mode, then I (a monster) go delete .portable
while the Terminal is running, we'll keep using the portable settings and stay in portable mode, till we exit and relaunch the terminal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you open another Terminal process at this point, it'll still ask the monarch which window it should go into - either way, the original portable process would create the window, just as portable as before.
That tracks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, if you (a monster) do that... it'll do that.
K, so.
It looks like two different launches from two different portable mode directories will do something ~ ~ weird ~ ~ and glom together (lol!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to fix in post, and I have a clever idea for it.
HorizontalAlignment="Left" | ||
VerticalAlignment="Center" | ||
Orientation="Vertical"> | ||
<TextBlock x:Uid="Settings_UnsavedSettingsWarning" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea we can workshop that if we ever get to doing the unsaved settings warning
This pull request implements portable mode for Windows Terminal, which will make side by side deployment of different versions generally more feasible. Portable mode was specified in #15032. There are three broad categories of changes in this PR: 1. Changes to settings loading. 2. A new indicator in the settings UI plus a link to the portable mode docs. 3. A new application display name, `Terminal (Portable)`, which users will hopefully include in their bug reports. It's surprisingly small for how big a deal it is! Related to #15034 Closes #1386 (cherry picked from commit e6a3fa8) Service-Card-Id: 88719279 Service-Version: 1.17
This pull request implements portable mode for Windows Terminal, which
will make side by side deployment of different versions generally more
feasible.
Portable mode was specified in #15032.
There are three broad categories of changes in this PR:
docs.
Terminal (Portable)
, which userswill hopefully include in their bug reports.
It's surprisingly small for how big a deal it is!
Related to #15034
Closes #1386