Next: , Previous: , Up: Edit and View modes   [Contents]

View mode - Paging and Pausing

Naming issue: Which is better: focus mode, or view mode, or pause mode, or paging mode, or select mode, or read mode, or read-only mode [too long]?

View mode changes makes the buffer read-only and changes keybindings to make it easier to move around and examine it, and make selection. It is similar to using an external pager such as less or the older more.

Keystrokes are optimized for moving around and for making selections. No keystrokes or other events are sent to the application, nor do the they modify the input area. Output from the application is (by default) suspended.

Key-bindings are similar to line-edit mode.

Entering and exiting paging mode

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

Enter or exit paging mode: If not in paging mode (in character or line-edit mode), enter paging 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 paging mode, return to character or line-edit mode.

Esc

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

a

Exit paging mode, toggling auto-paging as discussed below,

The focus and the selection

Moving around in paging mode follows the focus position, which is indicated a focus caret, by default a purple I-beam caret. This is different from the caret used for output, or the caret used for input in line-editing mode. When there is an non-empty selection, the focus position is one end of the selection; the other end is the anchor position.

Pausing

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 focus position

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

These operations will scroll as needed so the focus remains visible.

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

All of these clear the selection if there is one.

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

Move the focus position count characters left or right.

Ctrl-Left (Cmd-Left on Mac) (backward-word)
Ctrl-Right (Cmd-Right on Mac) (forward-word)

Move the focus position count words left or right.

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

Move the focus position to start/end of line.

Ctrl-Home (beginning-of-buffer)
Ctrl-End (end-of-buffer)

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

Up

Move the focus position count lines up.

Down

Move the focus 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 focus position count pages up.

PageDown

Move the focus position count pages up. Move the focus 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 focus position count pages down. Similar to PgDown, but Space exits view mode and its keybindings.

Enter

Move the focus position count lines down. Similar to Down, but Enter exits view mode and its keybindings.

Auto-paging

Modes:

c

Continue - un-pause but stay in paging mode. (Auto-pause off.)

p (with no count)

Pause - stay in paging mode.

Ctrl-Shift-M

Exit paging mode, continue (un-pause) in line or char mode. (Auto-pause off.)

Space

Exit paging mode, continue (un-pause) in line or char mode. Auto-pause is on, with a pause limit count pages down. Set pause-limit to focus point plus count * (availHeight - charHeight). or existing buffer end, whichever is more. (If there is no waiting output, continue until there is some, even if avove buffer limit ?)

Return

Similar but pauselimit increased by count * charHeight.

PageDown
Down

Similar to Space/Return, but staying in view mode, but non-paused.

C

(Is this useful: Continue with infinite pauselimit, but go back to auto-pausing after next keyboard input.)

OLDER

DomTerm includes a builtin “pager” that gives you functionality similar to programs like less. You can set “auto-pause” which enters the pager each time a full screen has been displayed.

We will discuss two related modes. Pager mode does the following:

  1. The key-bindings are changed to be more like the less program or Emacs “view mode”.
  2. Automatically scrolling (on output) is turned off.

Pause mode additionally does the following:

  1. Suspends additional output from updating the display. Any not-yet-displayed output is queued up, and the sending (client process) will suspend too.

You enter pause mode in two basic ways

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

To enter pager mode, you first have to enter pause mode, and then type P.

The following key-bindings are in effect in pager or paused mode. Some other these may be prefixed by a numeric count.

a

Toggle automatic-pause mode on and off, and then exit pager mode.

p
%

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

Ctrl-C

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

m

Toggle between pager and paused modes.

Ctrl-Shift-M

Return to normal mode. If paused, allow further output.

Space

Scroll count screenfuls down. If we go past the bottom of the current output, leave pause or pager mode, and allow further output. Temporarily set automatic-pause mode, so that we pause again if the screen fills up again.

