FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 01-22-2011, 04:45 AM
"Walter Dnes"
 
Default How can I turn off xterm console restore?

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>
 
Old 01-22-2011, 01:13 PM
Mick
 
Default How can I turn off xterm console restore?

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
 
Old 01-22-2011, 06:11 PM
 
Default How can I turn off xterm console restore?

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
 
Old 01-22-2011, 09:08 PM
Paul Colquhoun
 
Default How can I turn off xterm console restore?

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.
 
Old 01-24-2011, 07:56 PM
Bill Longman
 
Default How can I turn off xterm console restore?

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
 
Old 01-24-2011, 09:37 PM
Mick
 
Default How can I turn off xterm console restore?

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
 
Old 01-26-2011, 01:55 AM
"Walter Dnes"
 
Default How can I turn off xterm console restore?

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>
 
Old 01-26-2011, 02:05 AM
"Walter Dnes"
 
Default How can I turn off xterm console restore?

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>
 

Thread Tools




All times are GMT. The time now is 06:43 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org