terminal/src/terminal/adapter/ut_adapter
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
..
Adapter.UnitTests.vcxproj Add support for XTPUSHSGR / XTPOPSGR (#1978) 2021-02-17 18:31:52 -08:00
Adapter.UnitTests.vcxproj.filters Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
adapterTest.cpp Implement and action for manually clearing the Terminal (and conpty) buffer (#10906) 2021-09-02 14:59:42 +00:00
inputTest.cpp Change backslashes in include statements to forward slashes (#8205) 2020-11-25 21:02:10 +00:00
MouseInputTest.cpp Fix the xterm and SGR mouse encodings for CTRL, ALT, SHIFT (#8379) 2020-11-30 03:45:53 +00:00
product.pbxproj Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
run.bat Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
sources Merged PR 5445070: [Git2Git] Update the Windows build for some shell changes 2020-12-16 01:32:35 +00:00
testmd.definition Integrate inbox changes up to 68d3b53286dd 2019-12-02 17:24:26 -08:00
WexHelpers.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00