Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Final call for testers: TERM=xterm

0 views
Skip to first unread message

Ed Schouten

unread,
Nov 11, 2009, 5:13:27 AM11/11/09
to FreeBSD Current
Hi folks,

I just committed some patches to SVN that should complete the Xterm-
style terminal emulator support. This means we can just share the same
termcap entry between the console driver and X11 terminal emulators,
which has many advantages, including:

- The ability to use dtach(1) without problems.
- Support for more advanced (networking) devices with serial
administrative interfaces.
- Better compatibility with other operating systems.
- Reduced bandwidth.

I'd like to flip the switch one of these days on all platforms, except
i386. On i386 the /etc/ttys file is shared between i386 and pc98. pc98
will still use its own cons25 emulator instead of the xterm emulator, so
I'll initially convert all the other platforms and deal with i386 (and
hopefully pc98) later. I'll discuss this with nyan@.

How to test this:

1. Make sure you run 9.0-CURRENT SVN r199175 or later.
2. Run `vidcontrol -T xterm'.
3. Run `export TERM=xterm'.

After doing this, you shouldn't notice a lot. Make sure applications
like your shell, your editor, etc. still work as expected.

Known issues:

- Right now we only implement the VT220 mouse protocol. This means your
mouse should still work properly, but applications are only capable of
detecting drags/selections after releasing the mouse button. This
could eventually be solved by implementing the Xterm mouse protocol.

If no serious problems arise, I'll make Xterm the default on
Friday/Saturday.

--
Ed Schouten <e...@80386.nl>
WWW: http://80386.nl/

Gary Jennejohn

unread,
Nov 11, 2009, 8:02:49 AM11/11/09
to Ed Schouten, FreeBSD Current
On Wed, 11 Nov 2009 11:12:07 +0100
Ed Schouten <e...@80386.nl> wrote:

> I just committed some patches to SVN that should complete the Xterm-
> style terminal emulator support. This means we can just share the same
> termcap entry between the console driver and X11 terminal emulators,
> which has many advantages, including:
>

[snip]


> If no serious problems arise, I'll make Xterm the default on
> Friday/Saturday.
>

I'm running AMD64.

Arrow keys don't work correctly. For example, if I do "make config"
in a port then using the down arrow immediately exits the menu rather
than moving the cursor. The same thing happens with sade.

Note that I set one entry in /etc/ttys to xterm rather than using the
vidcontrol trick.

With cons25 it works correctly.

I merely installed and booted a new kernel. Not sure whether I also
need a new termcap.

---
Gary Jennejohn
_______________________________________________
freebsd...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-curre...@freebsd.org"

Ed Schouten

unread,
Nov 11, 2009, 8:41:40 AM11/11/09
to gary.je...@freenet.de, FreeBSD Current
Hi Gary,

Have you made sure you ran vidcontrol on that specific window? You can
also add TEKEN_XTERM to your kernel config. I thought dialog worked
properly, but I'll test it again this evening.

--
Ed Schouten <e...@80386.nl> (from iPod)
WWW: http://80386.nl/

On 11 nov 2009, at 14:02, Gary Jennejohn <gary.je...@freenet.de>
wrote:

Gary Jennejohn

unread,
Nov 11, 2009, 8:52:31 AM11/11/09
to Ed Schouten, FreeBSD Current
On Wed, 11 Nov 2009 14:40:28 +0100
Ed Schouten <e...@80386.nl> wrote:

> Have you made sure you ran vidcontrol on that specific window? You can
> also add TEKEN_XTERM to your kernel config. I thought dialog worked
> properly, but I'll test it again this evening.
>

I already mentioned what I did in the first mail:


> > Note that I set one entry in /etc/ttys to xterm rather than using the
> > vidcontrol trick.
> >

---

Paul B Mahol

unread,
Nov 11, 2009, 9:45:37 AM11/11/09
to Ed Schouten, FreeBSD Current
On 11/11/09, Ed Schouten <e...@80386.nl> wrote:
> Hi folks,
>
> I just committed some patches to SVN that should complete the Xterm-
> style terminal emulator support. This means we can just share the same
> termcap entry between the console driver and X11 terminal emulators,
> which has many advantages, including:
>
> - The ability to use dtach(1) without problems.
> - Support for more advanced (networking) devices with serial
> administrative interfaces.
> - Better compatibility with other operating systems.
> - Reduced bandwidth.
>
> I'd like to flip the switch one of these days on all platforms, except
> i386. On i386 the /etc/ttys file is shared between i386 and pc98. pc98
> will still use its own cons25 emulator instead of the xterm emulator, so
> I'll initially convert all the other platforms and deal with i386 (and
> hopefully pc98) later. I'll discuss this with nyan@.
>
> How to test this:
>
> 1. Make sure you run 9.0-CURRENT SVN r199175 or later.
> 2. Run `vidcontrol -T xterm'.
> 3. Run `export TERM=xterm'.
>
> After doing this, you shouldn't notice a lot. Make sure applications
> like your shell, your editor, etc. still work as expected.

