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@

Modified:
  head/UPDATING
  head/etc/etc.amd64/ttys
  head/etc/etc.arm/ttys
  head/etc/etc.ia64/ttys
  head/etc/etc.mips/ttys
  head/etc/etc.powerpc/ttys
  head/etc/etc.sparc64/ttys
  head/etc/root/dot.profile
  head/share/skel/dot.profile
  head/sys/conf/NOTES
  head/sys/conf/options
  head/sys/dev/syscons/scterm-teken.c
  head/tools/tools/nanobsd/gateworks/Files/root/.profile
  head/usr.sbin/sade/termcap.c
  head/usr.sbin/sysinstall/termcap.c

Modified: head/UPDATING
==============================================================================
--- head/UPDATING       Fri Nov 13 03:59:44 2009        (r199242)
+++ head/UPDATING       Fri Nov 13 05:54:55 2009        (r199243)
@@ -22,6 +22,21 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
        machines to maximize performance.  (To disable malloc debugging, run
        ln -s aj /etc/malloc.conf.)
 
+20091113:
+       The default terminal emulation for syscons(4) has been changed
+       from cons25 to xterm on all platforms except i386 and pc98.
+       This means that the /etc/ttys file needs to be updated to ensure
+       correct operation of applications on the console.
+
+       The terminal emulation style can be toggled per window by using
+       vidcontrol(1)'s -T flag.  The TEKEN_XTERM and TEKEN_CONS25
+       kernel configuration options can be used to change the
+       compile-time default.
+
+       To prevent graphical artifacts, make sure the TERM environment
+       variable is set to match the terminal emulation that is being
+       performed by syscons(4).
+
 20091109:
        The layout of the structure ieee80211req_scan_result has changed.
        Applications that require wireless scan results (e.g. ifconfig(8))

Modified: head/etc/etc.amd64/ttys
==============================================================================
--- head/etc/etc.amd64/ttys     Fri Nov 13 03:59:44 2009        (r199242)
+++ head/etc/etc.amd64/ttys     Fri Nov 13 05:54:55 2009        (r199243)
@@ -15,7 +15,7 @@
 #
 # type The initial terminal type for this port.  For hardwired
 #      terminal lines, this will contain the type of terminal used.
-#      For virtual consoles, the correct type is typically cons25.
+#      For virtual consoles, the correct type is typically xterm.
 #      Other common values include network for network connections on
 #      pseudo-terminals, dialup for incoming modem ports, and unknown
 #      when the terminal type cannot be predetermined.
@@ -30,15 +30,15 @@
 # when going to single-user mode.
 console        none                            unknown off secure
 #
-ttyv0  "/usr/libexec/getty Pc"         cons25  on  secure
+ttyv0  "/usr/libexec/getty Pc"         xterm   on  secure
 # Virtual terminals
-ttyv1  "/usr/libexec/getty Pc"         cons25  on  secure
-ttyv2  "/usr/libexec/getty Pc"         cons25  on  secure
-ttyv3  "/usr/libexec/getty Pc"         cons25  on  secure
-ttyv4  "/usr/libexec/getty Pc"         cons25  on  secure
-ttyv5  "/usr/libexec/getty Pc"         cons25  on  secure
-ttyv6  "/usr/libexec/getty Pc"         cons25  on  secure
-ttyv7  "/usr/libexec/getty Pc"         cons25  on  secure
+ttyv1  "/usr/libexec/getty Pc"         xterm   on  secure
+ttyv2  "/usr/libexec/getty Pc"         xterm   on  secure
+ttyv3  "/usr/libexec/getty Pc"         xterm   on  secure
+ttyv4  "/usr/libexec/getty Pc"         xterm   on  secure
+ttyv5  "/usr/libexec/getty Pc"         xterm   on  secure
+ttyv6  "/usr/libexec/getty Pc"         xterm   on  secure
+ttyv7  "/usr/libexec/getty Pc"         xterm   on  secure
 ttyv8  "/usr/local/bin/xdm -nodaemon"  xterm   off secure
 # Serial terminals
 # The 'dialup' keyword identifies dialin lines to login, fingerd etc.

