CLI output pager

Buffers output from CLI commands as it arrives and allows the terminal to
view this buffer one page at a time.

- View of the buffer is moved with space/enter/up/down/page-up/page-down/
  home/end.
- At the end of the CLI command if less than one page of output was
  generated then the pager is not engaged.
- 'q' to quit the pager, or scroll off the bottom.
- Pager prompt displays the current view aperture line numbers and total
  number of lines buffered.
- Can be disabled at runtime with "no-cli-pager" in the unix configuration.
- The number of lines that will be stored in the buffer is limited to
  prevent excessive memory use; this limit is configurable with
  "cli-pager-buffer-limit" in the unix configuration.
- Both these options can also be set in the console with "set terminal
  pager [on|off] [limit <lines>]".

Limitations:
- Does not yet implement a search function.
- Whilst the terminal size is detected and tracked, changing the terminal
  size when the pager is being used will not cause a redraw of the page.
- Lines that wrap the right most column are not yet handled gracefully.

Change-Id: I69548c1464eff79c53e122668f25758266daf1c2
Signed-off-by: Chris Luke <chrisy@flirble.org>
3 files changed