terminal/src/inc
Mike Griese 7612044363
Implement a pair of shims for cls, Clear-Host in conpty mode (#5627)
## Summary of the Pull Request

This PR implements a pair of shims for `cmd` and `powershell`, so that their `cls` and `Clear-Host` functions will clear the entire terminal buffer (like they do in conhost), instead of just the viewport. With the conpty viewport and buffer being the same size, there's effectively no way to know if an application is calling these API's in this way with the intention of clearing the buffer or the viewport. We absolutely have to guess. 

Each of these shims checks to see if the way that the API is being called exactly matches the way `cmd` or `powershell` would call these APIs. If it does, we manually write a `^[[3J` to the connected terminal, to get he Terminal to clear it's own scrollback.

~~_⚠️ If another application were trying to clear the **viewport** with an exactly similar API call, this would also cause the terminal scrollback to get cleared ⚠️_~~

* [x] Should these shims be restricted to when the process that's calling them is actually `cmd.exe` or `powershell.exe`? Can I even do this? I think we've done such a good job of isolating the client process information from the rest of the host code that I can't figure out how to do this.
  - YES, this can be done, and I did it.
* [ ] **TODO**: _While I'm here_, should I have `DoSrvPrivateEraseAll` (the implementation for `^[[2J`, in `getset.cpp`) also manually trigger a EraseAll in the terminal in conpty mode?

## PR Checklist
* [x] Closes #3126
* [x] Actually closes #1305 too, which is really the same thing, but probably deserves a callout
* [x] I work here
* [x] Tests added/passed
* [n/a] Requires documentation to be updated

## Validation Steps Performed
* ran tests
* checked `cls` in the Terminal
* checked `Clear-Host` in the Terminal
* Checked running `powershell clear-host` from `cmd.exe`
2020-04-30 21:53:31 +00:00
..
CppCoreCheck Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
test Hide the commandline on a resize to prevent a crash when snapping the window (#5620) 2020-04-29 23:47:56 +00:00
til Implement a pair of shims for cls, Clear-Host in conpty mode (#5627) 2020-04-30 21:53:31 +00:00
argb.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
conattrs.hpp Add support for passing through extended text attributes, like… (#2917) 2019-10-04 15:53:54 -05:00
conime.h Replace macros with constexpr part 2 (#3416) 2019-11-04 07:37:47 -06:00
conint.h Merge remote-tracking branch 'origin/inbox' into HEAD 2020-02-03 15:16:52 -08:00
conpty-static.h Add support for "reflow"ing the Terminal buffer (#4741) 2020-03-12 17:43:37 -07:00
conpty.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
consoletaeftemplates.hpp Fix copying wrapped lines by implementing better scrolling (#5181) 2020-04-09 00:06:25 +00:00
contsf.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
cpl_core.h Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
DefaultSettings.h Include Cascadia Mono in-package, switch to it by default (#5505) 2020-04-23 22:12:36 +00:00
HostAndPropsheetIncludes.h Introduce UiaTextRangeBase::FindText() for Accessibility (#4373) 2020-01-31 23:26:19 +00:00
IDefaultColorProvider.hpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
ITerminalOutputConnection.hpp Apply audit mode to TerminalInput/Adapter/Parser libraries (#4005) 2020-01-03 14:25:21 +00:00
ITerminalOwner.hpp Revert locking changes (#3488) 2019-11-08 13:44:52 -08:00
LibraryIncludes.h Import fmtlib/fmt@6.2.0, a C++20-style format library (#5336) 2020-04-14 13:04:23 -07:00
operators.hpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
til.h Render row-by-row instead of invalidating entire screen (#5185) 2020-04-13 20:09:02 +00:00
unicode.hpp The Azure cloud shell connector (#1808) 2019-07-25 13:31:41 -07:00
VtIoModes.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00