43297315ba
This commit adds the ability to interact with subtrees of panes. Have you ever thought that you don't have enough regression testing to do? Boy do I have the PR for you! This breaks all kinds of assumptions about what is or is not focused, largely complicated by the fact that a pane is not a proper control. I did my best to cover as many cases as I could, but I wouldn't be surprised if there are some things broken that I am unaware of. Done: - Add `parent` and `child` movement directions to move up and down the tree respectively - When a parent pane is selected it will have borders all around it in addition to any borders the children have. - Fix focus, swap, split, zoom, toggle orientation, resize, and move to all handle interacting with more than one pane. - Similarly the actions for font size changing, closing, read-only, clearing buffer, and changing color scheme will distribute to all children. - This technically leaves control focus on the original control in the focused subtree because panes aren't proper controls themselves. This is also used to make sure we go back down the same path with the `child` movement. - You can zoom a parent pane, and click between different zoomed sub-panes and it won't unzoom you until you use moveFocus or another action. This wasn't explicitly programmed behavior so it is probably buggy (I've quashed a couple at least). It is a natural consequence of showing multiple terminals and allowing you to focus a terminal and a parent separately, since changing the active pane directly does not unzoom. This also means there can be a disconnect between what pane is zoomed and what pane is active. ## Validation Steps Performed Tested focus movement, swapping, moving panes, and zooming. Closes #10733
331 lines
8.4 KiB
Plaintext
331 lines
8.4 KiB
Plaintext
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
|
|
import "Command.idl";
|
|
|
|
namespace Microsoft.Terminal.Settings.Model
|
|
{
|
|
interface IActionArgs
|
|
{
|
|
Boolean Equals(IActionArgs other);
|
|
String GenerateName();
|
|
IActionArgs Copy();
|
|
UInt64 Hash();
|
|
};
|
|
|
|
interface IActionEventArgs
|
|
{
|
|
Boolean Handled;
|
|
IActionArgs ActionArgs { get; };
|
|
};
|
|
|
|
enum ResizeDirection
|
|
{
|
|
None = 0,
|
|
Left,
|
|
Right,
|
|
Up,
|
|
Down
|
|
};
|
|
|
|
enum FocusDirection
|
|
{
|
|
None = 0,
|
|
Left,
|
|
Right,
|
|
Up,
|
|
Down,
|
|
Previous,
|
|
PreviousInOrder,
|
|
NextInOrder,
|
|
First,
|
|
Parent,
|
|
Child
|
|
};
|
|
|
|
enum SplitDirection
|
|
{
|
|
Automatic = 0,
|
|
Up,
|
|
Right,
|
|
Down,
|
|
Left
|
|
};
|
|
|
|
enum SplitType
|
|
{
|
|
Manual = 0,
|
|
Duplicate = 1
|
|
};
|
|
|
|
enum SettingsTarget
|
|
{
|
|
SettingsFile = 0,
|
|
DefaultsFile,
|
|
AllFiles,
|
|
SettingsUI
|
|
};
|
|
|
|
enum MoveTabDirection
|
|
{
|
|
None = 0,
|
|
Forward,
|
|
Backward
|
|
};
|
|
|
|
enum FindMatchDirection
|
|
{
|
|
None = 0,
|
|
Next,
|
|
Previous
|
|
};
|
|
|
|
enum CommandPaletteLaunchMode
|
|
{
|
|
Action = 0,
|
|
CommandLine
|
|
};
|
|
|
|
enum TabSwitcherMode
|
|
{
|
|
MostRecentlyUsed,
|
|
InOrder,
|
|
Disabled,
|
|
};
|
|
|
|
enum DesktopBehavior
|
|
{
|
|
Any,
|
|
ToCurrent,
|
|
OnCurrent,
|
|
};
|
|
|
|
enum MonitorBehavior
|
|
{
|
|
Any,
|
|
ToCurrent,
|
|
ToMouse,
|
|
};
|
|
|
|
[default_interface] runtimeclass NewTerminalArgs {
|
|
NewTerminalArgs();
|
|
NewTerminalArgs(Int32 profileIndex);
|
|
NewTerminalArgs Copy();
|
|
|
|
String Commandline;
|
|
String StartingDirectory;
|
|
String TabTitle;
|
|
Windows.Foundation.IReference<Windows.UI.Color> TabColor;
|
|
String Profile; // Either a GUID or a profile's name if the GUID isn't a match
|
|
// ProfileIndex can be null (for "use the default"), so this needs to be
|
|
// a IReference, so it's nullable
|
|
Windows.Foundation.IReference<Int32> ProfileIndex { get; };
|
|
|
|
Windows.Foundation.IReference<Boolean> SuppressApplicationTitle;
|
|
|
|
String ColorScheme;
|
|
|
|
Boolean Equals(NewTerminalArgs other);
|
|
String GenerateName();
|
|
String ToCommandline();
|
|
UInt64 Hash();
|
|
};
|
|
|
|
[default_interface] runtimeclass ActionEventArgs : IActionEventArgs
|
|
{
|
|
ActionEventArgs();
|
|
ActionEventArgs(IActionArgs args);
|
|
};
|
|
|
|
[default_interface] runtimeclass CopyTextArgs : IActionArgs
|
|
{
|
|
Boolean SingleLine { get; };
|
|
Windows.Foundation.IReference<Microsoft.Terminal.Control.CopyFormat> CopyFormatting { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass NewTabArgs : IActionArgs
|
|
{
|
|
NewTabArgs(NewTerminalArgs terminalArgs);
|
|
NewTerminalArgs TerminalArgs { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass MovePaneArgs : IActionArgs
|
|
{
|
|
MovePaneArgs(UInt32 tabIndex);
|
|
UInt32 TabIndex;
|
|
};
|
|
|
|
[default_interface] runtimeclass SwitchToTabArgs : IActionArgs
|
|
{
|
|
SwitchToTabArgs(UInt32 tabIndex);
|
|
UInt32 TabIndex;
|
|
};
|
|
|
|
[default_interface] runtimeclass ResizePaneArgs : IActionArgs
|
|
{
|
|
ResizeDirection ResizeDirection { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass MoveFocusArgs : IActionArgs
|
|
{
|
|
MoveFocusArgs(FocusDirection direction);
|
|
FocusDirection FocusDirection { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass SwapPaneArgs : IActionArgs
|
|
{
|
|
SwapPaneArgs(FocusDirection direction);
|
|
FocusDirection Direction { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass AdjustFontSizeArgs : IActionArgs
|
|
{
|
|
Int32 Delta { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass SendInputArgs : IActionArgs
|
|
{
|
|
String Input { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass SplitPaneArgs : IActionArgs
|
|
{
|
|
SplitPaneArgs(SplitType splitMode, SplitDirection split, Double size, NewTerminalArgs terminalArgs);
|
|
SplitPaneArgs(SplitDirection split, Double size, NewTerminalArgs terminalArgs);
|
|
SplitPaneArgs(SplitDirection split, NewTerminalArgs terminalArgs);
|
|
SplitPaneArgs(SplitType splitMode);
|
|
|
|
SplitDirection SplitDirection { get; };
|
|
NewTerminalArgs TerminalArgs { get; };
|
|
SplitType SplitMode { get; };
|
|
Double SplitSize { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass OpenSettingsArgs : IActionArgs
|
|
{
|
|
OpenSettingsArgs(SettingsTarget target);
|
|
SettingsTarget Target { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass SetColorSchemeArgs : IActionArgs
|
|
{
|
|
SetColorSchemeArgs(String name);
|
|
String SchemeName { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass SetTabColorArgs : IActionArgs
|
|
{
|
|
SetTabColorArgs(Windows.UI.Color tabColor);
|
|
Windows.Foundation.IReference<Windows.UI.Color> TabColor { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass RenameTabArgs : IActionArgs
|
|
{
|
|
String Title { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass ExecuteCommandlineArgs : IActionArgs
|
|
{
|
|
ExecuteCommandlineArgs(String commandline);
|
|
String Commandline;
|
|
};
|
|
|
|
[default_interface] runtimeclass CloseOtherTabsArgs : IActionArgs
|
|
{
|
|
CloseOtherTabsArgs(UInt32 tabIndex);
|
|
Windows.Foundation.IReference<UInt32> Index { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass CloseTabsAfterArgs : IActionArgs
|
|
{
|
|
CloseTabsAfterArgs(UInt32 tabIndex);
|
|
Windows.Foundation.IReference<UInt32> Index { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass CloseTabArgs : IActionArgs
|
|
{
|
|
CloseTabArgs(UInt32 tabIndex);
|
|
Windows.Foundation.IReference<UInt32> Index { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass MoveTabArgs : IActionArgs
|
|
{
|
|
MoveTabArgs(MoveTabDirection direction);
|
|
MoveTabDirection Direction { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass ScrollUpArgs : IActionArgs
|
|
{
|
|
Windows.Foundation.IReference<UInt32> RowsToScroll { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass ScrollDownArgs : IActionArgs
|
|
{
|
|
Windows.Foundation.IReference<UInt32> RowsToScroll { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass ToggleCommandPaletteArgs : IActionArgs
|
|
{
|
|
CommandPaletteLaunchMode LaunchMode { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass FindMatchArgs : IActionArgs
|
|
{
|
|
FindMatchArgs(FindMatchDirection direction);
|
|
FindMatchDirection Direction { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass NewWindowArgs : IActionArgs
|
|
{
|
|
NewWindowArgs(NewTerminalArgs terminalArgs);
|
|
NewTerminalArgs TerminalArgs { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass PrevTabArgs : IActionArgs
|
|
{
|
|
PrevTabArgs();
|
|
PrevTabArgs(TabSwitcherMode SwitcherMode);
|
|
Windows.Foundation.IReference<TabSwitcherMode> SwitcherMode;
|
|
};
|
|
|
|
[default_interface] runtimeclass NextTabArgs : IActionArgs
|
|
{
|
|
NextTabArgs();
|
|
NextTabArgs(TabSwitcherMode SwitcherMode);
|
|
Windows.Foundation.IReference<TabSwitcherMode> SwitcherMode;
|
|
};
|
|
|
|
[default_interface] runtimeclass RenameWindowArgs : IActionArgs
|
|
{
|
|
RenameWindowArgs(String name);
|
|
String Name { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass GlobalSummonArgs : IActionArgs
|
|
{
|
|
String Name { get; };
|
|
DesktopBehavior Desktop { get; };
|
|
MonitorBehavior Monitor { get; };
|
|
Boolean ToggleVisibility { get; };
|
|
UInt32 DropdownDuration { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass FocusPaneArgs : IActionArgs
|
|
{
|
|
FocusPaneArgs(UInt32 Id);
|
|
UInt32 Id { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass ClearBufferArgs : IActionArgs
|
|
{
|
|
ClearBufferArgs(Microsoft.Terminal.Control.ClearBufferType clear);
|
|
Microsoft.Terminal.Control.ClearBufferType Clear { get; };
|
|
};
|
|
|
|
[default_interface] runtimeclass MultipleActionsArgs : IActionArgs
|
|
{
|
|
MultipleActionsArgs();
|
|
Windows.Foundation.Collections.IVector<ActionAndArgs> Actions;
|
|
};
|
|
}
|