Add support for "workspaces" based on window names#20162
Open
zadjii-msft wants to merge 10 commits intomainfrom
Open
Add support for "workspaces" based on window names#20162zadjii-msft wants to merge 10 commits intomainfrom
zadjii-msft wants to merge 10 commits intomainfrom
Conversation
This adds a new feature to the Windows Terminal: "Workspaces"
Workspaces are very shamelessly inspired by Edge workspaces of the same name.
{{video here}}
The core idea is that when users name a window and they close that window, we
will persist that Windows layout and buffers, seperately from the rest of window
restoration. So a user can open a named window, open some profiles, some panes,
do some stuff in it, then close it, and we will keep that state around for the
next time the user opens that window name.
Unnamed windows still behave the same. If you close an unnamed window, and it's
not the last window, then we won't persist the state of it.
To facilitate restoring named windows, we add a `openWorkspace` action. This
allows us to persist the open workspace action in the window layout restoration
path. So when we deserialize the list of tab layouts, and open workspace action
will tell us, hey, go retrieve this known workspace from the state.json, instead
of trying to serialize the window state in two places.
<details>
<summary>
state.json
</summary>
```jsonc
"persistedWindowLayouts" :
[
{
"initialPosition" : "910,462",
"initialSize" :
{
"height" : 623.20001220703125,
"width" : 934.4000244140625
},
"launchMode" : "default",
"tabLayout" :
[
{
"action" : "newTab",
"commandline" : "\"C:\\Program Files\\PowerShell\\7\\pwsh.exe\"",
"profile" : "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"sessionId" : "{09d3ef05-ba3d-44ed-a8f1-065d08a806a4}",
"startingDirectory" : "C:\\Users\\zadji",
"suppressApplicationTitle" : false,
"tabTitle" : "PowerShell"
},
]
},
{
"tabLayout" :
[
{
"action" : "openWorkspace",
"name" : "wsl"
}
]
}
],
"persistedWorkspaces" :
{
"wsl" :
{
"initialPosition" : "109,502",
"initialSize" :
{
"height" : 568,
"width" : 1184.800048828125
},
"launchMode" : "default",
"tabLayout" :
[
{
"action" : "newTab",
"commandline" : "ubuntu.exe",
"profile" : "{51855cb2-8cce-5362-8f54-464b92b32386}",
"sessionId" : "{a7f70c49-71ec-4ac4-9f3a-4884528a3fd6}",
"startingDirectory" : null,
"suppressApplicationTitle" : false,
"tabTitle" : "Ubuntu"
},
{
"action" : "renameWindow",
"name" : "wsl"
}
]
}
},
```
</details>
As demoed in the video, we add a flyout to list the windows that the user has
open, and the named workspaces that they have saved. This allows users to
quickly reopen previously closed workspaces, as well as quickly rename a window,
thereby adding it to the list of saved workspaces. This button can also be
hidden using the theme settings.
This comment has been minimized.
This comment has been minimized.
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This adds a new feature to the Windows Terminal: "Workspaces"
Workspaces are very shamelessly inspired by Edge workspaces of the same name.
wt-workspaces-000.mp4
The core idea is that when users name a window and they close that window, we will persist that Windows layout and buffers, seperately from the rest of window restoration. So a user can open a named window, open some profiles, some panes, do some stuff in it, then close it, and we will keep that state around for the next time the user opens that window name.
Unnamed windows still behave the same. If you close an unnamed window, and it's not the last window, then we won't persist the state of it.
To facilitate restoring named windows, we add a
openWorkspaceaction. This allows us to persist the open workspace action in the window layout restoration path. So when we deserialize the list of tab layouts, and open workspace action will tell us, hey, go retrieve this known workspace from the state.json, instead of trying to serialize the window state in two places.state.json
As demoed in the video, we add a flyout to list the windows that the user has open, and the named workspaces that they have saved. This allows users to quickly reopen previously closed workspaces, as well as quickly rename a window, thereby adding it to the list of saved workspaces. This button can also be hidden using the theme settings.
Closes #17084