Skip to content

Feature request: add option to display only last result (clear screen) #1

@esocode

Description

@esocode

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 -Continuous

But 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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions