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?
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):
In terms of keyboard shortcuts, Ctrl+↑ scrolls back to the prompt at which the previous command was submitted.
In terms of GUI features (which too are enabled by default):
In the so-called gutter, the area to the left of the terminal display, each submitted command is visually indicated by a small blue dot.
In the so-called overview ruler, which is a visually enhanced scroll bar to the right of the terminal, each submitted command is represented by a blue rectangle
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.