It would be nice that keeping shift key pressed and pressing middle
mouse key works like it does in xterm.

Mel Flynn

unread,
Nov 11, 2009, 2:49:35 PM11/11/09
to Ed Schouten, FreeBSD Current
Hi Ed,

On Wednesday 11 November 2009 11:12:07 Ed Schouten wrote:

> - Better compatibility with other operating systems.

I'm not in a position to test this at the moment, but does this mean our
console will now also "fold" paging/editor applications?
I hate this feature with a passion on linux and I've unable to find out how to
disable it, especially since the few linux machines I manage have no termcap
or terminfo database on the places they say they should be.
What I mean with folding is:
root@www:~# man less
Reformatting less(1), please wait...
root@www:~#

As you can see, no more less(1) manpage (it's not limited to less, vim etc as
well). When I change to vt100 terminal, this doesn't occur, hence my worry
about the above sentence in combination with $subject. IF this is going to be
the default, I would appreciate an rc.conf setting or at least an explanation
of what triggers this behavior and how to turn it off in the manpage, as
various quests in google have yielded neither information nor solution.
--
Mel

Kurt Jaeger

unread,
Nov 11, 2009, 3:22:48 PM11/11/09
to FreeBSD Current
Hi!

> I'm not in a position to test this at the moment, but does this mean our
> console will now also "fold" paging/editor applications?
> I hate this feature with a passion on linux and I've unable to find out
> how to
> disable it, especially since the few linux machines I manage have no termcap
> or terminfo database on the places they say they should be.
> What I mean with folding is:
> root@www:~# man less
> Reformatting less(1), please wait...
> root@www:~#

For less, have a look at the "-X" flag:

Disables sending the termcap initialization and deinitialization
strings to the terminal.

In termcap/terminfo, you probably have to look for
the 'ti' and 'te' capabilities.

Basically, find the xterm termcap/terminfo source file, edit it
to change/delete ti/te and re-compile the source using tic.

Yes, someone should write a howto about this 8-}

--
p...@opsec.eu +49 171 3101372 11 years to go !

Dag-Erling Smørgrav

unread,
Nov 11, 2009, 3:33:13 PM11/11/09
to Mel Flynn, Ed Schouten, FreeBSD Current
Mel Flynn <mel.flynn+f...@mailing.thruhere.net> writes:
> I'm not in a position to test this at the moment, but does this mean
> our console will now also "fold" paging/editor applications? I hate
> this feature with a passion on linux and I've unable to find out how
> to disable it, especially since the few linux machines I manage have
> no termcap or terminfo database on the places they say they should be.

The fact that FreeBSD doesn't do this is a bug. The purpose of
/etc/termcap is to document the actual capabilities of the terminal, and
saving and restoring the screen is one of xterm's capabilities, but
somebody who didn't like it unilaterally decided to force their own
personal preferences on everyone instead of tweaking their own shell
configuration (export LESS=-X).

DES
--
Dag-Erling Smørgrav - d...@des.no

Mel Flynn

unread,
Nov 11, 2009, 3:35:04 PM11/11/09
to freebsd...@freebsd.org, Ben Kelly
On Wednesday 11 November 2009 21:05:38 Ben Kelly wrote:

> On Nov 11, 2009, at 2:31 PM, Mel Flynn wrote:
> > On Wednesday 11 November 2009 11:12:07 Ed Schouten wrote:
> >> - Better compatibility with other operating systems.
> >
> > I'm not in a position to test this at the moment, but does this mean our
> > console will now also "fold" paging/editor applications?
> > I hate this feature with a passion on linux and I've unable to find out
> > how to disable it, especially since the few linux machines I manage have
> > no termcap or terminfo database on the places they say they should be.
> > What I mean with folding is:
> > root@www:~# man less
> > Reformatting less(1), please wait...
> > root@www:~#
> >
> > As you can see, no more less(1) manpage (it's not limited to less, vim
> > etc as well). When I change to vt100 terminal, this doesn't occur, hence
> > my worry about the above sentence in combination with $subject. IF this
> > is going to be the default, I would appreciate an rc.conf setting or at
> > least an explanation of what triggers this behavior and how to turn it
> > off in the manpage, as various quests in google have yielded neither
> > information nor solution.
>
> Does this page help at all?
>
> http://www.shallowsky.com/linux/noaltscreen.html

