terminal/src/cascadia/TerminalControl/TermControl.idl
Mike Griese 830c22b73e Add support for commandline args to wt.exe (#4023)
## Summary of the Pull Request

Adds support for commandline arguments to the Windows Terminal, in accordance with the spec in #3495

## References

* Original issue: #607
* Original spec: #3495

## PR Checklist
* [x] Closes #607
* [x] I work here
* [x] Tests added/passed
* [ ] We should probably add some docs on these commands
* [x] The spec (#3495) needs to be merged first!

## Detailed Description of the Pull Request / Additional comments

🛑 **STOP** 🛑 - have you read #3495 yet? If you haven't, go do that now.

This PR adds support for three initial sub-commands to the `wt.exe` application:
* `new-tab`: Used to create a new tab.
* `split-pane`: Used to create a new split.
* `focus-tab`: Moves focus to another tab.

These commands are largely POC to prove that the commandlines work. They're not totally finished, but they work well enough. Follow up work items will be filed to track adding support for additional parameters and subcommands

Important scenarios added:
* `wt -d .`: Open a new wt instance in the current working directory #878
* `wt -p <profile name>`: Create a wt instance running the given profile, to unblock  #576, #1357, #2339
* `wt ; new-tab ; split-pane -V`: Launch the terminal with multiple tabs, splits, to unblock #756 

## Validation Steps Performed

* Ran tests
* Played with it a bunch
2020-01-27 15:34:12 +00:00

63 lines
2.6 KiB
Plaintext

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
namespace Microsoft.Terminal.TerminalControl
{
delegate void TitleChangedEventArgs(String newTitle);
delegate void FontSizeChangedEventArgs(Int32 width, Int32 height, Boolean isInitialChange);
delegate void ScrollPositionChangedEventArgs(Int32 viewTop, Int32 viewHeight, Int32 bufferLength);
runtimeclass CopyToClipboardEventArgs
{
String Text { get; };
String Html { get; };
String Rtf { get; };
}
runtimeclass PasteFromClipboardEventArgs
{
void HandleClipboardData(String data);
}
[default_interface] runtimeclass TermControl : Windows.UI.Xaml.Controls.UserControl
{
TermControl();
TermControl(Microsoft.Terminal.Settings.IControlSettings settings, Microsoft.Terminal.TerminalConnection.ITerminalConnection connection);
static Windows.Foundation.Point GetProposedDimensions(Microsoft.Terminal.Settings.IControlSettings settings, UInt32 dpi);
void UpdateSettings(Microsoft.Terminal.Settings.IControlSettings newSettings);
event TitleChangedEventArgs TitleChanged;
event FontSizeChangedEventArgs FontSizeChanged;
event Windows.Foundation.TypedEventHandler<TermControl, CopyToClipboardEventArgs> CopyToClipboard;
event Windows.Foundation.TypedEventHandler<TermControl, PasteFromClipboardEventArgs> PasteFromClipboard;
event Windows.Foundation.TypedEventHandler<TermControl, Windows.UI.Xaml.RoutedEventArgs> Initialized;
// This is an event handler forwarder for the underlying connection.
// We expose this and ConnectionState here so that it might eventually be data bound.
event Windows.Foundation.TypedEventHandler<TermControl, IInspectable> ConnectionStateChanged;
Microsoft.Terminal.TerminalConnection.ConnectionState ConnectionState { get; };
String Title { get; };
Boolean CopySelectionToClipboard(Boolean trimTrailingWhitespace);
void PasteTextFromClipboard();
void Close();
Windows.Foundation.Size CharacterDimensions { get; };
Windows.Foundation.Size MinimumSize { get; };
Single SnapDimensionToGrid(Boolean widthOrHeight, Single dimension);
void ScrollViewport(Int32 viewTop);
void KeyboardScrollViewport(Int32 viewTop);
Int32 GetScrollOffset();
Int32 GetViewHeight();
event ScrollPositionChangedEventArgs ScrollPositionChanged;
void CreateSearchBoxControl();
void AdjustFontSize(Int32 fontSizeDelta);
void ResetFontSize();
}
}