Modified: head/etc/etc.arm/ttys
==============================================================================
--- head/etc/etc.arm/ttys       Fri Nov 13 03:59:44 2009        (r199242)
+++ head/etc/etc.arm/ttys       Fri Nov 13 05:54:55 2009        (r199243)
@@ -15,7 +15,7 @@
 #
 # type The initial terminal type for this port.  For hardwired
 #      terminal lines, this will contain the type of terminal used.
-#      For virtual consoles, the correct type is typically cons25.
+#      For virtual consoles, the correct type is typically xterm.
 #      Other common values include network for network connections on
 #      pseudo-terminals, dialup for incoming modem ports, and unknown
 #      when the terminal type cannot be predetermined.
@@ -30,15 +30,15 @@
 # when going to single-user mode.
 console        none                            unknown off secure
 #
-ttyv0  "/usr/libexec/getty Pc"         cons25  off  secure
+ttyv0  "/usr/libexec/getty Pc"         xterm   off  secure
 # Virtual terminals
-ttyv1  "/usr/libexec/getty Pc"         cons25  off  secure
-ttyv2  "/usr/libexec/getty Pc"         cons25  off  secure
-ttyv3  "/usr/libexec/getty Pc"         cons25  off  secure
-ttyv4  "/usr/libexec/getty Pc"         cons25  off  secure
-ttyv5  "/usr/libexec/getty Pc"         cons25  off  secure
-ttyv6  "/usr/libexec/getty Pc"         cons25  off  secure
-ttyv7  "/usr/libexec/getty Pc"         cons25  off  secure
+ttyv1  "/usr/libexec/getty Pc"         xterm   off  secure
+ttyv2  "/usr/libexec/getty Pc"         xterm   off  secure
+ttyv3  "/usr/libexec/getty Pc"         xterm   off  secure
+ttyv4  "/usr/libexec/getty Pc"         xterm   off  secure
+ttyv5  "/usr/libexec/getty Pc"         xterm   off  secure
+ttyv6  "/usr/libexec/getty Pc"         xterm   off  secure
+ttyv7  "/usr/libexec/getty Pc"         xterm   off  secure
 #ttyv8 "/usr/local/bin/xdm -nodaemon"  xterm   off secure
 # Serial terminals
 # The 'dialup' keyword identifies dialin lines to login, fingerd etc.

Modified: head/etc/etc.ia64/ttys
==============================================================================
--- head/etc/etc.ia64/ttys      Fri Nov 13 03:59:44 2009        (r199242)
+++ head/etc/etc.ia64/ttys      Fri Nov 13 05:54:55 2009        (r199243)
@@ -15,7 +15,7 @@
 #
 # type The initial terminal type for this port.  For hardwired
 #      terminal lines, this will contain the type of terminal used.
-#      For virtual consoles, the correct type is typically cons25.
+#      For virtual consoles, the correct type is typically xterm.
 #      Other common values include network for network connections on
 #      pseudo-terminals, dialup for incoming modem ports, and unknown
 #      when the terminal type cannot be predetermined.
@@ -30,15 +30,15 @@
 # when going to single-user mode.
 console        none                            unknown off secure
 #
-ttyv0  "/usr/libexec/getty Pc"         cons25  off secure
-# Virtual terminals.
-ttyv1  "/usr/libexec/getty Pc"         cons25  off secure
-ttyv2  "/usr/libexec/getty Pc"         cons25  off secure
-ttyv3  "/usr/libexec/getty Pc"         cons25  off secure
-ttyv4  "/usr/libexec/getty Pc"         cons25  off secure
-ttyv5  "/usr/libexec/getty Pc"         cons25  off secure
-ttyv6  "/usr/libexec/getty Pc"         cons25  off secure
-ttyv7  "/usr/libexec/getty Pc"         cons25  off secure
+ttyv0  "/usr/libexec/getty Pc"         xterm   off secure
+# Virtual terminals
+ttyv1  "/usr/libexec/getty Pc"         xterm   off secure
+ttyv2  "/usr/libexec/getty Pc"         xterm   off secure
+ttyv3  "/usr/libexec/getty Pc"         xterm   off secure
+ttyv4  "/usr/libexec/getty Pc"         xterm   off secure
+ttyv5  "/usr/libexec/getty Pc"         xterm   off secure
+ttyv6  "/usr/libexec/getty Pc"         xterm   off secure
+ttyv7  "/usr/libexec/getty Pc"         xterm   off secure
 ttyv8  "/usr/local/bin/xdm -nodaemon"  xterm   off secure
 # Serial terminals. The 'dialup' keyword identifies dialin lines to login,
 # fingerd etc.

