View mode - Paging and Pausing

images/dt-viewmode1

View mode makes the buffer read-only. It uses a focus position (indicated by a focus cursor), which is independent of the output cursor and the line-editing cursor. The key-bindings move the focus cursor around in the buffer, scrolling as needed to keep the focus cursor visible. Other key-bindings define or extend the selection (which can be copied as needed to the clipboard), or enable find-text mode for searching the buffer. No keystrokes or other events are sent to the application, nor do they modify the input area.

If there is a selection, the focus position is one end (the most “recent”) of the selection. The other end is called the anchor position.

There are two variants of view mode:

Key-bindings are similar to line-edit mode.

View mode has similar functionality as tmux’s copy-mode, the caret browsing modes of common web browsers (typically entered with F7), emacs’s view mode, or using an external pager like less or the older more.

Auto-pause

When auto-pause is enabled, the terminal automatically enters view-paused mode when there is a screenful of fresh output. Specifically, if there is output that would require the display to scroll below the pause limit. The pause limit is automatically adjusted as appropriate - typically one screenful past the most recentg interaction.

To enable automatic-pause mode you can check the Automatic Pager option in the right-click (context) menu. You can also type ctrl-shift-M (to enter pause mode); then a (to enable auto-pause and also exit pause mode).

Entering and exiting view mode

Ctrl+Shift+M (toggle-paging-mode)
F7

Enter or exit view-paused mode: If not in view mode (in character or line-edit mode), enter view-paused mode. Otherwise, return to normal mode. If there is a selection, the focus position is set to the “most recent” end of the selection. Otherwise, the focus position is initialized to the caret position.

If in view mode, return to character or line-edit mode.

Shift+F7

Enter or exit view-running mode: If not in view mode (in character or line-edit mode), enter view-running mode. Otherwise, return to normal mode.

Space
Enter

As mentioned below: If there isn’t room to move down respectively a page or a line, exits view mode, after adjusting the pause-limit and enabling auto-pause.

Esc

Exit view mode, returning to character or line-edit mode.

a

Toggling auto-pausing and then Exit view mode.

r

Toggle between running and paused modes.

Ctrl+C

Interrupt output by sending Ctrl+C to the application, and then exit paging mode after scrolling to the end.

Ctrl+F
Ctrl+Shift+F
Cmd+F (only macOS)

Enter find-text mode.

Repeat count

Many of the following keyboard commands can be modified by previously-typed repeat count. This is similar to line-edit mode, but it is optional whether you press the Alt modifier.

Alt+digit
Alt+Minus
Alt+.
digit
Minus
.

Set or extend a repeat count. For example 1 2 Left moves 12 characters left, while Minus 2 Ctrl+Left moves 2 words right (because of the minus).

Commands that are affected by a repeat count contain count in the description. By default the count is one, and it is reset after each command.

Moving the view position

The following commands move the focus position. If the view caret is not active, it is first set to the position of the output cursor.

A mouse click (button-1 with no modifiers) will also move the view position.

All of these clear the selection if there is one. These operations will scroll as needed so the view position remains visible.

Many of the key-binding in view mode are the same as in line-edit mode. However, in line-edit mode most commands move the input caret, but in view mode they move the view position,

Left (backward-char)
Right (forward-char)

Move the view position count characters left or right.

Ctrl+Left (Alt+Left on macOS) (backward-word)
Ctrl+Right (Alt+Right on macOS) (forward-word)

Move the view position count words left or right.

Home (beginning-of-line)
End (end-of-line)

Move the view position to start/end of line.

Alt+Home (beginning-of-buffer)
Alt+End (end-of-buffer)

Move the view position to start/end of the buffer.

Up

Move the view position count lines up.

Down

Move the view position count lines down. If that would extend past the end of the buffer and we are paused, unpause (while keeping view-mode keybindings) until there is enough output.

PageUp

Move the view position count pages (screenfuls) up.

PageDown

Move the view position count pages down. If that would extend past the end of the buffer and we are paused, unpause until there is enough output. (Stay in view-mode, though.)

Space

Move the view position count pages down. If that would extend past the end of the buffer and we are paused, unpause until there is enough output. (Temporarily set automatic-pause mode, so that we pause again if the screen fills up again.) Similar to PgDown, but Space exits view mode and its keybindings.

Enter

Move the view position count lines down. Similar to Space, but only moves the focus position and/or the pause limit count lines rather than count pages. Similar to Down, but Enter exits view mode and its keybindings.

p
%

Move to count percent of the way between start and end positions.

Scrolling

Scrolling moves the visible view without moving the focus position. You can use the general scrolling shortcuts available in all modes, but in paging mode you don’t need to press Shift, and you can use a repeat count.

Ctrl+PageUp (scroll-page-up)
Ctrl+PageDown (scroll-page-down)

Scroll count pages up or down, respectively.

Ctrl+Up (scroll-line-up)
Ctrl+Down (scroll-line-down)

Scroll count lines up or down, respectively.

Ctrl+Home (scroll-top)
Ctrl+End (scroll-bottom)

Scroll to top or bottom, respectively.