4 ms·
It looks like others have already given you long explanations of why PowerShell works this way. Nevertheless, the behavior you're describing can still be desir
by zenexer 7y ago
It looks like others have already given you long explanations of why PowerShell works this way. Nevertheless, the behavior you're describing can still be desirable at times.
In the future, the following will probably work:
echo "$([char]27)[3J$([char]27)[H$([char]27)[2J"
This matches the output from `tput clear` in WSL.
However, as of writing, it's a bit quirky when combined with other PowerShell commands; for example, the following behaves oddly:
ls; echo "$([char]27)[3J$([char]27)[H$([char]27)[2J"; ls
Unfortunately, I don't have a good solution at the moment.
- recursive 7y agoTo be honest, it's pretty much all over my head. I'm just a simple man, trying to clear my console. The only way to do it seems to be completely restart it, which I guess is ok, but certainly inconvenient. I'll probably check back in on Microsoft Terminal in a few months and see if any of the terminal wizards have discovered a way to clear the console.