public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] How can I turn off xterm console restore?
@ 2011-01-22  5:45 Walter Dnes
  2011-01-22 14:13 ` Mick
  2011-01-24 20:56 ` [gentoo-user] " Bill Longman
  0 siblings, 2 replies; 8+ messages in thread
From: Walter Dnes @ 2011-01-22  5:45 UTC (permalink / raw
  To: Gentoo Users List

  As soon as some textmode applications in xterm stop, their output gets
wiped, and the xterm screen is restored to what it looked like before I
launched the app.  Somebody thought they were being "helpful"; then
again, so did the designers of "Clippy".  I don't know how many updates
ago the behaviour changed, but here's what happens...

  Let's say I'm having a problem with packet loss to/from a certain
internet server.  I would run "mtr" which gives an ongoing enhanced
traceroute display.  When it gets to the router that's dropping packets
I would hit "Q" and mtr quits.

Before the update
=================
  I would copy/paste the mtr output into an email, and send it off to
whomever, with the output showing the packet-loss stats.

After the update
================
  As soon as mtr quits, its output gets wiped, and the xterm screen is
restored to the state it was in before mtr was launched... helpful NOT!

  I've discovered that I can suspend it with {CTRL-S}, but I shouldn't
have to resort to that.  Using Google, I found references to
"man termcap", which stated that this behaviour was controlled by
entries in /etc/termcap.  Despite the fact that I have the termcap man
page on my system, I do *NOT* have /etc/termcap.  Does anyone have a
sample /etc/termcap (or will ~/.termcap work?) to stop the screen
restore after a text application quits?

-- 
Walter Dnes <waltdnes@waltdnes.org>



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] How can I turn off xterm console restore?
  2011-01-22  5:45 [gentoo-user] How can I turn off xterm console restore? Walter Dnes
@ 2011-01-22 14:13 ` Mick
  2011-01-22 19:11   ` [gentoo-user] " Nuno J. Silva
  2011-01-24 20:56 ` [gentoo-user] " Bill Longman
  1 sibling, 1 reply; 8+ messages in thread
From: Mick @ 2011-01-22 14:13 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: Text/Plain, Size: 2432 bytes --]

On Saturday 22 January 2011 05:45:27 Walter Dnes wrote:
>   As soon as some textmode applications in xterm stop, their output gets
> wiped, and the xterm screen is restored to what it looked like before I
> launched the app.  Somebody thought they were being "helpful"; then
> again, so did the designers of "Clippy".  I don't know how many updates
> ago the behaviour changed, but here's what happens...

Hmm ... as far as I can recall with xterm/aterm this behaviour for some 
commands is the expected/default behaviour.  I've looked into it for things 
like top et al when launched like so on the desktop from e.g. fluxbox's menu:

  aterm +sb -e top -d 2

Pressing q to quit top closes the aterm.  Completely.  :-(

I have not found a solution for it.

With xterm I would use the -hold option to stop xterm from collapsing like so:

  xterm -geometry 144x30 -bg black -fg green -hold -e 'ps auxf'

Thereafter I use the window decoration to close xterm, because no other 
keyboard inputs are accepted by it.


>   Let's say I'm having a problem with packet loss to/from a certain
> internet server.  I would run "mtr" which gives an ongoing enhanced
> traceroute display.  When it gets to the router that's dropping packets
> I would hit "Q" and mtr quits.

That's how it always worked here.


> Before the update
> =================
>   I would copy/paste the mtr output into an email, and send it off to
> whomever, with the output showing the packet-loss stats.

Are you sure you were not previously using the -r option to report the output 
on the screen and now you don't?


> After the update
> ================
>   As soon as mtr quits, its output gets wiped, and the xterm screen is
> restored to the state it was in before mtr was launched... helpful NOT!

try this:

  mtr -c 3 -r 123.456.78.90

>   I've discovered that I can suspend it with {CTRL-S}, but I shouldn't
> have to resort to that.  Using Google, I found references to
> "man termcap", which stated that this behaviour was controlled by
> entries in /etc/termcap.  Despite the fact that I have the termcap man
> page on my system, I do *NOT* have /etc/termcap.  Does anyone have a
> sample /etc/termcap (or will ~/.termcap work?) to stop the screen
> restore after a text application quits?

I don't have /etc/termcap here ... and wouldn't know how to use it to be 
honest.
-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [gentoo-user] Re: How can I turn off xterm console restore?
  2011-01-22 14:13 ` Mick
@ 2011-01-22 19:11   ` Nuno J. Silva
  2011-01-22 22:08     ` Paul Colquhoun
  0 siblings, 1 reply; 8+ messages in thread