*bow*. Altscreen....it helps if you know what you're looking for.

Ed Schouten

unread,
Nov 11, 2009, 3:36:31 PM11/11/09
to Dag-Erling Smørgrav, Mel Flynn, FreeBSD Current
* Dag-Erling Sm�rgrav <d...@des.no> wrote:
> The fact that FreeBSD doesn't do this is a bug. The purpose of
> /etc/termcap is to document the actual capabilities of the terminal, and
> saving and restoring the screen is one of xterm's capabilities, but
> somebody who didn't like it unilaterally decided to force their own
> personal preferences on everyone instead of tweaking their own shell
> configuration (export LESS=-X).

As a side note, right now we don't support switching to alternate screen
buffers (just becomes a no-op), but it looks like applications don't
break because of this.

Ed Schouten

unread,
Nov 11, 2009, 3:37:55 PM11/11/09
to FreeBSD Current
Hi folks,

Just for completeness sake, I've attached a patch of what I'm going to
commit to HEAD one of these days. I still have to test it a little more.

syscons-xterm.diff

sth...@nethelp.no

unread,
Nov 11, 2009, 4:23:28 PM11/11/09
to d...@des.no, mel.flynn+f...@mailing.thruhere.net, e...@80386.nl, cur...@freebsd.org
> The fact that FreeBSD doesn't do this is a bug. The purpose of
> /etc/termcap is to document the actual capabilities of the terminal, and
> saving and restoring the screen is one of xterm's capabilities, but
> somebody who didn't like it unilaterally decided to force their own
> personal preferences on everyone instead of tweaking their own shell
> configuration (export LESS=-X).

That may be so. However, I (like others on this list) hate that feature
and its default usage in Linux with a passion. If the FreeBSD default
is changed I guess I'll hate that equally much, which is kind of sad -
because in most respects FreeBSD does what I want.

Steinar Haug, Nethelp consulting, sth...@nethelp.no

Anonymous

unread,
Nov 11, 2009, 4:25:20 PM11/11/09
to Mel Flynn, FreeBSD Current
Mel Flynn <mel.flynn+f...@mailing.thruhere.net> writes:

> Hi Ed,
>
> On Wednesday 11 November 2009 11:12:07 Ed Schouten wrote:
>
>> - Better compatibility with other operating systems.
>
> I'm not in a position to test this at the moment, but does this mean our
> console will now also "fold" paging/editor applications?
> I hate this feature with a passion on linux and I've unable to find out how to
> disable it, especially since the few linux machines I manage have no termcap
> or terminfo database on the places they say they should be.
> What I mean with folding is:
> root@www:~# man less
> Reformatting less(1), please wait...
> root@www:~#
>
> As you can see, no more less(1) manpage (it's not limited to less, vim etc as
> well). When I change to vt100 terminal, this doesn't occur, hence my worry
> about the above sentence in combination with $subject. IF this is going to be
> the default, I would appreciate an rc.conf setting or at least an explanation
> of what triggers this behavior and how to turn it off in the manpage, as
> various quests in google have yielded neither information nor solution.

I think for termcap(5) you can disable it by

$ export TERMCAP="${TERM}:ti@:te@:tc=${TERM}:"

Dag-Erling Smørgrav

unread,
Nov 11, 2009, 4:35:07 PM11/11/09
to sth...@nethelp.no, mel.flynn+f...@mailing.thruhere.net, e...@80386.nl, cur...@freebsd.org
sth...@nethelp.no writes:
> That may be so. However, I (like others on this list) hate that feature
> and its default usage in Linux with a passion.

I don't understand why you are blaming Linux for this. It's an xterm
feature that probably goes back twenty years or more (xterm turned 25 a
few months ago). We're not talking just xterm, either; searching for
"ti=" in /etc/termcap reveals that it was available on dozens of
terminals, including several IBM and TekTronix models, just to drop a
couple of big names.

Modern Unix was built on the "mechanism, not policy" principle, and
there is no reason why we should make an exception in this particular
instance. If our termcap hadn't been intentionally sabotaged, those who
hate this feature (as I used to) could easily turn it off, but as things
stand, those who like it (as I do now) can't easily turn it back on,
especially if they work in mixed environments.

DES
--
Dag-Erling Smørgrav - d...@des.no

sth...@nethelp.no