((Calculate new-limit as top of (focus-)caret plus window height. If new-limit less-or-equal to bottom of buffer, move focus-caret to end-of-line containing new-limit - and scroll. Otherwise scroll (new-limit bottom of window), set pause-limit to new-limit, and un-pause.)) ((Either way, old top of focus-caret is scrolled to top of window.))

Enter

Scroll count lines down. Otherwise similar to Space.

PageUp
PageDown

Scroll count screenfuls up/down.

Home

OLD: Scroll to the current “pager home”. (Details needed ...)

End

OLD: Scroll the end of the buffer. If paused and already at the end, un-pause. I.e. continue displaying output until the next action.

Ctrl-F
Ctrl-Shift-F

Enter find-text mode.

(FUTURE?) Focus mode [modified pause mode]

Focus mode changes some keybindings to make moving around and selecting in the buffer more convenient, while also defering updates in buffer. It is indicated (by default) using narrow purple vertical I-bar that marks the focus position. This is separate from the caret where program output inserted. 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.

Scrolling without moving the focus [MISLEADING]

You can use the general scrolling shortcuts available in all modes, but in paging mode (as in line-edit 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, without moving focus.

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

Scroll count pages up or down, respectively, moving focus.

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

Scroll count lines up or down, respectively.

Alt-Shift-Home (scroll-top)
Alt-Shift-End (scroll-bottom)

Scroll to top or bottom, respectively, without moving focus

Ctrl-Home
Ctrl-End

(scroll-bottom) Scroll to top or bottom, respectively.

Continuing output

Focus and selection

The focus caret is a visible indicator of a highlighted position in the buffer, by default shown as a narrow purple vertical I-bar. Various keystroke combinations and mouse clicks are used to move the focus, which allows convenient navigation in the buffer, because the buffer is scrolled to make the focus always visible. When the selection is active, one endpoint is the focus position. The other the anchor position (also known as the “mark”, for those familiar with Emacs).

Moving the focus

The following commands all move the focus, in either line-edit or paging modes. If the focus is not active, it is first set to the position of the output cursor. If there is non-empty selection, it is first collapsed to the focus end.

Notes (TO-DO)

Available key-bindings:

Alt-Shift-PageUp/-PageDown/-Up/-Down/-Home/-End
   Scroll only, as in regular mode, without moving focus, selection, etc.
PageUp/PageDown Move focus *and* scroll.
  For PageDown, maybe unpause (but stay in View auto-pause mode).
Shift-PageUp/PageDown Extend selection *and* scroll.  (Do not unpause.)
Space  Remove focus, unpause, leave View mode, but still auto-pause.
'c' Remove focus, unpause, leave View mode, but turn of auto-pause.
Home/End (start/end line)
Shift-Home/-End Extend to start/end of line
(xterm and others bind Shift-PageUp/-PageDown/-Down/-Up
  to scroll but that would conflict with Line/View modes)
In line-edit mode: Ctrl-Home/End (start/end of input)
Ctrl-Home/-End Move focus to top/bottom, scroll as needed
Shift-Ctrl-Home/End Extend to top/bottom 
Ctrl-PageUp/PageDown (same as plain PageUp/PageDown? or C-S-/Pu/PDn?)
Ctrl-Up/Down (same as plain Up/Down? or C-S)

Needed actions:

Move caret one page (with scrolling)  (Alt-PageUp/PageDown)
Extend one page (with scrolling) (Shift-Alt-PageUp/PageDown )

Arrow keys (unshifted) in paging/view mode collapses selection and moves selection focus (and anchor - i.e collapsed) as indicated. (If no selection, use caret as initial focus.)

In char mode, shifted movement (Shift-Up, Ctrl-Shift-Right, etc) is encoded and sent to process. (Should probably clear selection if any - try on Emacs.) Shifted mouse-click-1 extends selection, unless mouse handling is enabled. In line and paging modes, shifted movement (Shift-Up, Ctrl-Shift-Right, etc) extends selection. So does shifted mouse-click-1.

If paused, if moving past end, continue. (Details?)


Next: , Previous: , Up: Edit and View modes   [Contents]