terminal/src/cascadia/TerminalConnection
Mike Griese 6268a4779c
Implement and action for manually clearing the Terminal (and conpty) buffer (#10906)
## Summary of the Pull Request

![clear-buffer-000](https://user-images.githubusercontent.com/18356694/127570078-90c6089e-0430-4dfc-bcd4-a0cde20c9167.gif)

This adds a new action, `clearBuffer`. It accepts 3 values for the `clear` type:
* `"clear": "screen"`: Clear the terminal viewport content. Leaves the scrollback untouched. Moves the cursor row to the top of the viewport (unmodified).
* `"clear": "scrollback"`: Clear the scrollback. Leaves the viewport untouched.
* `"clear": "all"`: (**default**) Clear the scrollback and the visible viewport. Moves the cursor row to the top of the viewport (unmodified).

"Clear Buffer" has also been added to `defaults.json`.

## References
* From microsoft/vscode#75141 originally

## PR Checklist
* [x] Closes #1193
* [x] Closes #1882
* [x] I work here
* [x] Tests added/passed
* [ ] Requires documentation to be updated

## Detailed Description of the Pull Request / Additional comments

This is a bit tricky, because we need to plumb it all the way through conpty to clear the buffer. If we don't, then conpty will immediately just redraw the screen. So this sends a signal to the attached conpty, and then waits for conpty to draw the updated, cleared, screen back to us.

## Validation Steps Performed
* works for each of the three clear types as expected
* tests pass.
* works even with `ping -t 8.8.8.8` as you'd hope.
2021-09-02 14:59:42 +00:00
..
Resources/en-US Disable path validation, add warning (#10045) 2021-05-12 17:36:11 +00:00
AzureClient.h Rework error handling and state flow in the Azure connection (#5356) 2020-04-16 17:32:52 -07:00
AzureClientID.h Apply audit mode to TerminalConnection/Core/Settings and WinCon… (#4016) 2020-01-03 10:44:27 -08:00
AzureConnection.cpp Switch Connections to use ValueSets to initialize them (#10184) 2021-07-20 15:02:17 +00:00
AzureConnection.h Switch Connections to use ValueSets to initialize them (#10184) 2021-07-20 15:02:17 +00:00
AzureConnection.idl Switch Connections to use ValueSets to initialize them (#10184) 2021-07-20 15:02:17 +00:00
ConnectionInformation.cpp Switch Connections to use ValueSets to initialize them (#10184) 2021-07-20 15:02:17 +00:00
ConnectionInformation.h Switch Connections to use ValueSets to initialize them (#10184) 2021-07-20 15:02:17 +00:00
ConnectionInformation.idl Switch Connections to use ValueSets to initialize them (#10184) 2021-07-20 15:02:17 +00:00
ConnectionStateHolder.h Apply audit mode to TerminalConnection/Core/Settings and WinCon… (#4016) 2020-01-03 10:44:27 -08:00
ConptyConnection.cpp Implement and action for manually clearing the Terminal (and conpty) buffer (#10906) 2021-09-02 14:59:42 +00:00
ConptyConnection.h Implement and action for manually clearing the Terminal (and conpty) buffer (#10906) 2021-09-02 14:59:42 +00:00
ConptyConnection.idl Implement and action for manually clearing the Terminal (and conpty) buffer (#10906) 2021-09-02 14:59:42 +00:00
CTerminalHandoff.cpp [DefApp] Move from Monarch multi instance servers to Peasant single instance servers (#10823) 2021-08-05 17:05:21 +00:00
CTerminalHandoff.h [DefApp] Move from Monarch multi instance servers to Peasant single instance servers (#10823) 2021-08-05 17:05:21 +00:00
EchoConnection.cpp From orbit, nuke the Telnet connection and all supporting infra. (#7840) 2020-10-09 18:59:58 +00:00
EchoConnection.h Switch Connections to use ValueSets to initialize them (#10184) 2021-07-20 15:02:17 +00:00
EchoConnection.idl Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
init.cpp Hook up the WIL fallback error tracer in Terminal (#7864) 2020-10-09 22:20:12 +00:00
ITerminalConnection.idl Switch Connections to use ValueSets to initialize them (#10184) 2021-07-20 15:02:17 +00:00
packages.config Update C++/WinRT to 2.0.210309.3 (#9437) 2021-03-10 16:04:59 -06:00
pch.cpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
pch.h Exclude more rarely-used stuff from Windows headers (#8513) 2020-12-11 19:35:23 +00:00
TerminalConnection.def Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
TerminalConnection.vcxproj Switch Connections to use ValueSets to initialize them (#10184) 2021-07-20 15:02:17 +00:00
TerminalConnection.vcxproj.filters Implement Default Terminal (#7489) 2021-03-26 17:09:49 -05:00