unread,
Nov 11, 2009, 4:47:22 PM11/11/09
to d...@des.no, mel.flynn+f...@mailing.thruhere.net, e...@80386.nl, cur...@freebsd.org
> > That may be so. However, I (like others on this list) hate that feature
> > and its default usage in Linux with a passion.
>
> I don't understand why you are blaming Linux for this. It's an xterm
> feature that probably goes back twenty years or more (xterm turned 25 a
> few months ago). We're not talking just xterm, either; searching for
> "ti=" in /etc/termcap reveals that it was available on dozens of
> terminals, including several IBM and TekTronix models, just to drop a
> couple of big names.

Oh, I'm not blaming Linux. I have edited my fair share of termcap
files, even going back to SunOS and early X11, just to get rid of
this (in my view) extremely annoying feature.

> Modern Unix was built on the "mechanism, not policy" principle, and
> there is no reason why we should make an exception in this particular
> instance. If our termcap hadn't been intentionally sabotaged, those who
> hate this feature (as I used to) could easily turn it off, but as things
> stand, those who like it (as I do now) can't easily turn it back on,
> especially if they work in mixed environments.

You can have your own private termcap/terminfo file, so it is possible
to use the feature if you want to. "mechanism, not policy" is fine, but
there is also a need to choose sensible defaults. In this case I like
the FreeBSD default better than the Linux default. If the FreeBSD
default changes, I'll learn to live with that.

I think we'll have to agree t disagree.

Steinar Haug, Nethelp consulting, sth...@nethelp.no

Ed Schouten

unread,
Nov 12, 2009, 7:59:58 AM11/12/09
to Takahashi Yoshihiro, FreeBSD Current
Hey Takahashi,

* Takahashi Yoshihiro <ny...@jp.FreeBSD.org> wrote:
> In article <20091111101...@hoeg.nl>


> Ed Schouten <e...@80386.nl> writes:
> > I'd like to flip the switch one of these days on all platforms, except
> > i386. On i386 the /etc/ttys file is shared between i386 and pc98. pc98
> > will still use its own cons25 emulator instead of the xterm emulator, so
> > I'll initially convert all the other platforms and deal with i386 (and
> > hopefully pc98) later. I'll discuss this with nyan@.
>

> It seems that scterm-teken.c works for pc98, but it cannot display
> Japanese differently from scterm-sck.c. I think that Japanese support
> is more important than xterm support for pc98. So it should add
> etc/etc.pc98/ttys.

Sure. That could work. I'll first commit the patch I have and after that
I'll decouple /etc/ttys on i386 on pc98. I'll keep you informed.

Ed Schouten

unread,
Nov 13, 2009, 1:01:24 AM11/13/09
to FreeBSD Current
Hi folks,

I just committed the previously mentioned patch to SVN. Please refer to
the last part of the commit message to see what you can do when you run
into trouble.