Modified: head/etc/etc.mips/ttys
==============================================================================
--- head/etc/etc.mips/ttys      Fri Nov 13 03:59:44 2009        (r199242)
+++ head/etc/etc.mips/ttys      Fri Nov 13 05:54:55 2009        (r199243)
@@ -15,7 +15,7 @@
 #
 # type The initial terminal type for this port.  For hardwired
 #      terminal lines, this will contain the type of terminal used.
-#      For virtual consoles, the correct type is typically cons25.
+#      For virtual consoles, the correct type is typically xterm.
 #      Other common values include network for network connections on
 #      pseudo-terminals, dialup for incoming modem ports, and unknown
 #      when the terminal type cannot be predetermined.

Modified: head/etc/etc.powerpc/ttys
==============================================================================
--- head/etc/etc.powerpc/ttys   Fri Nov 13 03:59:44 2009        (r199242)
+++ head/etc/etc.powerpc/ttys   Fri Nov 13 05:54:55 2009        (r199243)
@@ -15,7 +15,7 @@
 #
 # type The initial terminal type for this port.  For hardwired
 #      terminal lines, this will contain the type of terminal used.
-#      For virtual consoles, the correct type is typically cons25.
+#      For virtual consoles, the correct type is typically xterm.
 #      Other common values include network for network connections on
 #      pseudo-terminals, dialup for incoming modem ports, and unknown
 #      when the terminal type cannot be predetermined.
@@ -30,15 +30,15 @@
 # when going to single-user mode.
 console        none                            unknown off secure
 #
-ttyv0  "/usr/libexec/getty Pc"         cons25  on  secure
+ttyv0  "/usr/libexec/getty Pc"         xterm   on  secure
 # Virtual terminals
-ttyv1  "/usr/libexec/getty Pc"         cons25  on  secure
-ttyv2  "/usr/libexec/getty Pc"         cons25  on  secure
-ttyv3  "/usr/libexec/getty Pc"         cons25  on  secure
-ttyv4  "/usr/libexec/getty Pc"         cons25  on  secure
-ttyv5  "/usr/libexec/getty Pc"         cons25  on  secure
-ttyv6  "/usr/libexec/getty Pc"         cons25  on  secure
-ttyv7  "/usr/libexec/getty Pc"         cons25  on  secure
+ttyv1  "/usr/libexec/getty Pc"         xterm   on  secure
+ttyv2  "/usr/libexec/getty Pc"         xterm   on  secure
+ttyv3  "/usr/libexec/getty Pc"         xterm   on  secure
+ttyv4  "/usr/libexec/getty Pc"         xterm   on  secure
+ttyv5  "/usr/libexec/getty Pc"         xterm   on  secure
+ttyv6  "/usr/libexec/getty Pc"         xterm   on  secure
+ttyv7  "/usr/libexec/getty Pc"         xterm   on  secure
 #ttyv8 "/usr/local/bin/xdm -nodaemon"  xterm   off secure
 # Serial terminals
 # The 'dialup' keyword identifies dialin lines to login, fingerd etc.

Modified: head/etc/etc.sparc64/ttys
==============================================================================
--- head/etc/etc.sparc64/ttys   Fri Nov 13 03:59:44 2009        (r199242)
+++ head/etc/etc.sparc64/ttys   Fri Nov 13 05:54:55 2009        (r199243)
@@ -15,7 +15,7 @@
 #
 # type The initial terminal type for this port.  For hardwired
 #      terminal lines, this will contain the type of terminal used.
