This pull request implements the new `ITerminalConnection::ConnectionState` interface (enum, event) and connects it through TerminalControl to Pane, Tab and App as specified in #2039. It does so to implement `closeOnExit` = `graceful` in addition to the other two normal CoE types. It also: * exposes the singleton `CascadiaSettings` through a function that looks it up by using the current Xaml application's `AppLogic`. * In so doing, we've broken up the weird runaround where App tells TerminalSettings to CloseOnExit and then later another part of App _asks TerminalControl_ to tell it what TerminalSettings said App told it earlier. `:crazy_eyes:` * wires up a bunch of connection state points to `AzureConnection`. This required moving the Azure connection's state machine to use another enum name (oops). * ships a helper class for managing connection state transitions. * contains a bunch of template magic. * introduces `WINRT_CALLBACK`, a oneshot callback like `TYPED_EVENT`. * replaces a bunch of disparate `_connecting` and `_closing` members with just one uberstate. * updates the JSON schema and defaults to prefer closeOnExit: graceful * updates all relevant documentation Specified in #2039 Fixes #2563 Co-authored-by: mcpiroman <38111589+mcpiroman@users.noreply.github.com>
31 lines
734 B
Plaintext
31 lines
734 B
Plaintext
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
|
|
namespace Microsoft.Terminal.TerminalConnection
|
|
{
|
|
enum ConnectionState
|
|
{
|
|
NotConnected = 0,
|
|
Connecting,
|
|
Connected,
|
|
Closing,
|
|
Closed,
|
|
Failed
|
|
};
|
|
|
|
delegate void TerminalOutputHandler(String output);
|
|
|
|
interface ITerminalConnection
|
|
{
|
|
void Start();
|
|
void WriteInput(String data);
|
|
void Resize(UInt32 rows, UInt32 columns);
|
|
void Close();
|
|
|
|
event TerminalOutputHandler TerminalOutput;
|
|
|
|
event Windows.Foundation.TypedEventHandler<ITerminalConnection, Object> StateChanged;
|
|
ConnectionState State { get; };
|
|
};
|
|
}
|