----- Forwarded message from Ed Schouten <e...@FreeBSD.org> -----
> Date: Fri, 13 Nov 2009 05:54:55 +0000 (UTC)
> From: Ed Schouten <e...@FreeBSD.org>
> To: src-com...@freebsd.org, svn-s...@freebsd.org,
> svn-sr...@freebsd.org
> Subject: svn commit: r199243 - in head: . etc/etc.amd64 etc/etc.arm
> etc/etc.ia64 etc/etc.mips etc/etc.powerpc etc/etc.sparc64 etc/root
> share/skel sys/conf sys/dev/syscons
> tools/tools/nanobsd/gateworks/Files...
>
> Author: ed
> Date: Fri Nov 13 05:54:55 2009
> New Revision: 199243
> URL: http://svn.freebsd.org/changeset/base/199243
>
> Log:
> Switch the default terminal emulation style to xterm for most platforms.
>
> Right now syscons(4) uses a cons25-style terminal emulator. The
> disadvantages of that are:
>
> - Little compatibility with embedded devices with serial interfaces.
> - Bad bandwidth efficiency, mainly because of the lack of scrolling
> regions.
> - A very hard transition path to support for modern character sets like
> UTF-8.
>
> Our terminal emulation library, libteken, has been supporting
> xterm-style terminal emulation for months, so flip the switch and make
> everyone use an xterm-style console driver.
>
> I still have to enable this on i386. Right now pc98 and i386 share the
> same /etc/ttys file. I'm not going to switch pc98, because it uses its
> own Kanji-capable cons25 emulator.
>
> IMPORTANT: What to do if things go wrong (i.e. graphical artifacts):
>
> - Run the application inside script(1), try to reduce the problem and
> send me the log file.
> - In the mean time, you can run `vidcontrol -T cons25' and `export
> TERM=cons25' so you can run applications the same way you did before.
> You can also build your kernel with `options TEKEN_CONS25' to make all
> virtual terminals use the cons25 emulator by default.
>
> Discussed on: current@
----- End forwarded message -----

Cheers,

Ed Schouten

unread,
Nov 13, 2009, 6:36:21 AM11/13/09
to Takahashi Yoshihiro, FreeBSD Current

Done. pc98 has its own /etc/ttys file and i386 also uses xterm now.

Takahashi, I thought pc98 also used a custom TERM type (cons25w). Would
it be nice if we just enabled that by default?

TAKAHASHI Yoshihiro

unread,
Nov 13, 2009, 6:52:06 AM11/13/09
to e...@80386.nl, cur...@freebsd.org
In article <20091113113...@hoeg.nl>
Ed Schouten <e...@80386.nl> writes:

> Done. pc98 has its own /etc/ttys file and i386 also uses xterm now.

Thanks.


> Takahashi, I thought pc98 also used a custom TERM type (cons25w). Would
> it be nice if we just enabled that by default?

Yes!!

---
TAKAHASHI Yoshihiro <ny...@jp.FreeBSD.org>

Andrey Chernov

unread,
Nov 29, 2009, 11:42:16 PM11/29/09
to Ed Schouten, FreeBSD Current
On Fri, Nov 13, 2009 at 07:00:21AM +0100, Ed Schouten wrote:
> Hi folks,
>
> I just committed the previously mentioned patch to SVN. Please refer to
> the last part of the commit message to see what you can do when you run
> into trouble.

It seems xterm emulator can't co-exist with screen maps, namely
vidcontrol -l koi8-r2cp866
I got Russian letters everywhere instead of vt100 pseudographics due to
missing (i.e. default) ac= termcap capability (f.e. in tzsetup etc.)
There are 2 ways to fix it.
1) Make separate xterm-r with corrected ac= (that way is ugly).
2) Don't seek for vt100 pseudographics in loaded font at all, just use
internal kernel font.
Please decide how to fix this better. For now only fallback to '-T cons25'
is solution for Russian users.

--
http://ache.pp.ru/

Andrey Chernov

unread,
Nov 30, 2009, 12:50:01 AM11/30/09
to Ed Schouten, FreeBSD Current
On Mon, Nov 30, 2009 at 07:41:30AM +0300, Andrey Chernov wrote:
> Please decide how to fix this better. For now only fallback to '-T cons25'
> is solution for Russian users.

Another bug found.
-T cons25 can't coexist with 'mode' argument, i.e.
xterm# vidcontrol -T cons25 80x30
really makes xterm 80x30, not cons25 80x30.
xterm# vidcontrol -T cons25
alone works, but there is only single 'allscreens_flags' variable in the
/etc/rc.conf, so I can't switch to 80x30 at once.

The strange thing is that
cons25# vidcontrol -T xterm 80x30
works as supposed.

Please fix.

--
http://ache.pp.ru/

Vladimir Grebenschikov

unread,
Dec 13, 2009, 10:34:17 AM12/13/09
to Andrey Chernov, Ed Schouten, FreeBSD Current
Hi

Any chance to get it fixed somehow ?

midnight commander does not work correctly even with no screen-maps,
vidcontrol -T xterm, env TERM=xterm LANG=ru_RU.UTF-8


also, console does not handle correctly multi-byte utf-8 characters
(it should already or not ?)

--
Vladimir B. Grebenschikov
vo...@fbsd.ru

Andrey Chernov

unread,
Dec 15, 2009, 6:17:37 AM12/15/09
to Vladimir Grebenschikov, Ed Schouten, FreeBSD Current
On Sun, Dec 13, 2009 at 06:33:22PM +0300, Vladimir Grebenschikov wrote:
> Hi
>
> Any chance to get it fixed somehow ?

It seems Ed does not read his email. I already try to submit this two
bugs several times and ways and ask him for confirmation that my mails at
least received, but got nothing.

I don't know any other channels to contact Ed. If anybody knows please
help.


--
http://ache.pp.ru/

Paul B Mahol

unread,
Jan 10, 2010, 11:41:44 AM1/10/10
to Ed Schouten, FreeBSD Current
On 11/11/09, Ed Schouten <e...@80386.nl> wrote:

Mouse positioning works only on ttyv0.


>
> If no serious problems arise, I'll make Xterm the default on
> Friday/Saturday.
>
> --
> Ed Schouten <e...@80386.nl>
> WWW: http://80386.nl/
>


--
Paul B Mahol

0 new messages