-#      For virtual consoles, the correct type is typically cons25.
+#      For virtual consoles, the correct type is typically xterm.
 #      Other common values include network for network connections on
 #      pseudo-terminals, dialup for incoming modem ports, and unknown
 #      when the terminal type cannot be predetermined.
@@ -34,15 +34,15 @@ screen      "/usr/libexec/getty Pc"         vt100   of
 ttya   "/usr/libexec/getty 3wire.9600" vt100   off secure
 ttyb   "/usr/libexec/getty 3wire.9600" vt100   off secure
 # syscons(4)
-ttyv0  "/usr/libexec/getty Pc"         cons25  on  secure
+ttyv0  "/usr/libexec/getty Pc"         xterm   on  secure
 # Virtual terminals
-ttyv1  "/usr/libexec/getty Pc"         cons25  on  secure
-ttyv2  "/usr/libexec/getty Pc"         cons25  on  secure
-ttyv3  "/usr/libexec/getty Pc"         cons25  on  secure
-ttyv4  "/usr/libexec/getty Pc"         cons25  on  secure
-ttyv5  "/usr/libexec/getty Pc"         cons25  on  secure
-ttyv6  "/usr/libexec/getty Pc"         cons25  on  secure
-ttyv7  "/usr/libexec/getty Pc"         cons25  on  secure
+ttyv1  "/usr/libexec/getty Pc"         xterm   on  secure
+ttyv2  "/usr/libexec/getty Pc"         xterm   on  secure
+ttyv3  "/usr/libexec/getty Pc"         xterm   on  secure
+ttyv4  "/usr/libexec/getty Pc"         xterm   on  secure
+ttyv5  "/usr/libexec/getty Pc"         xterm   on  secure
+ttyv6  "/usr/libexec/getty Pc"         xterm   on  secure
+ttyv7  "/usr/libexec/getty Pc"         xterm   on  secure
 ttyv8  "/usr/local/bin/xdm -nodaemon"  xterm   off secure
 # Serial terminals
 # The 'dialup' keyword identifies dialin lines to login, fingerd etc.

Modified: head/etc/root/dot.profile
==============================================================================
--- head/etc/root/dot.profile   Fri Nov 13 03:59:44 2009        (r199242)
+++ head/etc/root/dot.profile   Fri Nov 13 05:54:55 2009        (r199243)
@@ -4,7 +4,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/
 export PATH
 HOME=/root
 export HOME
-TERM=${TERM:-cons25}
+TERM=${TERM:-xterm}
 export TERM
 PAGER=more
 export PAGER

Modified: head/share/skel/dot.profile
==============================================================================
--- head/share/skel/dot.profile Fri Nov 13 03:59:44 2009        (r199242)
+++ head/share/skel/dot.profile Fri Nov 13 05:54:55 2009        (r199243)
@@ -11,8 +11,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/
 # Setting TERM is normally done through /etc/ttys.  Do only override
 # if you're sure that you'll never log in via telnet or xterm or a
 # serial line.
-# Use cons25l1 for iso-* fonts
-# TERM=cons25;         export TERM
+# TERM=xterm;  export TERM
 
 BLOCKSIZE=K;   export BLOCKSIZE
 EDITOR=vi;     export EDITOR

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES Fri Nov 13 03:59:44 2009        (r199242)
+++ head/sys/conf/NOTES Fri Nov 13 05:54:55 2009        (r199243)
@@ -1410,8 +1410,9 @@ options   SC_NO_SUSPEND_VTYSWITCH
 #      0x100   Probe for a keyboard device periodically if one is not present
 
 # Enable experimental features of the syscons terminal emulator (teken).
+options        TEKEN_CONS25            # cons25-style terminal emulation
 options        TEKEN_UTF8              # UTF-8 output handling
-options        TEKEN_XTERM             # xterm-style terminal emulation
+#options       TEKEN_XTERM             # xterm-style terminal emulation
 
 #
 # Optional devices:

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options       Fri Nov 13 03:59:44 2009        (r199242)
+++ head/sys/conf/options       Fri Nov 13 05:54:55 2009        (r199243)
@@ -732,6 +732,7 @@ SC_RENDER_DEBUG             opt_syscons.h
 SC_TWOBUTTON_MOUSE     opt_syscons.h
 
 # teken terminal emulator options
