Skip to main content
fix typo (obvious)
Source Link
Thomas Dickey
  • 79.2k
  • 9
  • 189
  • 289

In other answers, advice is given for

  • substituting cat for less to avoid whatever unspecified limitations the latter may have,
  • staying in less to keep access to the content which works around the problem,
  • using the -X option of less without mentioning why this addresses the issue, and
  • using putty's option (in the Window dialog) to change the length of the scrollback.

However, on a different dialog (Terminal / Feature), putty allows one to suppress switching to the alternate screen. If those two features are combined, then putty will not switch to to the alternate screen when displaying the file (and on completion and quitting the pager as specified by OP) will not clear the screen, leaving the whole content available for scrolling using putty's built-in handling up page-up/page-down.

The -X option of puttyless does something like that Terminal / Feature option:

       -X or --no-init
              Disables sending the termcap initialization and
              deinitialization strings to the terminal.  This is
              sometimes desirable if the deinitialization string does
              something unnecessary, like clearing the screen.

but does not address putty's limit on the number of lines retained on the window. OP may have chosen (or relied upon) a modified terminal description which omits smcup / rmcup (the terminfo capabilities that less ends up using), but did not mention this. Telling putty to do this resolves the ambiguity.

putty (like most of the terminal programs you would use) implements xterm's alternate screen feature. It is one of the (relatively few) to provide a way to suppress it at runtime: most simply hardcode the behavior as the original xterm did. Because of this prevalence of hardcoding, in a few cases, packagers have modified the terminal description to omit the feature, though preference for the feature appears to be equally split.

In other answers, advice is given for

  • substituting cat for less to avoid whatever unspecified limitations the latter may have,
  • staying in less to keep access to the content which works around the problem,
  • using the -X option of less without mentioning why this addresses the issue, and
  • using putty's option (in the Window dialog) to change the length of the scrollback.

However, on a different dialog (Terminal / Feature), putty allows one to suppress switching to the alternate screen. If those two features are combined, then putty will not switch to to the alternate screen when displaying the file (and on completion and quitting the pager as specified by OP) will not clear the screen, leaving the whole content available for scrolling using putty's built-in handling up page-up/page-down.

The -X option of putty does something like that Terminal / Feature option:

       -X or --no-init
              Disables sending the termcap initialization and
              deinitialization strings to the terminal.  This is
              sometimes desirable if the deinitialization string does
              something unnecessary, like clearing the screen.

but does not address putty's limit on the number of lines retained on the window. OP may have chosen (or relied upon) a modified terminal description which omits smcup / rmcup (the terminfo capabilities that less ends up using), but did not mention this. Telling putty to do this resolves the ambiguity.

putty (like most of the terminal programs you would use) implements xterm's alternate screen feature. It is one of the (relatively few) to provide a way to suppress it at runtime: most simply hardcode the behavior as the original xterm did. Because of this prevalence of hardcoding, in a few cases, packagers have modified the terminal description to omit the feature, though preference for the feature appears to be equally split.

In other answers, advice is given for

  • substituting cat for less to avoid whatever unspecified limitations the latter may have,
  • staying in less to keep access to the content which works around the problem,
  • using the -X option of less without mentioning why this addresses the issue, and
  • using putty's option (in the Window dialog) to change the length of the scrollback.

However, on a different dialog (Terminal / Feature), putty allows one to suppress switching to the alternate screen. If those two features are combined, then putty will not switch to to the alternate screen when displaying the file (and on completion and quitting the pager as specified by OP) will not clear the screen, leaving the whole content available for scrolling using putty's built-in handling up page-up/page-down.

The -X option of less does something like that Terminal / Feature option:

       -X or --no-init
              Disables sending the termcap initialization and
              deinitialization strings to the terminal.  This is
              sometimes desirable if the deinitialization string does
              something unnecessary, like clearing the screen.

but does not address putty's limit on the number of lines retained on the window. OP may have chosen (or relied upon) a modified terminal description which omits smcup / rmcup (the terminfo capabilities that less ends up using), but did not mention this. Telling putty to do this resolves the ambiguity.

putty (like most of the terminal programs you would use) implements xterm's alternate screen feature. It is one of the (relatively few) to provide a way to suppress it at runtime: most simply hardcode the behavior as the original xterm did. Because of this prevalence of hardcoding, in a few cases, packagers have modified the terminal description to omit the feature, though preference for the feature appears to be equally split.

Source Link
Thomas Dickey
  • 79.2k
  • 9
  • 189
  • 289

In other answers, advice is given for

  • substituting cat for less to avoid whatever unspecified limitations the latter may have,
  • staying in less to keep access to the content which works around the problem,
  • using the -X option of less without mentioning why this addresses the issue, and
  • using putty's option (in the Window dialog) to change the length of the scrollback.

However, on a different dialog (Terminal / Feature), putty allows one to suppress switching to the alternate screen. If those two features are combined, then putty will not switch to to the alternate screen when displaying the file (and on completion and quitting the pager as specified by OP) will not clear the screen, leaving the whole content available for scrolling using putty's built-in handling up page-up/page-down.

The -X option of putty does something like that Terminal / Feature option:

       -X or --no-init
              Disables sending the termcap initialization and
              deinitialization strings to the terminal.  This is
              sometimes desirable if the deinitialization string does
              something unnecessary, like clearing the screen.

but does not address putty's limit on the number of lines retained on the window. OP may have chosen (or relied upon) a modified terminal description which omits smcup / rmcup (the terminfo capabilities that less ends up using), but did not mention this. Telling putty to do this resolves the ambiguity.

putty (like most of the terminal programs you would use) implements xterm's alternate screen feature. It is one of the (relatively few) to provide a way to suppress it at runtime: most simply hardcode the behavior as the original xterm did. Because of this prevalence of hardcoding, in a few cases, packagers have modified the terminal description to omit the feature, though preference for the feature appears to be equally split.