From: Nuno J. Silva @ 2011-01-22 19:11 UTC (permalink / raw
  To: gentoo-user

Mick <michaelkintzios@gmail.com> writes:

> On Saturday 22 January 2011 05:45:27 Walter Dnes wrote:
>>   As soon as some textmode applications in xterm stop, their output gets
>> wiped, and the xterm screen is restored to what it looked like before I
>> launched the app.  Somebody thought they were being "helpful"; then
>> again, so did the designers of "Clippy".  I don't know how many updates
>> ago the behaviour changed, but here's what happens...
>
> Hmm ... as far as I can recall with xterm/aterm this behaviour for some 
> commands is the expected/default behaviour.  I've looked into it for things 
> like top et al when launched like so on the desktop from e.g. fluxbox's menu:
>
>   aterm +sb -e top -d 2
>
> Pressing q to quit top closes the aterm.  Completely.  :-(
>
> I have not found a solution for it.
>
> With xterm I would use the -hold option to stop xterm from collapsing like so:
>
>   xterm -geometry 144x30 -bg black -fg green -hold -e 'ps auxf'
>
> Thereafter I use the window decoration to close xterm, because no other 
> keyboard inputs are accepted by it.

I think the OP is talking about how some programs (ncurses-based and the
like?) such as less output to a separate "layer" which is hidden when
they terminate, instead of writing to the same "layer" where the shell
lives (what would make the last output still visible when they end and
control goes back to the shell.

But I have no idea how to change it - I know it works differently in
some terminals, but I never tried to figure out how and why.

-- 
Nuno J. Silva
gopher://sdf-eu.org/1/users/njsg




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] Re: How can I turn off xterm console restore?
  2011-01-22 19:11   ` [gentoo-user] " Nuno J. Silva
@ 2011-01-22 22:08     ` Paul Colquhoun
  0 siblings, 0 replies; 8+ messages in thread
From: Paul Colquhoun @ 2011-01-22 22:08 UTC (permalink / raw
  To: gentoo-user

On Sun, 23 Jan 2011 06:11:03 Nuno J. Silva wrote:
> Mick <michaelkintzios@gmail.com> writes:
> > On Saturday 22 January 2011 05:45:27 Walter Dnes wrote:
> >>   As soon as some textmode applications in xterm stop, their output gets
> >> 
> >> wiped, and the xterm screen is restored to what it looked like before I
> >> launched the app.  Somebody thought they were being "helpful"; then
> >> again, so did the designers of "Clippy".  I don't know how many updates
> >> ago the behaviour changed, but here's what happens...
> > 
> > Hmm ... as far as I can recall with xterm/aterm this behaviour for some
> > commands is the expected/default behaviour.  I've looked into it for
> > things
> > 
> > like top et al when launched like so on the desktop from e.g. fluxbox's 
menu:
> >   aterm +sb -e top -d 2
> > 
> > Pressing q to quit top closes the aterm.  Completely.  :-(
> > 
> > I have not found a solution for it.
> > 
> > With xterm I would use the -hold option to stop xterm from collapsing like 
so:
> >   xterm -geometry 144x30 -bg black -fg green -hold -e 'ps auxf'
> > 
> > Thereafter I use the window decoration to close xterm, because no other
> > keyboard inputs are accepted by it.
> 
> I think the OP is talking about how some programs (ncurses-based and the
> like?) such as less output to a separate "layer" which is hidden when
> they terminate, instead of writing to the same "layer" where the shell
> lives (what would make the last output still visible when they end and
> control goes back to the shell.
> 
> But I have no idea how to change it - I know it works differently in
> some terminals, but I never tried to figure out how and why.


I know what the OP is after, and I remember doing it some time ago. A bit of 
hunting in my .bashrc & .bash_profile files shows this:

LESS="-R -X"
PAGER=/usr/bin/less

The "-X" is the important option, as it stops 'less' doing the terminal setup 
required for the oputput hiding.

It seems that the affected programs all check the 'PAGER' environment variable 
and run their output through 'less'.

Try just setting the 'LESS' environment variable from the command line and see 
it that helps. If it does, add it to .bashrc or .bash_profile to make it 
permanent.


-- 
Reverend Paul Colquhoun, ULC.    http://andor.dropbear.id.au/~paulcol
 Before you criticize someone, you should walk a mile in their shoes.
Then, when you do, you'll be a mile away, and you'll have their shoes.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] How can I turn off xterm console restore?
  2011-01-22  5:45 [gentoo-user] How can I turn off xterm console restore? Walter Dnes
  2011-01-22 14:13 ` Mick
@ 2011-01-24 20:56 ` Bill Longman
  2011-01-24 22:37   ` Mick
  2011-01-26  2:55   ` Walter Dnes
  1 sibling, 2 replies; 8+ messages in thread
From: Bill Longman @ 2011-01-24 20:56 UTC (permalink / raw
  To: gentoo-user

On 01/21/2011 09:45 PM, Walter Dnes wrote:
>   As soon as some textmode applications in xterm stop, their output gets
> wiped, and the xterm screen is restored to what it looked like before I
> launched the app.  Somebody thought they were being "helpful"; then
> again, so did the designers of "Clippy".  I don't know how many updates
> ago the behaviour changed, but here's what happens...
> 
>   Let's say I'm having a problem with packet loss to/from a certain
> internet server.  I would run "mtr" which gives an ongoing enhanced
> traceroute display.  When it gets to the router that's dropping packets
> I would hit "Q" and mtr quits.
> 
> Before the update
> =================
>   I would copy/paste the mtr output into an email, and send it off to
> whomever, with the output showing the packet-loss stats.
> 
> After the update
> ================
>   As soon as mtr quits, its output gets wiped, and the xterm screen is
> restored to the state it was in before mtr was launched... helpful NOT!
> 
>   I've discovered that I can suspend it with {CTRL-S}, but I shouldn't
> have to resort to that.  Using Google, I found references to
> "man termcap", which stated that this behaviour was controlled by
> entries in /etc/termcap.  Despite the fact that I have the termcap man
> page on my system, I do *NOT* have /etc/termcap.  Does anyone have a
> sample /etc/termcap (or will ~/.termcap work?) to stop the screen
> restore after a text application quits?
> 

Walter,

You can always call it back up. The other window, that is. Just
Ctrl-middle-click the xterm and choose "Show alternate screen".

Presto.

It's saved my bacon more than once....

Bill



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] How can I turn off xterm console restore?
  2011-01-24 20:56 ` [gentoo-user] " Bill Longman
@ 2011-01-24 22:37   ` Mick
  2011-01-26  3:05     ` Walter Dnes
  2011-01-26  2:55   ` Walter Dnes
  1 sibling, 1 reply; 8+ messages in thread
From: Mick @ 2011-01-24 22:37 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: Text/Plain, Size: 522 bytes --]

On Monday 24 January 2011 20:56:02 Bill Longman wrote:

> You can always call it back up. The other window, that is. Just
> Ctrl-middle-click the xterm and choose "Show alternate screen".
> 
> Presto.
> 
> It's saved my bacon more than once....
> 
> Bill

Yes!  I had forgotten about that! Thanks Bill.  :-)

Excellent solution for the OP's question, but what can you do to stop the 
terminal collapsing completely, when it is launched to just run a command that 
exits after it runs?
-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] How can I turn off xterm console restore?
  2011-01-24 20:56 ` [gentoo-user] " Bill Longman
  2011-01-24 22:37   ` Mick
@ 2011-01-26  2:55   ` Walter Dnes
  1 sibling, 0 replies; 8+ messages in thread
From: Walter Dnes @ 2011-01-26  2:55 UTC (permalink / raw
  To: gentoo-user

On Mon, Jan 24, 2011 at 12:56:02PM -0800, Bill Longman wrote

> You can always call it back up. The other window, that is. Just
> Ctrl-middle-click the xterm and choose "Show alternate screen".
> 
> Presto.
> 
> It's saved my bacon more than once....

  Yes that works.  There's an even better option listed when I middle-
click.  The option "Enable Alternate Screen Switching" is checked by
default on my system.  Unchecking it disables alternate screen
switching, which does what I was asking for.  Thanks for pointing me in
the right direction.

  The ultimate solution is to make this a default.  Once I realized this
was an xterm setting, I plowed through "man xterm" and discovered...

> titeInhibit (class TiteInhibit)
>     Specifies whether or not xterm should remove ti and te termcap
>     entries (used to switch between alternate screens on startup of
>     many screen-oriented programs) from  the  TERMCAP string.   If
>     set,  xterm  also  ignores the escape sequence to switch to the
>     alternate screen.

  A Google search found
http://www.linux.org/docs/ldp/howto/XWindow-User-HOWTO/moreconfig.html
which includes the ~/.Xdefaults incantation...

 ! Do not clear the screen after the program exits
 XTerm*VT100*titeInhibit: true


-- 
Walter Dnes <waltdnes@waltdnes.org>



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] How can I turn off xterm console restore?
  2011-01-24 22:37   ` Mick
@ 2011-01-26  3:05     ` Walter Dnes
  0 siblings, 0 replies; 8+ messages in thread
From: Walter Dnes @ 2011-01-26  3:05 UTC (permalink / raw
  To: gentoo-user

On Mon, Jan 24, 2011 at 10:37:41PM +0000, Mick wrote

> Excellent solution for the OP's question, but what can you do to stop
> the terminal collapsing completely, when it is launched to just run
> a command that exits after it runs?

  Once I realized that my problem was an xterm option, not a system
setting, I plowed through "man xterm".  You can include "-hold" on the
xterm command line, or use the "hold" xresource option to do freeze
rather than destroy the terminal on exit.

-- 
Walter Dnes <waltdnes@waltdnes.org>



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-01-26  3:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-22  5:45 [gentoo-user] How can I turn off xterm console restore? Walter Dnes
2011-01-22 14:13 ` Mick
2011-01-22 19:11   ` [gentoo-user] " Nuno J. Silva
2011-01-22 22:08     ` Paul Colquhoun
2011-01-24 20:56 ` [gentoo-user] " Bill Longman
2011-01-24 22:37   ` Mick
2011-01-26  3:05     ` Walter Dnes
2011-01-26  2:55   ` Walter Dnes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox