terminal/src/cascadia/TerminalSettingsModel
Mike Griese fb597ed304
Add support for renaming windows (#9662)
## Summary of the Pull Request

This PR adds support for renaming windows.

![window-renaming-000](https://user-images.githubusercontent.com/18356694/113034344-9a30be00-9157-11eb-9443-975f3c294f56.gif)
![window-renaming-001](https://user-images.githubusercontent.com/18356694/113034452-b5033280-9157-11eb-9e35-e5ac80fef0bc.gif)


It does so through two new actions:
* `renameWindow` takes a `name` parameter, and attempts to set the window's name
  to the provided name. This is useful if you always want to hit <kbd>F3</kbd>
  and rename a window to "foo" (READ: probably not that useful)
* `openWindowRenamer` is more interesting: it opens a `TeachingTip` with a
  `TextBox`. When the user hits Ok, it'll request a rename for the provided
  value. This lets the user pick a new name for the window at runtime.

In both cases, if there's already a window with that name, then the monarch will
reject the rename, and pop a `Toast` in the window informing the user that the
rename failed. Nifty!

## References
* Builds on the toasts from #9523
* #5000 - process model megathread

## PR Checklist
* [x] Closes https://github.com/microsoft/terminal/projects/5#card-50771747
* [x] I work here
* [x] Tests addded (and pass with the help of #9660)
* [ ] Requires documentation to be updated

## Detailed Description of the Pull Request / Additional comments

I'm sending this PR while finishing up the tests. I figured I'll have time to sneak them in before I get the necessary reviews.

> PAIN: We can't immediately focus the textbox in the TeachingTip. It's
> not technically focusable until it is opened. However, it doesn't
> provide an even tto tell us when it is opened. That's tracked in
> microsoft/microsoft-ui-xaml#1607. So for now, the user _needs_ to
> click on the text box manually.
> We're also not using a ContentDialog for this, because in Xaml
> Islands a text box in a ContentDialog won't recieve _any_ keypresses.
> Fun!

## Validation Steps Performed

I've been playing with 

```json
        { "keys": "f1", "command": "identifyWindow" },
        { "keys": "f2", "command": "identifyWindows" },
        { "keys": "f3", "command": "openWindowRenamer" },
        { "keys": "f4", "command": { "action": "renameWindow", "name": "foo" } },
        { "keys": "f5", "command": { "action": "renameWindow", "name": "bar" } },
```

and they seem to work as expected
2021-04-02 16:00:04 +00:00
..
dll Fix build break where Microsoft.Terminal.Control.dll is empty (#9537) 2021-03-18 16:14:21 +00:00
Resources/en-US Add support for renaming windows (#9662) 2021-04-02 16:00:04 +00:00
ActionAndArgs.cpp Add support for renaming windows (#9662) 2021-04-02 16:00:04 +00:00
ActionAndArgs.h Replace some of our macros to reduce confusion, increase success (#9376) 2021-03-04 11:27:03 -08:00
ActionArgs.cpp Add support for renaming windows (#9662) 2021-04-02 16:00:04 +00:00
ActionArgs.h Add support for renaming windows (#9662) 2021-04-02 16:00:04 +00:00
ActionArgs.idl Add support for renaming windows (#9662) 2021-04-02 16:00:04 +00:00
AllShortcutActions.h Add support for renaming windows (#9662) 2021-04-02 16:00:04 +00:00
AzureCloudShellGenerator.cpp Introduce TerminalSettingsModel project (#7667) 2020-10-06 09:56:59 -07:00
AzureCloudShellGenerator.h Introduce TerminalSettingsModel project (#7667) 2020-10-06 09:56:59 -07:00
CascadiaSettings.cpp Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
CascadiaSettings.h Add support for "fragment extensions" (#7632) 2021-02-19 02:12:16 +00:00
CascadiaSettings.idl Bugfix: sync color scheme rename with profile reference (#8793) 2021-01-22 18:21:18 +00:00
CascadiaSettingsSerialization.cpp Check if found folder is not null when loading fragments (#9477) 2021-03-15 16:34:30 +00:00
ColorScheme.cpp Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
ColorScheme.h Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
ColorScheme.idl Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
Command.cpp Invalidate nested command with no valid subcommands (#9495) 2021-03-15 16:34:06 +00:00
Command.h Replace some of our macros to reduce confusion, increase success (#9376) 2021-03-04 11:27:03 -08:00
Command.idl Add a simple page for keybindings (#9253) 2021-02-23 23:37:23 +00:00
DefaultProfileUtils.cpp Introduce setting override tracking and update SettingContainer (#9079) 2021-02-19 23:50:52 +00:00
DefaultProfileUtils.h Make Global and Profile settings inheritable (#7923) 2020-10-27 17:35:09 +00:00
defaults-universal.json Implement user-specified pixel shaders, redux (#8565) 2020-12-15 20:40:22 +00:00
defaults.json Add support for renaming windows (#9662) 2021-04-02 16:00:04 +00:00
EnumMappings.cpp Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
EnumMappings.h Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
EnumMappings.idl Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
GlobalAppSettings.cpp Invalidate nested command with no valid subcommands (#9495) 2021-03-15 16:34:06 +00:00
GlobalAppSettings.h Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
GlobalAppSettings.idl Allow overriding tab switcher mode on command level (#9507) 2021-03-23 22:00:07 +00:00
IconPathConverter.cpp Move IconSourceConverter from TerminalApp to TSM 2020-12-11 13:17:22 -08:00
IconPathConverter.h Move IconSourceConverter from TerminalApp to TSM 2020-12-11 13:17:22 -08:00
IconPathConverter.idl Move IconSourceConverter from TerminalApp to TSM 2020-12-11 13:17:22 -08:00
IDynamicProfileGenerator.h Introduce TerminalSettingsModel project (#7667) 2020-10-06 09:56:59 -07:00
IInheritable.h Move TerminalSettings from TermApp to TerminalSettingsModel (#9318) 2021-03-15 23:15:25 +00:00
IInheritable.idl.h Introduce setting override tracking and update SettingContainer (#9079) 2021-02-19 23:50:52 +00:00
init.cpp Hook up the WIL fallback error tracer in Terminal (#7864) 2020-10-09 22:20:12 +00:00
JsonUtils.h Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
KeyChordSerialization.cpp Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
KeyChordSerialization.h Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
KeyChordSerialization.idl Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
KeyMapping.cpp Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
KeyMapping.h Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
KeyMapping.idl Add X Macro for fun and for profit (#9667) 2021-03-31 16:38:25 +00:00
KeyMappingSerialization.cpp Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
LegacyProfileGeneratorNamespaces.h From orbit, nuke the Telnet connection and all supporting infra. (#7840) 2020-10-09 18:59:58 +00:00
Microsoft.Terminal.Settings.ModelLib.vcxproj Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
Microsoft.Terminal.Settings.ModelLib.vcxproj.filters Introduce public enum name<->value mappings to TSM 2020-12-11 13:19:03 -08:00
packages.config Update C++/WinRT to 2.0.210309.3 (#9437) 2021-03-10 16:04:59 -06:00
pch.cpp Introduce TerminalSettingsModel project (#7667) 2020-10-06 09:56:59 -07:00
pch.h Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
PowershellCoreProfileGenerator.cpp Introduce IconConverter (#7830) 2020-10-08 11:29:04 -07:00
PowershellCoreProfileGenerator.h Introduce TerminalSettingsModel project (#7667) 2020-10-06 09:56:59 -07:00
Profile.cpp Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
Profile.h Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
Profile.idl Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
SettingsTypes.h Introduce TerminalSettingsModel project (#7667) 2020-10-06 09:56:59 -07:00
TerminalSettings.cpp Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
TerminalSettings.h Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
TerminalSettings.idl Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
TerminalSettingsSerializationHelpers.h Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
TerminalWarnings.h Introduce TerminalSettingsModel project (#7667) 2020-10-06 09:56:59 -07:00
TerminalWarnings.idl Invalidate nested command with no valid subcommands (#9495) 2021-03-15 16:34:06 +00:00
userDefaults.json Introduce TerminalSettingsModel project (#7667) 2020-10-06 09:56:59 -07:00
WslDistroGenerator.cpp Introduce IconConverter (#7830) 2020-10-08 11:29:04 -07:00
WslDistroGenerator.h Introduce TerminalSettingsModel project (#7667) 2020-10-06 09:56:59 -07:00