Subject: please allow for specifying more than one terminal type
Date: Sun, 19 Mar 2006 12:45:08 +0100
Package: ncurses
Severity: wishlist
Hi,
I'm currently using rxvt-unicode as my primary x-terminal-emulator, as
it has exactly those features I need, and nothing more. I love it,
except for one thing... it's rather new(ish), and many hosts do not have
a termcap entry for it yet. As a result, ncurses fails to initialize in
most cases--and those programs that do work do so by assuming I have
vt100 or something, which is horrible.
It'd be nice if I could say something along the lines of "I'm really
working from rxvt-unicode; but if you don't know that, then you can use
a generic xterm termcap entry, which for all practical matters is really
the same thing". Something like
TERM=rxvt-unicode:xterm
would be great. I didn't see whether something like that is available by
looking at the docs that I found, but perhaps I missed it; in that case,
a pointer would be nice ;-)
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing')
Architecture: powerpc (ppc)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15.6
Locale: LANG=nl_BE.UTF-8@euro, LC_CTYPE=nl_BE.UTF-8@euro (charmap=UTF-8)
Subject: Re: Bug#357742: please allow for specifying more than one terminal type
Date: Sun, 19 Mar 2006 11:33:22 -0500
On Sun, Mar 19, 2006 at 08:49:20AM -0500, Thomas E. Dickey wrote:
> On Sun, 19 Mar 2006, Wouter Verhelst wrote:
>
> >Package: ncurses
> >Severity: wishlist
>
> This is a bug in rxvt-unicode rather than ncurses.
Huh? How?
1. Open rxvt-unicode on host A. This host has rxvt-unicode
installed, and presumably has a termcap entry for it.
2. SSH to host B. This older host does not.
Wouter wants host B to see a value in $TERM that can fall back to
xterm, if I understand right.
Obviously this wouldn't be helpful for years...
--
Daniel Jacobowitz
CodeSourcery
Subject: Re: Bug#357742: please allow for specifying more than one terminal
type
Date: Sun, 19 Mar 2006 11:52:13 -0500 (EST)
On Sun, 19 Mar 2006, Daniel Jacobowitz wrote:
> On Sun, Mar 19, 2006 at 08:49:20AM -0500, Thomas E. Dickey wrote:
>> On Sun, 19 Mar 2006, Wouter Verhelst wrote:
>>
>>> Package: ncurses
>>> Severity: wishlist
>>
>> This is a bug in rxvt-unicode rather than ncurses.
>
> Huh? How?
>
> 1. Open rxvt-unicode on host A. This host has rxvt-unicode
> installed, and presumably has a termcap entry for it.
> 2. SSH to host B. This older host does not.
For this case, we can't solve his problem (simply because differences in
function keys, etc., mean there is in general no well-defined subset to
fall back to).
For the usual case (fallback to existing values) it's certainly doable
since xterm does _that_.
> Wouter wants host B to see a value in $TERM that can fall back to
> xterm, if I understand right.
>
> Obviously this wouldn't be helpful for years...
--
Thomas E. Dickey
http://invisible-island.netftp://invisible-island.net
Subject: Re: Bug#357742: please allow for specifying more than one terminal type
Date: Sun, 19 Mar 2006 12:07:04 -0500
On Sun, Mar 19, 2006 at 11:52:13AM -0500, Thomas E. Dickey wrote:
> For this case, we can't solve his problem (simply because differences in
> function keys, etc., mean there is in general no well-defined subset to
> fall back to).
>
> For the usual case (fallback to existing values) it's certainly doable
> since xterm does _that_.
Sorry, you've totally lost me.
This is about the TERM value set by the terminal emulator, for maximum
compatibility across multiple hosts, including hosts other than the one
on which it is running. How can rxvt-unicode - or xterm - do anything
about that?
I'd love to be able to set "TERMLIST=screen;vt100" and have some smart
curses library go "I don't know what screen is, but here, have a
vt100".
--
Daniel Jacobowitz
CodeSourcery
Subject: Re: Bug#357742: please allow for specifying more than one terminal type
Date: Sun, 19 Mar 2006 18:21:23 +0100
On Sun, Mar 19, 2006 at 11:33:22AM -0500, Daniel Jacobowitz wrote:
> On Sun, Mar 19, 2006 at 08:49:20AM -0500, Thomas E. Dickey wrote:
> > This is a bug in rxvt-unicode rather than ncurses.
>
> Huh? How?
>
> 1. Open rxvt-unicode on host A. This host has rxvt-unicode
> installed, and presumably has a termcap entry for it.
> 2. SSH to host B. This older host does not.
>
> Wouter wants host B to see a value in $TERM that can fall back to
> xterm, if I understand right.
Yes, you do.
> Obviously this wouldn't be helpful for years...
Obviously.
--
Fun will now commence
-- Seven Of Nine, "Ashes to Ashes", stardate 53679.4
Subject: Re: Bug#357742: please allow for specifying more than one terminal
type
Date: Sun, 19 Mar 2006 12:27:07 -0500 (EST)
On Sun, 19 Mar 2006, Daniel Jacobowitz wrote:
> On Sun, Mar 19, 2006 at 11:52:13AM -0500, Thomas E. Dickey wrote:
>> For this case, we can't solve his problem (simply because differences in
>> function keys, etc., mean there is in general no well-defined subset to
>> fall back to).
>>
>> For the usual case (fallback to existing values) it's certainly doable
>> since xterm does _that_.
>
> Sorry, you've totally lost me.
>
> This is about the TERM value set by the terminal emulator, for maximum
> compatibility across multiple hosts, including hosts other than the one
> on which it is running. How can rxvt-unicode - or xterm - do anything
> about that?
nothing - right now I'm using HPUX on one of my windows. Changing ncurses
wouldn't help there.
> I'd love to be able to set "TERMLIST=screen;vt100" and have some smart
> curses library go "I don't know what screen is, but here, have a
> vt100".
I don't know - what comes to my mind is the repeated scenario of the
gnome-terminal, etc., users complaining that ncurses must have bugs
because it's supposed to be "xterm" and isn't working just like xterm.
--
Thomas E. Dickey
http://invisible-island.netftp://invisible-island.net
Subject: Re: Bug#357742: please allow for specifying more than one terminal type
Date: Sun, 19 Mar 2006 18:30:06 +0100
On Sun, Mar 19, 2006 at 11:52:13AM -0500, Thomas Dickey wrote:
> On Sun, 19 Mar 2006, Daniel Jacobowitz wrote:
> >1. Open rxvt-unicode on host A. This host has rxvt-unicode
> > installed, and presumably has a termcap entry for it.
> >2. SSH to host B. This older host does not.
>
> For this case, we can't solve his problem (simply because differences in
> function keys, etc., mean there is in general no well-defined subset to
> fall back to).
Sure; however, my experience is that most terminal emulators support at
least a useful subset of xterm. The fact that they don't map 100% is
precisely the reason why I don't want to go ahead and say TERM=xterm
everywhere. However, if I log in to a host where rxvt-unicode isn't in
termcap (or whatever), it'd be great if ncurses could just walk some
environment variable until it finds a name that it does, in fact, know.
That can't be done currently, which means that every time I log in to a
host that does not have an rxvt-unicode termcap entry, I need to say
"export TERM=xterm", or I get stuff like
wouter@pop:~$ top
'rxvt-unicode': unknown terminal type.
wouter@pop:~$
Other applications, like 'less' and 'vim', do give me some full-screen
interface, but one that doesn't do proper scrolling, colors, or anything
similar.
> For the usual case (fallback to existing values) it's certainly doable
> since xterm does _that_.
That's very nice, but not very useful. It's not the terminal emulator
that needs to fall back, it's the ncurses-using application that would
need to do so.
--
Fun will now commence
-- Seven Of Nine, "Ashes to Ashes", stardate 53679.4
Subject: Re: Bug#357742: please allow for specifying more than one terminal
type
Date: Sun, 19 Mar 2006 12:49:33 -0500 (EST)
On Sun, 19 Mar 2006, Wouter Verhelst wrote:
> Sure; however, my experience is that most terminal emulators support at
> least a useful subset of xterm. The fact that they don't map 100% is
> precisely the reason why I don't want to go ahead and say TERM=xterm
> everywhere. However, if I log in to a host where rxvt-unicode isn't in
> termcap (or whatever), it'd be great if ncurses could just walk some
> environment variable until it finds a name that it does, in fact, know.
Stuff like this (in your .login) is already portable, works on every
unix platform.
#!/bin/sh
for name in foo bar xterm
do
if ( tput -T$name am 2>/dev/null )
then
echo ok $name
fi
done
--
Thomas E. Dickey
http://invisible-island.netftp://invisible-island.net
Subject: Re: Bug#357742: please allow for specifying more than one terminal type
Date: Mon, 20 Mar 2006 09:07:29 +0100
On Sun, Mar 19, 2006 at 12:49:33PM -0500, Thomas Dickey wrote:
> Stuff like this (in your .login) is already portable, works on every
> unix platform.
>
> #!/bin/sh
> for name in foo bar xterm
> do
> if ( tput -T$name am 2>/dev/null )
> then
> echo ok $name
> fi
> done
Yes; but if I then change my terminal (temporarily or permanently), it
does break.
--
Fun will now commence
-- Seven Of Nine, "Ashes to Ashes", stardate 53679.4
Subject: Re: Bug#357742: please allow for specifying more than one terminal
type
Date: Mon, 20 Mar 2006 04:40:38 -0500 (EST)
On Mon, 20 Mar 2006, Wouter Verhelst wrote:
> On Sun, Mar 19, 2006 at 12:49:33PM -0500, Thomas Dickey wrote:
>> Stuff like this (in your .login) is already portable, works on every
>> unix platform.
>>
>> #!/bin/sh
>> for name in foo bar xterm
>> do
>> if ( tput -T$name am 2>/dev/null )
>> then
>> echo ok $name
>> fi
>> done
>
> Yes; but if I then change my terminal (temporarily or permanently), it
> does break.
not under the same assumptions that your suggestion requires.
--
Thomas E. Dickey
http://invisible-island.netftp://invisible-island.net
Subject: Re: Bug#357742: please allow for specifying more than one terminal type
Date: Mon, 20 Mar 2006 08:47:49 -0500
On Mon, Mar 20, 2006 at 09:07:29AM +0100, Wouter Verhelst wrote:
> On Sun, Mar 19, 2006 at 12:49:33PM -0500, Thomas Dickey wrote:
> > Stuff like this (in your .login) is already portable, works on every
> > unix platform.
> >
> > #!/bin/sh
> > for name in foo bar xterm
> > do
> > if ( tput -T$name am 2>/dev/null )
> > then
> > echo ok $name
> > fi
> > done
>
> Yes; but if I then change my terminal (temporarily or permanently), it
> does break.
Certainly you can get around that.
if test "$TERM" = dtterm || "$TERM" = rxvt-unicode; then
if ( tput -T$name am 2>/dev/null ); then
:
elif (tput -Txterm am 2>/dev/null ); then
TERM=xterm
fi
fi
And so on.
--
Daniel Jacobowitz
CodeSourcery
Debbugs is free software and licensed under the terms of the GNU General
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.