terminal/src/cascadia
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
..
CascadiaPackage Fix the preview package manifest 2021-03-29 12:23:57 -05:00
inc Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
LocalTests_SettingsModel Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
LocalTests_TerminalApp Add support for renaming windows (#9662) 2021-04-02 16:00:04 +00:00
PublicTerminalCore Exclude more rarely-used stuff from Windows headers (#8513) 2020-12-11 19:35:23 +00:00
Remoting Add support for renaming windows (#9662) 2021-04-02 16:00:04 +00:00
ShellExtension Move Branding into common props (#9668) 2021-03-30 18:08:53 -05:00
TerminalApp Add support for renaming windows (#9662) 2021-04-02 16:00:04 +00:00
TerminalAzBridge Update C++/WinRT to 2.0.210309.3 (#9437) 2021-03-10 16:04:59 -06:00
TerminalConnection Implement Default Terminal (#7489) 2021-03-26 17:09:49 -05:00
TerminalControl Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
TerminalCore Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
TerminalSettingsEditor Remove default terminal item from SUI (#9671) 2021-03-31 18:50:40 +00:00
TerminalSettingsModel Add support for renaming windows (#9662) 2021-04-02 16:00:04 +00:00
UnitTests_Remoting Add support for renaming windows (#9662) 2021-04-02 16:00:04 +00:00
UnitTests_TerminalCore Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
ut_app Introduce MS.Term.Core.Color to replace W.U.Color for Core/Control/TSM (#9658) 2021-03-30 20:15:49 +00:00
WindowsTerminal Add support for renaming windows (#9662) 2021-04-02 16:00:04 +00:00
WindowsTerminalUniversal Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
WinRTUtils Update C++/WinRT to 2.0.210309.3 (#9437) 2021-03-10 16:04:59 -06:00
WpfTerminalControl Auto-format our XAML files and enforce in CI (#9589) 2021-03-29 17:09:38 -05:00
WpfTerminalTestNetCore Auto-format our XAML files and enforce in CI (#9589) 2021-03-29 17:09:38 -05:00
wt Build and ship an actual binary named wt that just launches WT (#6860) 2020-07-10 22:41:37 +00:00
CascadiaResources.build.items Introduce TerminalSettingsModel project (#7667) 2020-10-06 09:56:59 -07:00