-
Notifications
You must be signed in to change notification settings - Fork 9
Feature request: add option to display only last result (clear screen) #1
Description
I just came across this nice PowerShell extension and would like to suggest an additional feature: I was searching for an equivalent of the UNIX watch command and although this cmdlet already provides most of the features one difference is that watch displays the results continuously in the upper right corner of the screen. In my case I wanted to watch a directory listing for changes which lead to a scrolling list of the changes which was difficult to track. I solved this by using a VT escape sequence like in the following code*:
cls; {Write-Host "$([char]27)[0;0H" -NoNewline; Get-ChildItem} | Watch-Command -Difference -AsString -ContinuousBut I think this could be a useful standard feature for many applications of this cmdlet, so I suggest adding an additional option like -ClearScreen that applies the cls and cursor positioning automatically. The above would then become
Get-ChildItem | Watch-Command -ClearScreen -Difference -AsString -Continuous*: Basically the cls at the beginning should be sufficient for clearing the screen and setting the cursor position but in my case (Running in ConEmu) the screen remains blank sometimes without the explicit cursor positioning. I think implementing it directly in the cmdlet should prevent this problem.