+TEKEN_CONS25           opt_teken.h
 TEKEN_UTF8             opt_teken.h
 TEKEN_XTERM            opt_teken.h
 

Modified: head/sys/dev/syscons/scterm-teken.c
==============================================================================
--- head/sys/dev/syscons/scterm-teken.c Fri Nov 13 03:59:44 2009        
(r199242)
+++ head/sys/dev/syscons/scterm-teken.c Fri Nov 13 05:54:55 2009        
(r199243)
@@ -50,6 +50,15 @@ __FBSDID("$FreeBSD$");
 
 #include <teken/teken.h>
 
+#if defined(TEKEN_XTERM) && defined(TEKEN_CONS25)
+#error "xterm and cons25 are mutually exclusive."
+#endif
+
+/* XXX: Use cons25 on i386, for compatibility with pc98. */
+#if defined(__i386__) && !defined(TEKEN_XTERM) && !defined(TEKEN_CONS25)
+#define        TEKEN_CONS25
+#endif
+
 static void scteken_revattr(unsigned char, teken_attr_t *);
 static unsigned int scteken_attr(const teken_attr_t *);
 
@@ -132,9 +141,9 @@ scteken_init(scr_stat *scp, void **softc
 #ifndef TEKEN_UTF8
                teken_set_8bit(&ts->ts_teken);
 #endif /* !TEKEN_UTF8 */
-#ifndef TEKEN_XTERM
+#ifdef TEKEN_CONS25
                teken_set_cons25(&ts->ts_teken);
-#endif /* !TEKEN_XTERM */
+#endif /* TEKEN_CONS25 */
 
                tp.tp_row = scp->ysize;
                tp.tp_col = scp->xsize;

Modified: head/tools/tools/nanobsd/gateworks/Files/root/.profile
==============================================================================
--- head/tools/tools/nanobsd/gateworks/Files/root/.profile      Fri Nov 13 
03:59:44 2009        (r199242)
+++ head/tools/tools/nanobsd/gateworks/Files/root/.profile      Fri Nov 13 
05:54:55 2009        (r199243)
@@ -3,7 +3,7 @@
 
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:~/bin
 export PATH
 HOME=/root; export HOME
-TERM=${TERM:-cons25}; export TERM
+TERM=${TERM:-xterm}; export TERM
 PAGER=more; export PAGER
 
 #set -o vi

Modified: head/usr.sbin/sade/termcap.c
==============================================================================
--- head/usr.sbin/sade/termcap.c        Fri Nov 13 03:59:44 2009        
(r199242)
+++ head/usr.sbin/sade/termcap.c        Fri Nov 13 05:54:55 2009        
(r199243)
@@ -83,7 +83,11 @@ set_termcap(void)
 #else
        if (ColorDisplay) {
            if (!term) {
+#ifdef __i386__
                if (setenv("TERM", "cons25", 1) < 0)
+#else
+               if (setenv("TERM", "xterm", 1) < 0)
+#endif
                    return -1;
            }
        }

Modified: head/usr.sbin/sysinstall/termcap.c
==============================================================================
--- head/usr.sbin/sysinstall/termcap.c  Fri Nov 13 03:59:44 2009        
(r199242)
+++ head/usr.sbin/sysinstall/termcap.c  Fri Nov 13 05:54:55 2009        
(r199243)
@@ -125,10 +125,17 @@ set_termcap(void)
 #else
        if (ColorDisplay) {
            if (!term) {
+#ifdef __i386__
                if (setenv("TERM", "cons25", 1) < 0)
                    return -1;
                if (setenv("TERMCAP", termcap_cons25, 1) < 0)
                    return -1;
+#else
+               if (setenv("TERM", "xterm", 1) < 0)
+                   return -1;
+               if (setenv("TERMCAP", termcap_xterm, 1) < 0)
+                   return -1;
+#endif
            }
        }
        else {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to