Using pagers like 'less' within screen

View: New views
4 Messages — Rating Filter:   Alert me  

Using pagers like 'less' within screen

by Hugo Heden :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Good day all,

When I close a 'pager' (like 'less', 'vim', 'emacs -nw', 'man bash' etc) I would like its text content within the terminal to *disappear*, and the terminal to show the content it had before the pager was invoked. I guess these programs print to the so called "alternate terminal buffer", and when the program is exited, the terminal goes back to show the default terminal buffer. When not involving GNU-screen, this is the usual behaviour (if the underlying terminal is modern enough and has an "alternate terminal buffer" at all). I hope I am being reasonably right so far..?

But when using GNU-screen a problem appears. Since GNU-screen is already using that "alternate terminal buffer", this desired effect is not achieved: When I close the 'pager' and go back to GNU-screen view, the terminal remains in the "alternate terminal buffer",  so the pagers text content remains visible.

Ok, so I can tell GNU-screen to use the "default terminal buffer" by adding to ~/.screenrc a line like this:

  termcapinfo xterm|xterms|xs|rxvt ti@:te@

But that info seems to extend to the pagers so that they, as well, refuse to use that "alternate terminal buffer".

To summarize: When I close a 'pager' I would like its text content within the terminal to *disappear*, and the terminal to show the content it had before the pager was invoked. How can I resolve this? Is there a way to tell GNU-screen to use the "default terminal buffer" while still letting the programs invoked from within GNU screen use the "alternate terminal buffer"?

$ screen --version
Screen version 4.00.03jw4 (FAU) 2-May-06

Best regards

Hugo Heden


_______________________________________________
screen-users mailing list
screen-users@...
http://lists.gnu.org/mailman/listinfo/screen-users

Re: Using pagers like 'less' within screen

by Benjamin Andresen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey Hugo,

Hugo Heden <hugoheden@...> writes:

> [snip]
> Is there a way to tell GNU-screen to use the "default terminal buffer"
> while still letting the programs invoked from within GNU screen use
> the "alternate terminal buffer"?

altscreen on

should be the only thing you need.

I have just tested this with "Screen version 4.00.03 (FAU) 23-Oct-06"
invoked with screen -c /dev/null

I'm using XTerm(246)

> Best regards
>
> Hugo Heden

HTH,
benny


_______________________________________________
screen-users mailing list
screen-users@...
http://lists.gnu.org/mailman/listinfo/screen-users

Re: Using pagers like 'less' within screen

by Michael Grant-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Sep 5, 2009 at 17:48, Benjamin Andresen<bandresen@...> wrote:

> Hey Hugo,
>
> Hugo Heden <hugoheden@...> writes:
>
>> [snip]
>> Is there a way to tell GNU-screen to use the "default terminal buffer"
>> while still letting the programs invoked from within GNU screen use
>> the "alternate terminal buffer"?
>
> altscreen on
>
> should be the only thing you need.
>
> I have just tested this with "Screen version 4.00.03 (FAU) 23-Oct-06"
> invoked with screen -c /dev/null
>
> I'm using XTerm(246)
>
>> Best regards
>>
>> Hugo Heden
>
> HTH,
> benny
>

If you are using Putty SSH, make sure the check box in the
Terminal->Features panel named "Disable switching to alternate
terminal window" is not checked.


_______________________________________________
screen-users mailing list
screen-users@...
http://lists.gnu.org/mailman/listinfo/screen-users

Re: Using pagers like 'less' within screen

by Hugo Heden :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Sep 5, 2009 at 10:13 PM, Michael Grant <mgrant@...> wrote:
On Sat, Sep 5, 2009 at 17:48, Benjamin Andresen<bandresen@...> wrote:
> Hey Hugo,
>
> Hugo Heden <hugoheden@...> writes:
>
>> [snip]
>> Is there a way to tell GNU-screen to use the "default terminal buffer"
>> while still letting the programs invoked from within GNU screen use
>> the "alternate terminal buffer"?
>
> altscreen on
>
> should be the only thing you need.

That was indeed all I needed. (And it was pretty clear from the man-page as well, I could have search for the word "alternate" for example.)

Thanks a lot, it's appreciated!

Hugo

_______________________________________________
screen-users mailing list
screen-users@...
http://lists.gnu.org/mailman/listinfo/screen-users