powershellterminalscroll

Windows PowerShell shortcut to scroll to previous command


The various scroll commands in PowerShell don't seem to offer an option for scrolling to the previous command, i.e. to the top of the previous output.

So if I've executed a series of commands, each with a slew of output, and I want to review the most recent output from the top, wherever the top may be, my options include:

I don't know how long the output from the previous command is, so I'm just scrolling and scanning, scrolling and scanning. It's the most inefficient task of all time :-/

Is there actually a solution for this, just not well known?

Bonus: do other command line tools have an equivalent shortcut?


Solution

  • Note:


    Visual Studio Code's integrated terminal offers a shell integration feature that is enabled by default and supports a number of shells, including PowerShell (open the Settings view (Ctrl+,) and type shell integration to see all relevant settings).

    With this feature enabled (as is the case by default):


    The following screenshot illustrates the above-mentioned GUI features: note the blue dots in the gutter on the LHS, and the blue squares in the overview ruler (scroll bar) on the RHS.

    screenshot