[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#436057: less, exit but left content on screen

Tong Sun <mlist4suntong@yahoo.com> writes:
> So having a keyboard command 'x' or something can allows me, 
> I don't know if this is possible.

Less normally allows you to change command-line options from within a
less session (just type "-" followed by the option...).

However, they seem to have intentionally disabled this feature with the
"-X" option.

I think the reason probably is that once you're inside the less session,
it's too late to change -- the "terminal init" command has already been
sent (or not sent), and if a program has sent the "terminal init"
command, technically it _has_ to send the "terminal deinit" command when
it exits, otherwise the terminal will be left in a potentially screwed
up state.

[E.g., at least one 'terminal init" I've seen (in the past -- I don't
know if xterm works this way) moved the display window to the beginning
of the scrollback buffer; "terminal deinit" would then move the display
window back to the end of the scrollback buffer.  If deinit isn't sent,
things would be weird once the terminal starts scrolling again -- not
only would new output overwrite the scrollback buffer from the
beginning, but new lines that appeared at the bottom when the terminal
scrolled would not be blank!]

For this reason, probably a "x" command _is_ impossible (or at least,
would often yield screwy results when you used it).

Occam's razor split hairs so well, I bought the whole argument!

Reply to: