Debian Bug report logs - #436057
less, exit but left content on screen

version graph

Package: less; Maintainer for less is Anibal Monsalve Salazar <anibal@debian.org>; Source for less is src:less (PTS, buildd, popcon).

Reported by: Tong Sun <mlist4suntong@yahoo.com>

Date: Sun, 5 Aug 2007 01:09:01 UTC

Severity: wishlist

Found in version less/394-4

Done: Aníbal Monsalve Salazar <anibal@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, suntong001@yahoo.com, Anibal Monsalve Salazar <anibal@debian.org>:
Bug#436057; Package less. (full text, mbox, link).


Acknowledgement sent to Tong Sun <mlist4suntong@yahoo.com>:
New Bug report received and forwarded. Copy sent to suntong001@yahoo.com, Anibal Monsalve Salazar <anibal@debian.org>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Tong Sun <mlist4suntong@yahoo.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Cc: debian-user@lists.debian.org, markn@greenwoodsoftware.com
Subject: less, exit but left content on screen
Date: Sat, 4 Aug 2007 21:06:19 -0400
Package: less
Version: 394-4
Severity: wishlist

I remember that I used to be able to exit 'less' by command key 'x' or
something so that the content just viewed is left on screen, instead of
being cleared and restored to the screen before invoking 'less'. But I
found there is no such capability in current less (version 394). Or
is there? 

I am not sure whether my memory is correct or not, but I think such
capability, leaving the just viewed content on screen, is desirable in
certain circumstances. I hope such capability be implemented/put back
into less. 

Thanks 

Tong

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (300, 'stable'), (50, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17-grml
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages less depends on:
ii  debianutils                 2.17         Miscellaneous utilities specific t
ii  libc6                       2.3.6.ds1-13 GNU C Library: Shared libraries
ii  libncurses5                 5.5-5        Shared libraries for terminal hand

less recommends no packages.

-- no debconf information



Information forwarded to debian-bugs-dist@lists.debian.org, Anibal Monsalve Salazar <anibal@debian.org>:
Bug#436057; Package less. (full text, mbox, link).


Acknowledgement sent to Tong Sun <mlist4suntong@yahoo.com>:
Extra info received and forwarded to list. Copy sent to Anibal Monsalve Salazar <anibal@debian.org>. (full text, mbox, link).


Message #10 received at 436057@bugs.debian.org (full text, mbox, reply):

From: Tong Sun <mlist4suntong@yahoo.com>
To: debian-user@lists.debian.org
Cc: 436057@bugs.debian.org
Subject: Re: less, exit but left content on screen
Date: Sun, 5 Aug 2007 13:25:12 -0400
On Sun, 05 Aug 2007 01:55:13 +0000, Andy Smith wrote:

> On Sat, Aug 04, 2007 at 09:06:19PM -0400, Tong Sun wrote:
>> I remember that I used to be able to exit 'less' by command key 'x' or
>> something so that the content just viewed is left on screen, instead of
>> being cleared and restored to the screen before invoking 'less'. But I
>> found there is no such capability in current less (version 394). Or
>> is there? 
> 
> Can't you just call "less -X" or set the environment variable LESS
> to contain "-X"?

Thanks for all replies. On reviewing them and the faq, I think my wish
still holds. 

Just like John Hasler has pointed out, the -X disables termcap
initialization and deinitialization. The effect is that, when I
browse say a big file, paging up and down several times, and then
exit, my xterm will be left with all contents that I've browsed,
with " ...skipping... " in between them.

So having a keyboard command 'x' or something can allows me, 

- have the freedom to decide whether I want to leave the content or not

- invoke less the same way, no matter whether I want to leave the
  content or not

- leave my xterm with the only pageful of info that I deliberately
  chosen, instead of cluttering it with all the contents that I've
  viewed. 

I don't know if this is possible. But it's a nice feature. It comes
especially handy when you want to preserve your xterm scroll-back
history as much as possible, but still able to copy the content out
of the man page, which might be lengthy and might took a while for
your to locate where you want to copy from.

Thanks

-- 
Tong (remove underscore(s) to reply)
  http://xpt.sourceforge.net/techdocs/
  http://xpt.sourceforge.net/tools/




Information forwarded to debian-bugs-dist@lists.debian.org, Anibal Monsalve Salazar <anibal@debian.org>:
Bug#436057; Package less. (full text, mbox, link).


Acknowledgement sent to Miles Bader <miles@gnu.org>:
Extra info received and forwarded to list. Copy sent to Anibal Monsalve Salazar <anibal@debian.org>. (full text, mbox, link).


Message #15 received at 436057@bugs.debian.org (full text, mbox, reply):

From: Miles Bader <miles@gnu.org>
To: Tong Sun <mlist4suntong@yahoo.com>
Cc: debian-user@lists.debian.org, 436057@bugs.debian.org
Subject: Re: Bug#436057: less, exit but left content on screen
Date: Mon, 06 Aug 2007 09:42:52 +0900
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).

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



Information forwarded to debian-bugs-dist@lists.debian.org, Anibal Monsalve Salazar <anibal@debian.org>:
Bug#436057; Package less. (full text, mbox, link).


Acknowledgement sent to bob@proulx.com (Bob Proulx):
Extra info received and forwarded to list. Copy sent to Anibal Monsalve Salazar <anibal@debian.org>. (full text, mbox, link).


Message #20 received at 436057@bugs.debian.org (full text, mbox, reply):

From: bob@proulx.com (Bob Proulx)
To: debian-user@lists.debian.org
Cc: 436057@bugs.debian.org, Tong Sun <mlist4suntong@yahoo.com>, markn@greenwoodsoftware.com
Subject: Re: less, exit but left content on screen
Date: Sat, 11 Aug 2007 14:36:27 -0600
Tong Sun wrote:
> I remember that I used to be able to exit 'less' by command key 'x' or
> something so that the content just viewed is left on screen, instead of
> being cleared and restored to the screen before invoking 'less'. But I
> found there is no such capability in current less (version 394). Or
> is there? 

The issue is whether the terminal uses an alternate screen buffer or
not.  If the terminal does not then your screen contents always
remain.  If so then they still remain, just in the alternate screen
buffer.

Using the standard xterm the control-middle mouse button will display
many options of which one is "Show Alternate Screen".  It is possible
to flip back and forth (inconveniently) to see this manually switch to
the alternate screen buffer.

> I am not sure whether my memory is correct or not, but I think such
> capability, leaving the just viewed content on screen, is desirable in
> certain circumstances. I hope such capability be implemented/put back
> into less. 

What you are seeing is not a change to less but a change to your
environment.  Less and other screen utilities such as emacs and vi
have always done this if the capability is available.  Previously you
were probably using a terminal that did not support an alternate
screen buffer.  Since now you are you are seeing the screen buffer
switching behavior.

You can disable this feature of the terminal by using the *titeInhibit
X resource.

One time command line option test invocation:

  xterm -xrm "*titeInhibit:true"

Then if that works then you can add that setting to your X environment
resources.  Typically it is placed in the ~/.Xresources file which is
normally loaded by your X session manager upon starup.  You can also
load this interactively with the following command.

  echo "*titeInhibit:true" | xrdb -merge

Note that setting *titeInhibit to true is not the same as running
'less -X'.  Using 'less -X' stops less from running all terminal
initialization.  Setting titeInhibit stops the terminal from
supporting an alternate screen buffer.

Also, a small suggestion.  Please read this following about how to
submit bug reports and to also send a copy to another addresses.  Look
for "Sending copies of bug reports to other addresses" which addresses
how to do this such that followups will have the correct bug report
address automatically available for people to followup.

  http://www.debian.org/Bugs/Reporting

But personally I am not sure how beneficial it is to CC debian-user on
these things.  I think I would recommend against doing so in the future.

Bob



Reply sent to Aníbal Monsalve Salazar <anibal@debian.org>:
You have taken responsibility. (full text, mbox, link).


Notification sent to Tong Sun <mlist4suntong@yahoo.com>:
Bug acknowledged by developer. (full text, mbox, link).


Message #25 received at 436057-done@bugs.debian.org (full text, mbox, reply):

From: Aníbal Monsalve Salazar <anibal@debian.org>
To: 436057-done@bugs.debian.org
Subject: Re: Bug#436057: less, exit but left content on screen
Date: Sun, 12 Aug 2007 09:32:56 +1000
[Message part 1 (text/plain, inline)]
Version: 394-4

On Sat, Aug 11, 2007 at 02:36:27PM -0600, Bob Proulx wrote:
>Tong Sun wrote:
>>I remember that I used to be able to exit 'less' by command key 'x' or
>>something so that the content just viewed is left on screen, instead of
>>being cleared and restored to the screen before invoking 'less'. But I
>>found there is no such capability in current less (version 394). Or
>>is there? 
>
>The issue is whether the terminal uses an alternate screen buffer or
>not.  If the terminal does not then your screen contents always
>remain.  If so then they still remain, just in the alternate screen
>buffer.
>
>Using the standard xterm the control-middle mouse button will display
>many options of which one is "Show Alternate Screen".  It is possible
>to flip back and forth (inconveniently) to see this manually switch to
>the alternate screen buffer.
>
>>I am not sure whether my memory is correct or not, but I think such
>>capability, leaving the just viewed content on screen, is desirable in
>>certain circumstances. I hope such capability be implemented/put back
>>into less. 
>
>What you are seeing is not a change to less but a change to your
>environment.  Less and other screen utilities such as emacs and vi
>have always done this if the capability is available.  Previously you
>were probably using a terminal that did not support an alternate
>screen buffer.  Since now you are you are seeing the screen buffer
>switching behavior.
>
>You can disable this feature of the terminal by using the *titeInhibit
>X resource.
>
>One time command line option test invocation:
>
>  xterm -xrm "*titeInhibit:true"
>
>Then if that works then you can add that setting to your X environment
>resources.  Typically it is placed in the ~/.Xresources file which is
>normally loaded by your X session manager upon starup.  You can also
>load this interactively with the following command.
>
>  echo "*titeInhibit:true" | xrdb -merge
>
>Note that setting *titeInhibit to true is not the same as running
>'less -X'.  Using 'less -X' stops less from running all terminal
>initialization.  Setting titeInhibit stops the terminal from
>supporting an alternate screen buffer.
>
>Also, a small suggestion.  Please read this following about how to
>submit bug reports and to also send a copy to another addresses.  Look
>for "Sending copies of bug reports to other addresses" which addresses
>how to do this such that followups will have the correct bug report
>address automatically available for people to followup.
>
>  http://www.debian.org/Bugs/Reporting
>
>But personally I am not sure how beneficial it is to CC debian-user on
>these things.  I think I would recommend against doing so in the future.

Thank you Bob Proulx for the response.

I'm closing this bug report.

>Bob

Aníbal Monsalve Salazar
-- 
http://v7w.com/anibal
[signature.asc (application/pgp-signature, inline)]

No longer marked as fixed in versions 394-4. Request was from Andreas Beckmann <anbe@debian.org> to control@bugs.debian.org. (Sat, 02 Nov 2013 15:57:47 GMT) (full text, mbox, link).


Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 01 Dec 2013 07:37:48 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Oct 11 23:41:05 2017; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.