mirror of
https://github.com/microsoft/terminal.git
synced 2026-07-08 17:56:28 +00:00
This adds a new feature to the Windows Terminal: "Workspaces" Workspaces are very shamelessly inspired by Edge workspaces of the same name. 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. 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 (this is a reboot of #20162, but with the event from #20311)
52 lines
1.9 KiB
Plaintext
52 lines
1.9 KiB
Plaintext
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
import "Command.idl";
|
|
import "GlobalAppSettings.idl";
|
|
|
|
namespace Microsoft.Terminal.Settings.Model
|
|
{
|
|
enum InfoBarMessage
|
|
{
|
|
// We need a sentinel value to map deleted keys to, as we can't actually delete them (GH#16874)
|
|
IgnoredDeprecatedEntry = 0,
|
|
CloseOnExitInfo,
|
|
KeyboardServiceWarning,
|
|
};
|
|
|
|
runtimeclass WindowLayout
|
|
{
|
|
WindowLayout();
|
|
|
|
static String ToJson(WindowLayout layout);
|
|
static WindowLayout FromJson(String json);
|
|
|
|
Windows.Foundation.Collections.IVector<ActionAndArgs> TabLayout;
|
|
Windows.Foundation.IReference<LaunchPosition> InitialPosition;
|
|
Windows.Foundation.IReference<Windows.Foundation.Size> InitialSize;
|
|
Windows.Foundation.IReference<LaunchMode> LaunchMode;
|
|
};
|
|
|
|
[default_interface] runtimeclass ApplicationState {
|
|
static ApplicationState SharedInstance();
|
|
|
|
void Flush();
|
|
void Reset();
|
|
|
|
void AppendPersistedWindowLayout(WindowLayout layout);
|
|
Boolean DismissBadge(String badgeId);
|
|
Boolean BadgeDismissed(String badgeId);
|
|
|
|
void SaveWorkspace(String name, WindowLayout layout);
|
|
Boolean RemoveWorkspace(String name);
|
|
Boolean RenameWorkspace(String oldName, String newName);
|
|
WindowLayout TakeWorkspace(String name);
|
|
Windows.Foundation.Collections.IMapView<String, WindowLayout> AllPersistedWorkspaces();
|
|
|
|
String SettingsHash;
|
|
Windows.Foundation.Collections.IVector<WindowLayout> PersistedWindowLayouts;
|
|
Windows.Foundation.Collections.IVector<String> RecentCommands;
|
|
Windows.Foundation.Collections.IVector<InfoBarMessage> DismissedMessages;
|
|
Windows.Foundation.Collections.IVector<String> AllowedCommandlines;
|
|
}
|
|
}
|