summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjnweiger <jnweiger>2005-12-16 17:48:14 +0000
committerjnweiger <jnweiger>2005-12-16 17:48:14 +0000
commit80a04457c6a81cf26536bfa8463f6b78fd92c9a4 (patch)
treecdd130778693d1963e14d67a234c8a10a80dec40
parent450edb64789fd7d73f774a9101779f05f2fb639a (diff)
downloadscreen-80a04457c6a81cf26536bfa8463f6b78fd92c9a4.tar.gz
old version screen-3.7.1 Nov 20 1995
-rw-r--r--src/COPYING8
-rw-r--r--src/ChangeLog6
-rw-r--r--src/FAQ20
-rw-r--r--src/INSTALL27
-rw-r--r--src/Makefile2
-rw-r--r--src/Makefile.in87
-rw-r--r--src/NEWS100
-rw-r--r--src/NEWS.3.5119
-rw-r--r--src/NEWS.3.648
-rw-r--r--src/acls.c (renamed from src/acl.c)13
-rw-r--r--src/acls.h (renamed from src/acl.h)7
-rw-r--r--src/ansi.c591
-rw-r--r--src/ansi.h8
-rw-r--r--src/attacher.c44
-rw-r--r--src/comm.c13
-rw-r--r--src/comm.h.dist230
-rw-r--r--src/config.h.in5
-rwxr-xr-xsrc/configure95
-rw-r--r--src/configure.in33
-rw-r--r--src/display.c329
-rw-r--r--src/display.h38
-rw-r--r--src/doc/FAQ253
-rw-r--r--src/doc/Makefile.in8
-rw-r--r--src/doc/screen.1394
-rw-r--r--src/doc/screen.info277
-rw-r--r--src/doc/screen.info-1100
-rw-r--r--src/doc/screen.info-2269
-rw-r--r--src/doc/screen.info-3427
-rw-r--r--src/doc/screen.info-4158
-rw-r--r--src/doc/screen.texinfo519
-rw-r--r--src/etc/etcscreenrc29
-rw-r--r--src/etc/screenrc50
-rwxr-xr-xsrc/etc/toolcheck38
-rw-r--r--src/extern.h29
-rw-r--r--src/fileio.c65
-rw-r--r--src/help.c23
-rw-r--r--src/image.h106
-rw-r--r--src/input.c23
-rw-r--r--src/loadav.c25
-rw-r--r--src/mark.c152
-rw-r--r--src/mark.h3
-rw-r--r--src/misc.c50
-rw-r--r--src/os.h18
-rw-r--r--src/osdef.h.in12
-rw-r--r--src/osdef.sh3
-rw-r--r--src/overlay.h3
-rw-r--r--src/patchlevel.h36
-rw-r--r--src/process.c582
-rw-r--r--src/pty.c20
-rw-r--r--src/putenv.c5
-rw-r--r--src/rcs.h3
-rw-r--r--src/resize.c759
-rw-r--r--src/screen.c298
-rw-r--r--src/screen.h9
-rw-r--r--src/search.c25
-rw-r--r--src/socket.c5
-rw-r--r--src/tek.patch28
-rw-r--r--src/term.c14
-rw-r--r--src/term.h.dist164
-rw-r--r--src/termcap.c266
-rw-r--r--src/terminfo/README3
-rw-r--r--src/terminfo/screencap10
-rw-r--r--src/terminfo/screeninfo.src18
-rw-r--r--src/tty.c.dist19
-rw-r--r--src/tty.sh19
-rw-r--r--src/utmp.c5
-rw-r--r--src/window.c93
-rw-r--r--src/window.h44
68 files changed, 4944 insertions, 2338 deletions
diff --git a/src/COPYING b/src/COPYING
index a43ea21..13c9d42 100644
--- a/src/COPYING
+++ b/src/COPYING
@@ -2,7 +2,7 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, USA
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -303,9 +303,9 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Also add information on how to contact you by electronic and paper mail.
diff --git a/src/ChangeLog b/src/ChangeLog
index b3e9136..2256d80 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+30.10.94
+
+This is a quick overview of screen's life story. But it is not up
+to date. You'll find more details about the revision history in
+patchlevel.h and newer changes are only documented there.
+
31.7.93 -- 3.5.1
================
diff --git a/src/FAQ b/src/FAQ
index 05130a2..6c9c8af 100644
--- a/src/FAQ
+++ b/src/FAQ
@@ -231,3 +231,23 @@ Q: Mesg or biff cannot be turned on or off while running screen.
A: Screen failed to change the owner of the pty it uses. You need to
install screen setuid-root. See the file INSTALL for details.
+Q: The cursor left key deletes the characters instead of just moving the
+ cursor. A redisplay (^Al) brings everything back.
+
+A: Your terminal emulator treats the backspace as "destructive". You
+ can probably change this somewhere in the setup. We can't think
+ of a reason why anybody would want a destructive backspace, but
+ if you really must have it, add the lines
+ termcap <TERM> 'bc@:bs@'
+ terminfo <TERM> 'bc@:bs@'
+ to your ~/.screenrc (replace <TERM> with the terminal type your
+ emulator uses).
+
+Q: I have an old SysV OS (like Motorola SysV68) and sometimes screen
+ doesn't reset the attributes correctly. A redisplay (^Al) doesn't
+ make things better.
+
+A: The libcurses library has a bug if attributes are cleared with
+ the special ue/se capabilities. As a workaround (other than upgrading
+ your system) modify 'rmul' (and 'rmso'?) in screen's terminfo entry:
+ rmul=\E[m, rmso=\E[m
diff --git a/src/INSTALL b/src/INSTALL
index f70a655..d382078 100644
--- a/src/INSTALL
+++ b/src/INSTALL
@@ -1,11 +1,18 @@
-Installation of screen3.6 jw 10.01.95
+Installation of screen3.6 jw 9.04.95
0.) This instruction is quite lengthy
-------------------------------------
.. and there are still important items near the end. Start here:
-Unpack. Screen comes as a compressed tar archive. You need gzip to uncompress.
-and... well, you probably already managed that step, when you are reading this.
+Unpack. Screen comes as a compressed tar archive. You need gzip to
+uncompress. And... well, you probably already managed that step,
+when you are reading this.
+
+For general documentation on the coding and usage standards this
+distributions follows, see the GNU standards document on
+prep.ai.mit.edu:pub/gnu/standards.*, especially the `Makefile
+Conventions', `Configuration', and `User Interfaces' sections.
+
1.) configure & config.status
-----------------------------
@@ -25,14 +32,18 @@ Look through the Makefile & user configuration section in config.h and check
pathnames. Change them to suit your installation requirements. Usually
sysadmins discuss the location of SOCKDIR, whether it should be in /tmp or
not. At least it must be on a filesystem that supports sockets/fifos.
-The path for ETCSCREENRC needs also to be adapted.
+SOCKDIR must not point into an AFS (Andrew File System) mounted directory.
+If you are uncrertain about your NFS implementation, use a UFS directory for
+SOCKDIR. Personally, I favour a users home directory and recommend the the
+/tmp/ area.
+The path for ETCSCREENRC may also need to be adapted.
3.) how to actually compile
---------------------------
Run 'make'. Screen should compile without too many warnings :)
The creation of term.h, comm.h, tty.c or osdef.h may fail on some machines
for some odd reason. (E.g. the sed under SCO-unix is known to be
-case-insensitive and breaks term.h.) If so, please mail a short description
+case-insensitive and breaks term.h) If so, please mail a short description
of the problem to screen@uni-erlangen.de and use the files ending in .dist
as a replacement (or in case of osdef.h retry with an empty file).
You can then try 'make install' (if you dare).
@@ -53,7 +64,7 @@ Consider this, when deciding whether you install screen setuid-root:
- Some commands only work properly when the pty is owned by the user.
These include mesg and biff.
- The ^At feature may need to lseek and read the kernel file to retrieve
- the load average.
+ the load average.
- On most machines utmp slots can only be created/manipulated with root
privileges. Users will appear to be logged on the primary terminal
instead of the screen windows, if screen is not installed setuid-root.
@@ -78,7 +89,7 @@ The files screenrc and etc/etcscreenrc are instructive samples that
demonstrate what can/should be done from your private .screenrc and from
$ETCSCREENRC -- do not just copy them. Read them. Look through the
etcscreenrc file for system wide defaults that you like to set. e.g.
-autodetach off, startup_message off, vbell on, ...
+autodetach off, startup_message off, vbell on, ...aak
Since version 3.2.15 the screenrc file syntax changed slightly. All rc files
from previous versions should be run through the newsyntax script that comes
with this package.
@@ -96,4 +107,4 @@ database is up to date. See the README in the terminfo subdirectory.
To get an idea what the basic screen commands are, read the file README.
Request snail mail address for liquid and solid donations. :-)
-Juergen & Michael. (screen@uni-erlangen.de)
+Juergen Weigert. (screen@uni-erlangen.de)
diff --git a/src/Makefile b/src/Makefile
index b4b273c..9458230 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,2 +1,2 @@
-install all Makefiles config:
+install all Makefiles and config:
sh ./configure
diff --git a/src/Makefile.in b/src/Makefile.in
index feabc00..f9fc599 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -55,11 +55,11 @@ SHELL=/bin/sh
CFILES= screen.c ansi.c fileio.c mark.c misc.c resize.c socket.c \
search.c tty.c term.c window.c utmp.c loadav.c putenv.c help.c \
termcap.c input.c attacher.c pty.c process.c display.c comm.c \
- kmapdef.c acl.c
+ kmapdef.c acls.c
OFILES= screen.o ansi.o fileio.o mark.o misc.o resize.o socket.o \
search.o tty.o term.o window.o utmp.o loadav.o putenv.o help.o \
termcap.o input.o attacher.o pty.o process.o display.o comm.o \
- kmapdef.o acl.o
+ kmapdef.o acls.o
all: screen screen.info
@@ -75,14 +75,15 @@ install_bin: screen
# This doesn't work if $(bindir)/screen is a symlink
-if [ -f $(bindir)/screen ] && [ ! -f $(bindir)/screen.old ]; then mv $(bindir)/screen $(bindir)/screen.old; fi
rm -f $(bindir)/screen
- ln -s $(bindir)/screen-$(VERSION) $(bindir)/screen
+ ln -s screen-$(VERSION) $(bindir)/screen
-install: install_bin
+install: installdirs install_bin
cd doc ; $(MAKE) install
-tic ${srcdir}/terminfo/screeninfo.src
# Better do this by hand. E.g. under RCS...
# cat ${srcdir}/terminfo/screencap >> /etc/termcap
@echo "termcap entry (${srcdir}/terminfo/screencap) should be installed manually."
+ @echo "You may also want to install $(srcdir)/etc/etcscreenrc in" $(ETCSCREENRC)
installdirs:
# Path leading to ETCSCREENRC and Socketdirectory not checked.
@@ -135,6 +136,8 @@ distclean: mostlyclean
rm -f screen-$(VERSION).tar screen-$(VERSION).TZ
rm -f config.status Makefile
rm -f osdef.h doc/Makefile
+ echo "install all Makefiles and config:" > Makefile
+ echo " sh ./configure" >> Makefile
# Delete everything from the current directory that can be
# reconstructed with this Makefile.
@@ -152,13 +155,13 @@ screen-$(VERSION).tar: term.h comm.h tty.c kmapdef.c
-rm -rf dist
mkdir dist
mkdir dist/screen-$(VERSION)
- ln acl.h ansi.h display.h extern.h mark.h os.h overlay.h \
- patchlevel.h rcs.h screen.h window.h osdef.h.in \
- term.sh tty.sh comm.sh osdef.sh \
- acl.c ansi.c attacher.c comm.c display.c window.c fileio.c help.c \
+ ln acls.h ansi.h display.h extern.h mark.h os.h overlay.h \
+ patchlevel.h rcs.h screen.h window.h image.h \
+ osdef.h.in term.sh tty.sh comm.sh osdef.sh \
+ acls.c ansi.c attacher.c comm.c display.c window.c fileio.c help.c \
input.c loadav.c mark.c misc.c process.c pty.c putenv.c \
screen.c search.c socket.c term.c termcap.c utmp.c resize.c \
- ChangeLog COPYING INSTALL NEWS install.sh \
+ ChangeLog COPYING INSTALL NEWS* install.sh \
dist/screen-$(VERSION)
ln configure.in configure dist/screen-$(VERSION)
sed -e 's@"/local/screens@"/tmp/screens@' -e 's@"/local@"/usr/local@g' < config.h.in > dist/screen-$(VERSION)/config.h.in
@@ -176,7 +179,7 @@ screen-$(VERSION).tar: term.h comm.h tty.c kmapdef.c
mkdir dist/screen-$(VERSION)/etc
cd etc; ln * ../dist/screen-$(VERSION)/etc
sed -e 's/^startup/#startup/' -e 's/^autodetach/#autodetach/' < $(ETCSCREENRC) > dist/screen-$(VERSION)/etc/etcscreenrc
- cp $(HOME)/.iscreenrc dist/screen-$(VERSION)/etc/screenrc
+ cp $(HOME)/.screenrc dist/screen-$(VERSION)/etc/screenrc
mkdir dist/screen-$(VERSION)/doc
sed -e 's@/local/emacs@/usr/local@g' < doc/Makefile.in > dist/screen-$(VERSION)/doc/Makefile.in
cd doc; ln FAQ screen.1 screen.texinfo fdpat.ps \
@@ -185,7 +188,7 @@ screen-$(VERSION).tar: term.h comm.h tty.c kmapdef.c
../dist/screen-$(VERSION)/doc; fi
cd dist/screen-$(VERSION)/doc; ln -s ../install.sh .
cd dist/screen-$(VERSION); ln -s doc/FAQ .
- echo "install all Makefiles config:" > dist/screen-$(VERSION)/Makefile
+ echo "install all Makefiles and config:" > dist/screen-$(VERSION)/Makefile
echo " sh ./configure" >> dist/screen-$(VERSION)/Makefile
cd dist; tar chf ../screen-$(VERSION).tar screen-$(VERSION)
rm -rf dist
@@ -224,47 +227,27 @@ depend: $(CFILES) term.h
screen.o socket.o: Makefile
### Dependencies:
-screen.o: screen.c acl.h ansi.h comm.h config.h display.h extern.h \
- os.h osdef.h overlay.h patchlevel.h rcs.h screen.h term.h window.h
-ansi.o: ansi.c acl.h ansi.h comm.h config.h display.h extern.h os.h \
- osdef.h overlay.h rcs.h screen.h term.h window.h
-fileio.o: fileio.c acl.h ansi.h comm.h config.h display.h extern.h \
- os.h osdef.h overlay.h rcs.h screen.h term.h window.h
-mark.o: mark.c acl.h ansi.h comm.h config.h display.h extern.h mark.h \
- os.h osdef.h overlay.h rcs.h screen.h term.h window.h
-misc.o: misc.c acl.h ansi.h comm.h config.h display.h extern.h os.h \
- osdef.h overlay.h rcs.h screen.h term.h window.h
-resize.o: resize.c acl.h ansi.h comm.h config.h display.h extern.h \
- os.h osdef.h overlay.h rcs.h screen.h term.h window.h
-socket.o: socket.c acl.h ansi.h comm.h config.h display.h extern.h \
- os.h osdef.h overlay.h rcs.h screen.h term.h window.h
-search.o: search.c acl.h ansi.h comm.h config.h display.h extern.h \
- mark.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
-tty.o: tty.c acl.h ansi.h comm.h config.h display.h extern.h os.h \
- osdef.h overlay.h rcs.h screen.h term.h window.h
+screen.o: screen.c acls.h ansi.h comm.h config.h display.h extern.h image.h os.h osdef.h overlay.h patchlevel.h rcs.h screen.h term.h window.h
+ansi.o: ansi.c acls.h ansi.h comm.h config.h display.h extern.h image.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
+fileio.o: fileio.c acls.h ansi.h comm.h config.h display.h extern.h image.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
+mark.o: mark.c acls.h ansi.h comm.h config.h display.h extern.h image.h mark.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
+misc.o: misc.c acls.h ansi.h comm.h config.h display.h extern.h image.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
+resize.o: resize.c acls.h ansi.h comm.h config.h display.h extern.h image.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
+socket.o: socket.c acls.h ansi.h comm.h config.h display.h extern.h image.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
+search.o: search.c acls.h ansi.h comm.h config.h display.h extern.h image.h mark.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
+tty.o: tty.c acls.h ansi.h comm.h config.h display.h extern.h image.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
term.o: term.c rcs.h term.h
-window.o: window.c acl.h ansi.h comm.h config.h display.h extern.h \
- os.h osdef.h overlay.h rcs.h screen.h term.h window.h
-utmp.o: utmp.c acl.h ansi.h comm.h config.h display.h extern.h os.h \
- osdef.h overlay.h rcs.h screen.h term.h window.h
-loadav.o: loadav.c acl.h ansi.h comm.h config.h display.h extern.h \
- os.h osdef.h overlay.h rcs.h screen.h term.h window.h
+window.o: window.c acls.h ansi.h comm.h config.h display.h extern.h image.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
+utmp.o: utmp.c acls.h ansi.h comm.h config.h display.h extern.h image.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
+loadav.o: loadav.c acls.h ansi.h comm.h config.h display.h extern.h image.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
putenv.o: putenv.c config.h rcs.h
-help.o: help.c acl.h ansi.h comm.h config.h display.h extern.h os.h \
- osdef.h overlay.h rcs.h screen.h term.h window.h
-termcap.o: termcap.c acl.h ansi.h comm.h config.h display.h extern.h \
- os.h osdef.h overlay.h rcs.h screen.h term.h window.h
-input.o: input.c acl.h ansi.h comm.h config.h display.h extern.h os.h \
- osdef.h overlay.h rcs.h screen.h term.h window.h
-attacher.o: attacher.c acl.h ansi.h comm.h config.h display.h extern.h \
- os.h osdef.h overlay.h rcs.h screen.h term.h window.h
-pty.o: pty.c acl.h ansi.h comm.h config.h display.h extern.h os.h \
- osdef.h overlay.h rcs.h screen.h term.h window.h
-process.o: process.c acl.h ansi.h comm.h config.h display.h extern.h \
- os.h osdef.h overlay.h rcs.h screen.h term.h window.h
-display.o: display.c acl.h ansi.h comm.h config.h display.h extern.h \
- os.h osdef.h overlay.h rcs.h screen.h term.h window.h
-comm.o: comm.c acl.h comm.h config.h rcs.h
+help.o: help.c acls.h ansi.h comm.h config.h display.h extern.h image.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
+termcap.o: termcap.c acls.h ansi.h comm.h config.h display.h extern.h image.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
+input.o: input.c acls.h ansi.h comm.h config.h display.h extern.h image.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
+attacher.o: attacher.c acls.h ansi.h comm.h config.h display.h extern.h image.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
+pty.o: pty.c acls.h ansi.h comm.h config.h display.h extern.h image.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
+process.o: process.c acls.h ansi.h comm.h config.h display.h extern.h image.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
+display.o: display.c acls.h ansi.h comm.h config.h display.h extern.h image.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
+comm.o: comm.c acls.h comm.h config.h rcs.h
kmapdef.o: kmapdef.c config.h
-acl.o: acl.c acl.h ansi.h comm.h config.h display.h extern.h os.h \
- osdef.h overlay.h rcs.h screen.h term.h window.h
+acls.o: acls.c acls.h ansi.h comm.h config.h display.h extern.h image.h os.h osdef.h overlay.h rcs.h screen.h term.h window.h
diff --git a/src/NEWS b/src/NEWS
index 6d4360f..0224ff3 100644
--- a/src/NEWS
+++ b/src/NEWS
@@ -1,48 +1,80 @@
----------------------------
- What's new in screen-3.6 ?
+ What's new in screen-3.7 ?
----------------------------
-* Input translation! This makes the vt100 emulation complete.
- As an addition it is now possible to bind any command to any
- (function-) key. See the man page for more details (bindkey
- command).
+* Color support. Screen understands the following capabilities:
+ AF (setaf) = Set foreground color (ANSI compatible)
+ AB (setab) = Set background color (ANSI compatible)
+ AX = Does understand ANSI set default fg/bg color
+ (\E[39m / \E[49m)
+ The tweaks for the color xterm would be:
+ termcap xterm 'AF=\E[3%dm:AB=\E[4%dm'
+ terminfo xterm 'AF=\E[3%p1%dm:AB=\E[4%p1%dm'
+ Caution: Screen exposes a bug in X11R6 color xterm. Either use the
+ patch ftp.uni-erlangen.de:pub/utilities/screen/color_xterm_patch
+ or a clean rewrite of xterm: rxvt.
-* Status line support. Each window can have a different status line.
- Use the ANSI APC string to set the status line, i.e.:
- <ESC>_<status string><ESC>\
- (For convenience the xterm sequence is also accepted.)
- You may want to add
- termcap * '' ':hs:ts=\E_:fs=\E\\:ds=\E_\E\\:'
- terminfo * '' ':hs:ts=\E_:fs=\E\\:ds=\E_\E\\:'
- to your ~/.screenrc to make screen advertise the hardstatus
- support.
-
-* Zombie feature added. Windows now may generate a message (with a
- timestamp) if they die and stay around until the user presses
- a key.
+* Resize code completely rewritten. Long lines now get rewrapped,
+ no information gets lost when a window is narrowed and widened. This
+ affects both the visible window and its scrollback buffer. It is a
+ big improvement for the latter. In previous versions the scrollback
+ buffer was clipped when the window narrowed and padded with
+ whitespace when it widened.
-* New paste syntax: Paste can now concatenate registers and paste
- either on screen or in anouther register.
- This makes the old "ins_reg", "copy_reg" commands obsolete.
+* Input handling changed. The command key can now be a prefix
+ of a function key sequence (hello wyse users :) )
-* More architecures supported. Screen now runs on AIX3.2.5,
- Solaris, NeXT and some other exotic platforms.
+* An empty argument to the escape command is allowed to disable
+ command key processing. This is only allowed if some key
+ is bound to the "command" command. This example makes F1 the
+ new command key and allows the previous command key (usually ^A)
+ to be typed directly:
+ bindkey -k k1 command
+ escape ""
-* Kanji support added. Screen understands JIS, EUC and SJIS coding.
- This is an experimental feature.
+* New 'digraph' command (bound to ^A^V)
+ ^A^Va" or ^A^V0344 input an a-umlaut
+ This helps if you want to work in an ISO-latin1 environment but your
+ terminal's keyboard lacks a some of the more special characters.
-* GR charset switching (ISO 2022) implemented. Can be enabled with
- the "gr" command.
+* activity/bell message strings can now include the window title
+ and the current date/time:
+ %t - title
+ %n - number (a single % still works)
+ %d - day
+ %D - weekday name
+ %m - month
+ %M - month name
+ %y - year (2 digit)
+ %Y - year (4 digit)
+ %w - hour:minutes (24h format)
+ %W - hour:minutes (12h format)
+ %s - seconds
+ %a - am/pm
+ %A - AM/PM
+ Please do not use a single '%' character for window titles any more.
+ It is obsoleted by '%n' and will vanish in future releases.
-* C1 sequences implemented (see the "c1" command).
+* 'defhstatus' command to give every window a default
+ hardstatus line. '^E' is used as a string escape instead of '%'.
+ All the above substitution codes apply, but you must use ^E (octal
+ 005) here, as '%' is likely to appear in automaticaly generated
+ hardstatus lines. Try 'defhstatus "Screen: window ^E (^Et)"'.
-* Tek support from Xiaoguang Zhang. Apply tek.patch if you want to
- make screen pass tek sequences.
+* In screenrc files and colon command mode: Input parser changed to
+ also understand caret notation ('^') to mean "Control-" (as in
+ the ^E example above).
-* List of new commands:
- bindkey, c1, command, defc1, defgr, defkanji, gr, kanji, mapdefault,
- mapnotnext, maptimeout, pastefont, printcmd, readreg, stuff, zombie
+* "logdir" command changed to "logfile". You can now specify the
+ filename instead of the directory. The same directives as
+ understood by the activity/bell messages can be used.
+ The default is "screenlog.%n".
-* Lots of other bugs fixed.
+* Special terminfo workaround make delay processing work for
+ the first time! If you had trouble with padding, then try again.
+
+* New incomprehensible capability XC added to specify character
+ translation depending on the terminal type. See the manual for
+ more details and examples.
diff --git a/src/NEWS.3.5 b/src/NEWS.3.5
new file mode 100644
index 0000000..d0d1970
--- /dev/null
+++ b/src/NEWS.3.5
@@ -0,0 +1,119 @@
+
+ ----------------------------
+ What's new in screen-3.5 ?
+ ----------------------------
+
+
+* Texinfo manpage! Thanks to Jason Merrill.
+
+* Screen now has a very large 'configure' script. If you have
+ problems with the resulting configuration please send mail to
+ screen@uni-erlangen.de.
+
+* Stackable overlay planes.
+ All commands are available even if you work with an overlay. Thus
+ you can be in copy/paste mode on several windows!
+
+* Unification of key bindings and screen commands. All keys now generate
+ commands.
+
+* Screen now reads/writes only in asyncronous mode.
+
+* Ansi parser speedup code resulting in much faster output of text.
+
+* Changed the rc file syntax. Commands now directly affect the current
+ window. The default settings are changed with 'def...' commands.
+ The 'set' keyword no longer exists.
+ Please run the 'newsyntax' script on your old screenrc files!
+
+* Emacs style isearch added to copy mode. Try ^A ESC ^R screen ^R ^R
+ to locate the last three occurences of the word 'screen' in the
+ history buffer.
+
+* New command 'silence'. Alarms the user whenever there was inactivity
+ for a specified amount of time on a certain window.
+ Useful if you want to wait for a compilation to end.
+
+* Much better margin handling:
+ Screen now handles autowrapped lines correctly in the redisplay and
+ copy/paste functions.
+
+* New commands for pastebuffer management:
+ 'copy_reg' copies the pastebuffer to a register,
+ 'ins_reg' pastes a register,
+ 'register' fills a register with a string,
+ 'process' stuffs a register into strings input queue.
+
+* Autonuke feature. Flush the output buffer if the window gets
+ cleared. Enable this with 'autonuke on'.
+
+* Modifications to save memory: Empty attribute and font lines don't
+ get allocated. This is very useful if you have a lage scrollback.
+
+* Multi display support:
+ You can now attach from more than one terminal to a session with
+ the '-x' option.
+
+* New option '-S' to specify socket name.
+
+* Experimental multiuser support added:
+ You can start screen in multiuser Mode by prepending the socket
+ name with a '/' (or by the command 'multiuser on').
+ If another user wants to attach to the screen session, he can do
+ this by prepending the socketname with 'screenuser/'.
+ Of course he must be in the access control list for a successful
+ attach (see the acladd/acldel command).
+
+* Extension to the 'screen' command: You can now specify tty lines
+ instead of programs. This can be used for console management.
+ Added the command 'break' to send a break to the tty line.
+ Not really a new feature, but terminal initialisation now works
+ on suns.
+
+* Input/output filters added. This has been implemented to allow the
+ user to configure an open tty line, but got soon exended to allow
+ all sorts of filters. For more information read the explanation
+ of the 'exec' command in the man page and check the 'fdpat.ps'
+ document.
+
+* Screen can now be started detached (screen -d -m -S sockname).
+ This is usefull if you want to start screen in your /etc/rc file
+ (e.g. as a console multiplexer)
+
+* Console grabbing added ('console on' command).
+
+* Windows can now be selected by akas, too. (Per default bound to the
+ >'< key.)
+
+* New terminal capabiliteise CS/CE for cursorkey control.
+
+* setenv/unsetenv commands added.
+
+* Expansion of environment variables ($VAR) and terminal capabilities
+ ($:TC:) in the screenrc files and detach messages.
+ Example: pow_detach_msg "Session of \$LOGNAME \$:cr:\$:nl:ended."
+
+* New commands:
+ 'hardcopydir' and 'logdir' to change the output directories,
+ 'partial' and 'allpartial' to make screen only refresh the line
+ containing the cursor if a window is selected (useful for slow
+ modem connections).
+
+* Cleanup of the provided termcap/terminfo file. Please install
+ the new one!
+
+* The program 'terminfo/checktc.c' does a visual check of a
+ termcap/terminfo entry. Please try it before calling screen and
+ in a screen session.
+
+* LOTS of bugfixes and code cleanup.
+
+Thanks to all the beta testers who helped porting screen to at least
+the following platforms: Ultrix, SunOS, Solaris, BSD43, linux, NEWSOS,
+Irix, OSF/1, Harris CX/UX, hpux, dynix/ptx, AIX.
+And even more thanks to the brave who attempted to use the 'exec'
+command features.
+
+ Donnate patches, bugreports, suggestions, money, beer & pizza to
+ screen@uni-erlangen.de
+
diff --git a/src/NEWS.3.6 b/src/NEWS.3.6
new file mode 100644
index 0000000..6d4360f
--- /dev/null
+++ b/src/NEWS.3.6
@@ -0,0 +1,48 @@
+
+ ----------------------------
+ What's new in screen-3.6 ?
+ ----------------------------
+
+* Input translation! This makes the vt100 emulation complete.
+ As an addition it is now possible to bind any command to any
+ (function-) key. See the man page for more details (bindkey
+ command).
+
+* Status line support. Each window can have a different status line.
+ Use the ANSI APC string to set the status line, i.e.:
+ <ESC>_<status string><ESC>\
+ (For convenience the xterm sequence is also accepted.)
+ You may want to add
+ termcap * '' ':hs:ts=\E_:fs=\E\\:ds=\E_\E\\:'
+ terminfo * '' ':hs:ts=\E_:fs=\E\\:ds=\E_\E\\:'
+ to your ~/.screenrc to make screen advertise the hardstatus
+ support.
+
+* Zombie feature added. Windows now may generate a message (with a
+ timestamp) if they die and stay around until the user presses
+ a key.
+
+* New paste syntax: Paste can now concatenate registers and paste
+ either on screen or in anouther register.
+ This makes the old "ins_reg", "copy_reg" commands obsolete.
+
+* More architecures supported. Screen now runs on AIX3.2.5,
+ Solaris, NeXT and some other exotic platforms.
+
+* Kanji support added. Screen understands JIS, EUC and SJIS coding.
+ This is an experimental feature.
+
+* GR charset switching (ISO 2022) implemented. Can be enabled with
+ the "gr" command.
+
+* C1 sequences implemented (see the "c1" command).
+
+* Tek support from Xiaoguang Zhang. Apply tek.patch if you want to
+ make screen pass tek sequences.
+
+* List of new commands:
+ bindkey, c1, command, defc1, defgr, defkanji, gr, kanji, mapdefault,
+ mapnotnext, maptimeout, pastefont, printcmd, readreg, stuff, zombie
+
+* Lots of other bugs fixed.
+
diff --git a/src/acl.c b/src/acls.c
index 3a1da4c..98338ed 100644
--- a/src/acl.c
+++ b/src/acls.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -25,7 +26,7 @@ RCS_ID("$Id$ FAU")
#include <sys/types.h>
#include "config.h"
-#include "screen.h" /* includes acl.h */
+#include "screen.h" /* includes acls.h */
#include "extern.h"
@@ -114,8 +115,8 @@ char *name;
return u;
}
-char DefaultEsc = Ctrl('a');
-char DefaultMetaEsc = 'a';
+int DefaultEsc = Ctrl('a');
+int DefaultMetaEsc = 'a';
/*
* Add a new user. His password may be NULL or "" if none.
@@ -235,7 +236,7 @@ struct user **up;
if (!up)
up = FindUserPtr(name);
- if (!(u = *up))
+ if ((u = *up) == 0)
return -1; /* he who does not exist cannot be removed */
old = display;
for (display = displays; display; display = next)
@@ -455,7 +456,7 @@ char *mode, *s;
default:
for (p = s; *p && *p != ' ' && *p != '\t' && *p != ','; p++)
;
- if ((ch = *p))
+ if ((ch = *p) != 0)
*p++ = '\0';
if ((i = FindCommnr(s)) != RC_ILLEGAL)
AclSetPermCmd(u, mode, &comms[i]);
diff --git a/src/acl.h b/src/acls.h
index 82d1c09..3243688 100644
--- a/src/acl.h
+++ b/src/acls.h
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
* RCS_ID("$Id$ FAU")
@@ -74,7 +75,7 @@ typedef struct user
char u_name[20+1]; /* login name how he showed up */
char u_password[20+1]; /* his password (may be zero length). */
int u_detachwin; /* the window where he last detached */
- char u_Esc, u_MetaEsc; /* the users screen escape character */
+ int u_Esc, u_MetaEsc; /* the users screen escape character */
#ifdef COPY_PASTE
char *u_copybuffer;
int u_copylen;
@@ -84,5 +85,5 @@ typedef struct user
#endif
} User;
-extern char DefaultEsc, DefaultMetaEsc;
+extern int DefaultEsc, DefaultMetaEsc;
diff --git a/src/ansi.c b/src/ansi.c
index 1a135a1..7519b16 100644
--- a/src/ansi.c
+++ b/src/ansi.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -46,8 +47,6 @@ extern time_t Now;
extern struct NewWindow nwin_default; /* for ResetWindow() */
extern int nversion;
-int maxwidth; /* maximum of all widths so far */
-
int Z0width, Z1width; /* widths for Z0/Z1 switching */
static struct win *curr; /* window we are working on */
@@ -59,7 +58,14 @@ char *printcmd = 0;
char *blank; /* line filled with spaces */
char *null; /* line filled with '\0' */
-char *OldImage, *OldAttr, *OldFont; /* temporary buffers */
+
+struct mline mline_old;
+struct mline mline_blank;
+struct mline mline_null;
+
+struct mchar mchar_null;
+struct mchar mchar_blank = {' ' /* , 0, 0, ... */};
+struct mchar mchar_so = {' ', A_SO /* , 0, 0, ... */};
static void WinProcess __P((char **, int *));
static void WinRedisplayLine __P((int, int, int, int));
@@ -71,7 +77,7 @@ static void WinRestore __P((void));
static int Special __P((int));
static void DoESC __P((int, int));
static void DoCSI __P((int, int));
-static void SetChar __P((int, int));
+static void SetChar __P((int));
static void StartString __P((enum string_t));
static void SaveChar __P((int));
static void PrintStart __P((void));
@@ -86,7 +92,7 @@ static void BackSpace __P((void));
static void Return __P((void));
static void LineFeed __P((int));
static void ReverseLineFeed __P((void));
-static void InsertAChar __P((int, int));
+static void InsertAChar __P((int));
static void InsertChar __P((int));
static void DeleteChar __P((int));
static void DeleteLine __P((int));
@@ -109,13 +115,17 @@ static void CursorDown __P((int));
static void CursorLeft __P((int));
static void ASetMode __P((int));
static void SelectRendition __P((void));
-static void RestorePosAttrFont __P((void));
+static void RestorePosRendition __P((void));
static void FillWithEs __P((void));
-static void UpdateLine __P((char *, char *, char *, int, int, int ));
+static void UpdateLine __P((struct mline *, int, int, int ));
static void FindAKA __P((void));
static void Report __P((char *, int, int));
static void FixLine __P((void));
static void ScrollRegion __P((int));
+static void CheckLP __P((int));
+#ifdef COPY_PASTE
+static void AddLineToHist __P((struct win *, struct mline *));
+#endif
/*
@@ -256,8 +266,8 @@ int y, from, to, isblank;
if (y < 0)
return;
fore = D_fore;
- DisplayLine(isblank ? blank: null, null, null, fore->w_image[y],
- fore->w_attr[y], fore->w_font[y], y, from, to);
+ DisplayLine(isblank ? &mline_blank : &mline_null, &fore->w_mlines[y],
+ y, from, to);
}
static int
@@ -266,26 +276,37 @@ int y, x1, x2, doit;
{
register int cost, dx;
register char *p, *f, *i;
+#ifdef COLOR
+ register char *c;
+#endif
fore = D_fore;
dx = x2 - x1;
if (doit)
{
- i = fore->w_image[y] + x1;
+ i = fore->w_mlines[y].image + x1;
while (dx-- > 0)
PUTCHAR(*i++);
- return(0);
+ return 0;
}
- p = fore->w_attr[y] + x1;
- f = fore->w_font[y] + x1;
+ p = fore->w_mlines[y].attr + x1;
+ f = fore->w_mlines[y].font + x1;
+#ifdef COLOR
+ c = fore->w_mlines[y].color + x1;
+#endif
cost = dx = x2 - x1;
if (D_insert)
cost += D_EIcost + D_IMcost;
while(dx-- > 0)
{
- if (*p++ != D_attr || *f++ != D_font)
+#ifdef COLOR
+ if (*p++ != D_rend.attr || *f++ != D_rend.font || *c++ != D_rend.color)
return EXPENSIVE;
+#else
+ if (*p++ != D_rend.attr || *f++ != D_rend.font)
+ return EXPENSIVE;
+#endif
}
return cost;
}
@@ -295,8 +316,7 @@ WinClearLine(y, xs, xe)
int y, xs, xe;
{
fore = D_fore;
- DisplayLine(fore->w_image[y], fore->w_attr[y], fore->w_font[y],
- blank, null, null, y, xs, xe);
+ DisplayLine(&fore->w_mlines[y], &mline_blank, y, xs, xe);
}
static void
@@ -312,7 +332,7 @@ int wi, he;
{
fore = D_fore;
if (fore)
- ChangeWindowSize(fore, wi, he);
+ ChangeWindowSize(fore, wi, he, fore->w_histheight);
return 0;
}
@@ -326,7 +346,7 @@ WinRestore()
SetFlow(fore->w_flow & FLOW_NOW);
InsertMode(fore->w_insert);
ReverseVideo(fore->w_revvid);
- CursorInvisible(fore->w_curinv);
+ CursorVisibility(fore->w_curinv ? -1 : fore->w_curvvis);
fore->w_active = 1;
}
@@ -341,7 +361,11 @@ int norefresh;
debug1("Activate(%d)\n", norefresh);
if (display == 0)
return;
- RemoveStatus();
+ if (D_status)
+ {
+ Msg(0, "%s", ""); /* wait till mintime (keep gcc quiet) */
+ RemoveStatus();
+ }
fore = D_fore;
if (fore)
{
@@ -371,87 +395,108 @@ register struct win *p;
p->w_insert = 0;
p->w_revvid = 0;
p->w_curinv = 0;
+ p->w_curvvis = 0;
p->w_autolf = 0;
p->w_keypad = 0;
p->w_cursorkeys = 0;
p->w_top = 0;
p->w_bot = p->w_height - 1;
p->w_saved = 0;
- p->w_Attr = 0;
- p->w_Font = 0;
- p->w_FontR = 0;
p->w_x = p->w_y = 0;
p->w_state = LIT;
p->w_StringType = NONE;
bzero(p->w_tabs, p->w_width);
for (i = 8; i < p->w_width; i += 8)
p->w_tabs[i] = 1;
+ p->w_rend = mchar_null;
ResetCharsets(p);
}
+#ifdef KANJI
+static char *kanjicharsets[3] = {
+ "BBBB02", /* jis */
+ "\002IBB01", /* euc */
+ "BIBB01" /* sjis */
+};
+#endif
+
void
ResetCharsets(p)
register struct win *p;
{
- int i;
-
- p->w_Charset = G0;
- p->w_CharsetR = G2;
- for (i = G0; i <= G3; i++)
- p->w_charsets[i] = ASCII;
p->w_gr = nwin_default.gr;
p->w_c1 = nwin_default.c1;
- p->w_ss = 0;
+ SetCharsets(p, "BBBB02");
+ if (nwin_default.charset)
+ SetCharsets(p, nwin_default.charset);
#ifdef KANJI
- switch(p->w_kanji)
+ if (p->w_kanji)
{
- case SJIS:
- p->w_CharsetR = G1;
- p->w_charsets[G1] = KANA;
p->w_gr = 1;
- p->w_c1 = 0;
- break;
- case EUC:
- p->w_CharsetR = G1;
- p->w_charsets[G1] = KANJI;
- p->w_charsets[G2] = KANA;
- p->w_gr = 1;
- p->w_c1 = 1;
- break;
- default:
- break;
+ if (p->w_kanji == SJIS)
+ p->w_c1 = 0;
+ SetCharsets(p, kanjicharsets[p->w_kanji]);
}
#endif
- p->w_Font = p->w_charsets[p->w_Charset];
+}
+
+void
+SetCharsets(p, s)
+struct win *p;
+char *s;
+{
+ int i;
+
+ for (i = 0; i < 4 && *s; i++, s++)
+ if (*s != '.')
+ p->w_charsets[i] = ((*s == 'B') ? ASCII : *s);
+ if (*s && *s++ != '.')
+ p->w_Charset = s[-1] - '0';
+ if (*s && *s != '.')
+ p->w_CharsetR = *s - '0';
+ p->w_ss = 0;
+ p->w_FontL = p->w_charsets[p->w_Charset];
p->w_FontR = p->w_charsets[p->w_CharsetR];
}
static void
FixLine()
{
- if (curr->w_Attr && curr->w_attr[curr->w_y] == null)
+ struct mline *ml = &curr->w_mlines[curr->w_y];
+ if (curr->w_rend.attr && ml->attr == null)
{
- if ((curr->w_attr[curr->w_y] = (char *)malloc(curr->w_width + 1)) == 0)
+ if ((ml->attr = (char *)malloc(curr->w_width + 1)) == 0)
{
- curr->w_attr[curr->w_y] = null;
- curr->w_Attr = 0;
+ ml->attr = null;
+ curr->w_rend.attr = 0;
Msg(0, "Warning: no space for attr - turned off");
}
- else
- bzero(curr->w_attr[curr->w_y], curr->w_width + 1);
+ bzero(ml->attr, curr->w_width + 1);
}
- if ((curr->w_Font || curr->w_FontR) && curr->w_font[curr->w_y] == null)
+ if ((curr->w_FontL || curr->w_FontR) && ml->font == null)
{
- if ((curr->w_font[curr->w_y] = (char *)malloc(curr->w_width + 1)) == 0)
+ if ((ml->font = (char *)malloc(curr->w_width + 1)) == 0)
{
- curr->w_font[curr->w_y] = null;
- curr->w_Font = curr->w_charsets[curr->w_ss ? curr->w_ss : curr->w_Charset] = 0;
+ ml->font = null;
+ curr->w_FontL = curr->w_charsets[curr->w_ss ? curr->w_ss : curr->w_Charset] = 0;
curr->w_FontR = curr->w_charsets[curr->w_ss ? curr->w_ss : curr->w_CharsetR] = 0;
+ curr->w_rend.font = 0;
Msg(0, "Warning: no space for font - turned off");
}
- else
- bzero(curr->w_font[curr->w_y], curr->w_width + 1);
+ bzero(ml->font, curr->w_width + 1);
}
+#ifdef COLOR
+ if (curr->w_rend.color && ml->color == null)
+ {
+ if ((ml->color = (char *)malloc(curr->w_width + 1)) == 0)
+ {
+ ml->color = null;
+ curr->w_rend.color = 0;
+ Msg(0, "Warning: no space for color - turned off");
+ }
+ bzero(ml->color, curr->w_width + 1);
+ }
+#endif
}
@@ -495,38 +540,54 @@ register int len;
curr->w_monitor = MON_FOUND;
}
}
+
do
{
c = (unsigned char)*buf++;
+ curr->w_rend.font = curr->w_FontL; /* Default: GL */
- /* The next part is only for speedup */
+ /* The next part is only for speedup
+ * (therefore no mchars are used) */
if (curr->w_state == LIT &&
#ifdef KANJI
- curr->w_Font != KANJI && curr->w_Font != KANA && !curr->w_mbcs &&
+ curr->w_FontL != KANJI && curr->w_FontL != KANA && !curr->w_mbcs &&
#endif
c >= ' ' &&
- ((c & 0x80) == 0 || ((c >= 0xa0 || !curr->w_c1) && !curr->w_gr && (display == 0 || !D_CB8))) &&
+ ((c & 0x80) == 0 || ((c >= 0xa0 || !curr->w_c1) && !curr->w_gr)) &&
!curr->w_insert && !curr->w_ss && curr->w_x < cols - 1)
{
register int currx;
register char *imp, *atp, *fop, at, fo;
+#ifdef COLOR
+ register char *cop, co;
+#endif
if (c == '\177')
continue;
FixLine();
currx = curr->w_x;
- imp = curr->w_image[curr->w_y] + currx;
- atp = curr->w_attr[curr->w_y] + currx;
- fop = curr->w_font[curr->w_y] + currx;
- at = curr->w_Attr;
- fo = curr->w_Font;
+ imp = curr->w_mlines[curr->w_y].image + currx;
+ atp = curr->w_mlines[curr->w_y].attr + currx;
+ fop = curr->w_mlines[curr->w_y].font + currx;
+ at = curr->w_rend.attr;
+ fo = curr->w_rend.font;
+#ifdef COLOR
+ cop = curr->w_mlines[curr->w_y].color + currx;
+ co = curr->w_rend.color;
+#endif
if (display)
{
if (D_x != currx || D_y != curr->w_y)
GotoPos(currx, curr->w_y);
- if (at != D_attr)
+ /* This is not SetRendition because the compiler would
+ * not use registers if at/fo/co would be an mchar */
+ if (at != D_rend.attr)
SetAttr(at);
- if (fo != D_font)
+#ifdef COLOR
+ if (co != D_rend.color)
+ SetColor(co);
+#endif
+ if (fo != D_rend.font)
SetFont(fo);
if (D_insert)
InsertMode(0);
@@ -534,17 +595,25 @@ register int len;
while (currx < cols - 1)
{
if (display)
- AddChar(D_font != '0' ? c : D_c0_tab[c]);
+ {
+ if (D_xtable && D_xtable[(int)(unsigned char)D_rend.font] && D_xtable[(int)(unsigned char)D_rend.font][c])
+ AddStr(D_xtable[(int)(unsigned char)D_rend.font][c]);
+ else
+ AddChar(D_rend.font != '0' ? c : D_c0_tab[c]);
+ }
*imp++ = c;
*atp++ = at;
*fop++ = fo;
+#ifdef COLOR
+ *cop++ = co;
+#endif
currx++;
skip: if (--len == 0)
break;
c = (unsigned char)*buf++;
if (c == '\177')
goto skip;
- if (c < ' ' || ((c & 0x80) && ((c < 0xa0 && curr->w_c1) || curr->w_gr || (display && D_CB8))))
+ if (c < ' ' || ((c & 0x80) && ((c < 0xa0 && curr->w_c1) || curr->w_gr)))
break;
}
curr->w_x = currx;
@@ -555,18 +624,6 @@ skip: if (--len == 0)
}
/* end of speedup code */
- if ((c & 0x80) && display && D_CB8)
- {
- FILE *logfp = wp->w_logfp;
- char *cb8 = D_CB8;
-
- wp->w_logfp = NULL; /* a little hack */
- D_CB8 = NULL; /* dito */
- WriteString(wp, cb8, (int)strlen(cb8));
- wp->w_logfp = logfp;
- D_CB8 = cb8;
- c &= 0x7f;
- }
tryagain:
switch (curr->w_state)
{
@@ -635,7 +692,7 @@ skip: if (--len == 0)
break;
}
/* special xterm hack: accept SetStatus sequence. Yucc! */
- if (!(curr->w_StringType == OSC && c < ' '))
+ if (!(curr->w_StringType == OSC && c < ' ' && c != '\005'))
if (!curr->w_c1 || c != ('\\' ^ 0xc0))
{
SaveChar(c);
@@ -748,6 +805,11 @@ skip: if (--len == 0)
case 'k':
StartString(AKA);
break;
+ case '\014':
+ curr->w_state = TEK;
+ RAW_PUTCHAR('\033');
+ RAW_PUTCHAR(c);
+ break;
default:
if (Special(c))
{
@@ -812,6 +874,27 @@ skip: if (--len == 0)
}
}
break;
+ case TEK:
+ switch (c)
+ {
+ case '@':
+ if ((unsigned char)*(buf - 2) == ' ') /* XXX: Yucc! */
+ curr->w_state = TEKESC;
+ /* FALLTHROUGH */
+ default:
+ RAW_PUTCHAR(c);
+ break;
+ }
+ break;
+ case TEKESC:
+ curr->w_state = (c == '\037') ? TEKEND : TEK;
+ RAW_PUTCHAR(c);
+ break;
+ case TEKEND:
+ if (c == '\030')
+ curr->w_state = LIT;
+ RAW_PUTCHAR(c);
+ break;
case LIT:
default:
if (c < ' ')
@@ -821,7 +904,7 @@ skip: if (--len == 0)
curr->w_intermediate = 0;
curr->w_state = ESC;
if (display && D_lp_missing && (D_CIC || D_IC || D_IM))
- UpdateLine(blank, null, null, D_bot, cols - 2, cols - 1);
+ UpdateLine(&mline_blank, D_bot, cols - 2, cols - 1);
if (curr->w_autoaka < 0)
curr->w_autoaka = 0;
}
@@ -843,7 +926,7 @@ skip: if (--len == 0)
break;
case 0xc0 ^ '[':
if (display && D_lp_missing && (D_CIC || D_IC || D_IM))
- UpdateLine(blank, null, null, D_bot, cols - 2, cols - 1);
+ UpdateLine(&mline_blank, D_bot, cols - 2, cols - 1);
if (curr->w_autoaka < 0)
curr->w_autoaka = 0;
curr->w_NumArgs = 0;
@@ -860,7 +943,7 @@ skip: if (--len == 0)
break;
}
- font = c >= 0x80 ? curr->w_FontR : curr->w_Font;
+ font = curr->w_rend.font = (c >= 0x80 ? curr->w_FontR : curr->w_FontL);
#ifdef KANJI
if (font == KANA && curr->w_kanji == SJIS && curr->w_mbcs == 0)
{
@@ -897,7 +980,7 @@ skip: if (--len == 0)
if (t <= 0x7e) t -= 0x1f;
else if (t <= 0x9e) t -= 0x20;
else t -= 0x7e, c++;
- font = KANJI;
+ curr->w_rend.font = KANJI;
}
else
{
@@ -920,21 +1003,16 @@ skip: if (--len == 0)
if (c == '\177')
break;
if (display)
- {
- if (D_attr != curr->w_Attr)
- SetAttr(curr->w_Attr);
- if (D_font != font)
- SetFont(font);
- }
+ SetRendition(&curr->w_rend);
if (curr->w_x < cols - 1)
{
if (curr->w_insert)
- InsertAChar(c, font);
+ InsertAChar(c);
else
{
if (display)
PUTCHAR(c);
- SetChar(c, font);
+ SetChar(c);
curr->w_x++;
}
}
@@ -943,11 +1021,11 @@ skip: if (--len == 0)
if (display && curr->w_wrap && (D_CLP || !force_vt || D_COP))
{
RAW_PUTCHAR(c); /* don't care about D_insert */
- SetChar(c, font);
+ SetChar(c);
curr->w_x++;
if (D_AM && !D_CLP)
{
- SetChar(0, 0);
+ SetChar(0);
LineFeed(0); /* terminal auto-wrapped */
}
}
@@ -963,34 +1041,33 @@ skip: if (--len == 0)
else
CheckLP(c);
}
- SetChar(c, font);
+ SetChar(c);
if (curr->w_wrap)
curr->w_x++;
}
}
else /* curr->w_x > cols - 1 */
{
- SetChar(0, 0); /* we wrapped */
+ SetChar(0); /* we wrapped */
if (curr->w_insert)
{
LineFeed(2); /* cr+lf, handle LP */
- InsertAChar(c, font);
+ InsertAChar(c);
}
else
{
if (display && D_AM && D_x != cols) /* write char again */
{
- SetAttrFont(curr->w_attr[curr->w_y][cols - 1],
- curr->w_font[curr->w_y][cols - 1]);
- RAW_PUTCHAR(curr->w_image[curr->w_y][cols - 1]);
- SetAttrFont(curr->w_Attr, font);
+ SetRenditionMline(&curr->w_mlines[curr->w_y], cols - 1);
+ RAW_PUTCHAR(curr->w_mlines[curr->w_y].image[cols - 1]);
+ SetRendition(&curr->w_rend);
if (curr->w_y == D_bot)
D_lp_missing = 0; /* just wrote it */
}
LineFeed((display == 0 || D_AM) ? 0 : 2);
if (display)
PUTCHAR(c);
- SetChar(c, font);
+ SetChar(c);
curr->w_x = 1;
}
}
@@ -1004,8 +1081,9 @@ skip: if (--len == 0)
#endif
if (curr->w_ss)
{
- SetFont(curr->w_Font = curr->w_charsets[curr->w_Charset]);
+ curr->w_FontL = curr->w_charsets[curr->w_Charset];
curr->w_FontR = curr->w_charsets[curr->w_CharsetR];
+ SetFont(curr->w_FontL);
curr->w_ss = 0;
}
break;
@@ -1097,7 +1175,7 @@ int c, intermediate;
case 'c':
ClearScreen();
ResetWindow(curr);
- SetAttrFont(0, ASCII);
+ SetRendition(&mchar_null);
InsertMode(0);
KeypadMode(0);
CursorkeysMode(0);
@@ -1133,19 +1211,25 @@ int c, intermediate;
case 'N': /* SS2 */
if (curr->w_charsets[curr->w_Charset] != curr->w_charsets[G2]
|| curr->w_charsets[curr->w_CharsetR] != curr->w_charsets[G2])
- {
- curr->w_FontR = curr->w_Font = curr->w_charsets[curr->w_ss = G2];
- }
+ curr->w_FontR = curr->w_FontL = curr->w_charsets[curr->w_ss = G2];
else
curr->w_ss = 0;
break;
case 'O': /* SS3 */
if (curr->w_charsets[curr->w_Charset] != curr->w_charsets[G3]
|| curr->w_charsets[curr->w_CharsetR] != curr->w_charsets[G3])
- curr->w_FontR = curr->w_Font = curr->w_charsets[curr->w_ss = G3];
+ curr->w_FontR = curr->w_FontL = curr->w_charsets[curr->w_ss = G3];
else
curr->w_ss = 0;
break;
+ case 'g': /* VBELL, private screen sequence */
+ if (display == 0)
+ curr->w_bell = BELL_ON;
+ else if (!D_VB)
+ curr->w_bell = BELL_VISUAL;
+ else
+ PutStr(D_VB);
+ break;
}
break;
case '#':
@@ -1319,7 +1403,7 @@ int c, intermediate;
}
if (a1 == curr->w_width && a2 == curr->w_height)
break;
- ChangeWindowSize(curr, a1, a2);
+ ChangeWindowSize(curr, a1, a2, curr->w_histheight);
SetCurr(curr);
if (display)
Activate(0);
@@ -1377,7 +1461,10 @@ int c, intermediate;
break;
case 'p': /* obscure code from a 97801 term */
if (a1 == 6 || a1 == 7)
- CursorInvisible(curr->w_curinv = 7 - a1);
+ {
+ curr->w_curinv = 7 - a1;
+ CursorVisibility(curr->w_curinv ? -1 : curr->w_curvvis);
+ }
break;
case 'S': /* obscure code from a 97801 term */
ScrollRegion(a1 ? a1 : 1);
@@ -1412,7 +1499,7 @@ int c, intermediate;
#endif
curr->w_charsets[0] = curr->w_charsets[1] =
curr->w_charsets[2] = curr->w_charsets[2] =
- curr->w_Font = curr->w_FontR = ASCII;
+ curr->w_FontL = curr->w_FontR = ASCII;
curr->w_Charset = 0;
curr->w_CharsetR = 2;
curr->w_ss = 0;
@@ -1422,7 +1509,7 @@ int c, intermediate;
i = (i ? Z0width : Z1width);
if (curr->w_width != i && (display == 0 || (D_CZ0 || D_CWS)))
{
- ChangeWindowSize(curr, i, curr->w_height);
+ ChangeWindowSize(curr, i, curr->w_height, curr->w_histheight);
SetCurr(curr); /* update rows/cols */
if (display)
Activate(0);
@@ -1433,6 +1520,7 @@ int c, intermediate;
/* This should be reverse video.
* Because it is used in some termcaps to emulate
* a visual bell we do this hack here.
+ * (screen uses \Eg as special vbell sequence)
*/
if (i)
ReverseVideo(1);
@@ -1473,7 +1561,8 @@ int c, intermediate;
/* case 14: TEM: transmit execution mode */
/* case 16: EKEM: edit key execution mode */
case 25: /* TCEM: text cursor enable mode */
- CursorInvisible(curr->w_curinv = !i);
+ curr->w_curinv = !i;
+ CursorVisibility(curr->w_curinv ? -1 : curr->w_curvvis);
break;
/* case 40: 132 col enable */
/* case 42: NRCM: 7bit NRC character mode */
@@ -1494,16 +1583,21 @@ int c, intermediate;
}
+/*
+ * Store char in mline. Be sure, that w_Font is set correctly!
+ */
+
static void
-SetChar(c, f)
-register int c, f;
+SetChar(c)
+register int c;
{
register struct win *p = curr;
+ register struct mline *ml;
FixLine();
- p->w_image[p->w_y][p->w_x] = c;
- p->w_attr[p->w_y][p->w_x] = p->w_Attr;
- p->w_font[p->w_y][p->w_x] = f;
+ ml = &p->w_mlines[p->w_y];
+ p->w_rend.image = c;
+ copy_mchar2mline(&p->w_rend, ml, p->w_x);
}
static void
@@ -1641,7 +1735,7 @@ int c, n;
{
curr->w_charsets[n] = c;
if (curr->w_Charset == n)
- SetFont(curr->w_Font = c);
+ SetFont(curr->w_FontL = c);
if (curr->w_CharsetR == n)
curr->w_FontR = c;
}
@@ -1655,7 +1749,7 @@ int n;
if (curr->w_Charset != n)
{
curr->w_Charset = n;
- SetFont(curr->w_Font = curr->w_charsets[n]);
+ SetFont(curr->w_FontL = curr->w_charsets[n]);
}
}
@@ -1678,7 +1772,7 @@ SaveCursor()
curr->w_saved = 1;
curr->w_Saved_x = curr->w_x;
curr->w_Saved_y = curr->w_y;
- curr->w_SavedAttr = curr->w_Attr;
+ curr->w_SavedRend= curr->w_rend;
curr->w_SavedCharset = curr->w_Charset;
curr->w_SavedCharsetR = curr->w_CharsetR;
bcopy((char *) curr->w_charsets, (char *) curr->w_SavedCharsets,
@@ -1693,14 +1787,15 @@ RestoreCursor()
GotoPos(curr->w_Saved_x, curr->w_Saved_y);
curr->w_x = curr->w_Saved_x;
curr->w_y = curr->w_Saved_y;
- curr->w_Attr = curr->w_SavedAttr;
- SetAttr(curr->w_Attr);
+ curr->w_rend = curr->w_SavedRend;
bcopy((char *) curr->w_SavedCharsets, (char *) curr->w_charsets,
4 * sizeof(int));
curr->w_Charset = curr->w_SavedCharset;
curr->w_CharsetR = curr->w_SavedCharsetR;
curr->w_ss = 0;
- SetFont(curr->w_Font = curr->w_charsets[curr->w_Charset]);
+ curr->w_FontL = curr->w_charsets[curr->w_Charset];
+ curr->w_FontR = curr->w_charsets[curr->w_CharsetR];
+ SetRendition(&curr->w_rend);
}
}
@@ -1772,20 +1867,17 @@ ReverseLineFeed()
}
static void
-InsertAChar(c, f)
-int c, f;
+InsertAChar(c)
+int c;
{
register int y = curr->w_y, x = curr->w_x;
if (x == cols)
x--;
- bcopy(curr->w_image[y], OldImage, cols);
- bcopy(curr->w_attr[y], OldAttr, cols);
- bcopy(curr->w_font[y], OldFont, cols);
- bcopy(curr->w_image[y] + x, curr->w_image[y] + x + 1, cols - x - 1);
- bcopy(curr->w_attr[y] + x, curr->w_attr[y] + x + 1, cols - x - 1);
- bcopy(curr->w_font[y] + x, curr->w_font[y] + x + 1, cols - x - 1);
- SetChar(c, f);
+ save_mline(&curr->w_mlines[y], cols);
+ if (cols - x - 1 > 0)
+ bcopy_mline(&curr->w_mlines[y], x, x + 1, cols - x - 1);
+ SetChar(c);
curr->w_x = x + 1;
if (!display)
return;
@@ -1797,7 +1889,7 @@ int c, f;
D_lp_missing = 0;
}
else
- UpdateLine(OldImage, OldAttr, OldFont, y, x, cols - 1);
+ UpdateLine(&mline_old, y, x, cols - 1);
}
static void
@@ -1808,23 +1900,18 @@ int n;
if (n <= 0)
return;
- /* Hack to be compatible with the old screen versions */
- if (curr->w_insert)
- return;
if (x == cols)
x--;
- bcopy(curr->w_image[y], OldImage, cols);
- bcopy(curr->w_attr[y], OldAttr, cols);
- bcopy(curr->w_font[y], OldFont, cols);
- if (n > cols - x)
+ save_mline(&curr->w_mlines[y], cols);
+ if (n >= cols - x)
n = cols - x;
- bcopy(curr->w_image[y] + x, curr->w_image[y] + x + n, cols - x - n);
- bcopy(curr->w_attr[y] + x, curr->w_attr[y] + x + n, cols - x - n);
- bcopy(curr->w_font[y] + x, curr->w_font[y] + x + n, cols - x - n);
+ else
+ bcopy_mline(&curr->w_mlines[y], x, x + n, cols - x - n);
+
ClearInLine(y, x, x + n - 1);
if (!display)
return;
- ScrollH(y, x, curr->w_width - 1, -n, OldImage, OldAttr, OldFont);
+ ScrollH(y, x, curr->w_width - 1, -n, &mline_old);
GotoPos(x, y);
}
@@ -1836,18 +1923,16 @@ int n;
if (x == cols)
x--;
- bcopy(curr->w_image[y], OldImage, cols);
- bcopy(curr->w_attr[y], OldAttr, cols);
- bcopy(curr->w_font[y], OldFont, cols);
- if (n > cols - x)
+ save_mline(&curr->w_mlines[y], cols);
+
+ if (n >= cols - x)
n = cols - x;
- bcopy(curr->w_image[y] + x + n, curr->w_image[y] + x, cols - x - n);
- bcopy(curr->w_attr[y] + x + n, curr->w_attr[y] + x, cols - x - n);
- bcopy(curr->w_font[y] + x + n, curr->w_font[y] + x, cols - x - n);
+ else
+ bcopy_mline(&curr->w_mlines[y], x + n, x, cols - x - n);
ClearInLine(y, cols - n, cols - 1);
if (!display)
return;
- ScrollH(y, x, curr->w_width - 1, n, OldImage, OldAttr, OldFont);
+ ScrollH(y, x, curr->w_width - 1, n, &mline_old);
GotoPos(x, y);
}
@@ -1907,53 +1992,46 @@ static void
ScrollUpMap(n)
int n;
{
- char tmp[256 * sizeof(char *)];
+ char tmp[256 * sizeof(struct mline)];
register int i, cnt1, cnt2;
- register char **ppi, **ppa, **ppf;
+ struct mline *ml;
#ifdef COPY_PASTE
register int ii;
#endif
i = curr->w_top + n;
- cnt1 = n * sizeof(char *);
- cnt2 = (curr->w_bot - i + 1) * sizeof(char *);
- ppi = curr->w_image + i;
- ppa = curr->w_attr + i;
- ppf = curr->w_font + i;
+ cnt1 = n * sizeof(struct mline);
+ cnt2 = (curr->w_bot - i + 1) * sizeof(struct mline);
#ifdef COPY_PASTE
for(ii = curr->w_top; ii < i; ii++)
- AddLineToHist(curr, &curr->w_image[ii], &curr->w_attr[ii], &curr->w_font[ii]);
+ AddLineToHist(curr, &curr->w_mlines[ii]);
#endif
+ ml = curr->w_mlines + i;
for (i = n; i; --i)
{
- bclear(*--ppi, cols + 1);
- bzero(*--ppa, cols + 1);
- bzero(*--ppf, cols + 1);
+ --ml;
+ clear_mline(ml, 0, cols + 1);
}
- Scroll((char *) ppi, cnt1, cnt2, tmp);
- Scroll((char *) ppa, cnt1, cnt2, tmp);
- Scroll((char *) ppf, cnt1, cnt2, tmp);
+ Scroll((char *) ml, cnt1, cnt2, tmp);
}
static void
ScrollDownMap(n)
int n;
{
- char tmp[256 * sizeof(char *)];
+ char tmp[256 * sizeof(struct mline)];
register int i, cnt1, cnt2;
- register char **ppi, **ppa, **ppf;
+ struct mline *ml;
i = curr->w_top;
- cnt1 = (curr->w_bot - i - n + 1) * sizeof(char *);
- cnt2 = n * sizeof(char *);
- Scroll((char *) (ppi = curr->w_image + i), cnt1, cnt2, tmp);
- Scroll((char *) (ppa = curr->w_attr + i), cnt1, cnt2, tmp);
- Scroll((char *) (ppf = curr->w_font + i), cnt1, cnt2, tmp);
+ cnt1 = (curr->w_bot - i - n + 1) * sizeof(struct mline);
+ cnt2 = n * sizeof(struct mline);
+ ml = curr->w_mlines + i;
+ Scroll((char *) ml, cnt1, cnt2, tmp);
for (i = n; i; --i)
{
- bclear(*ppi++, cols + 1);
- bzero(*ppa++, cols + 1);
- bzero(*ppf++, cols + 1);
+ clear_mline(ml, 0, cols + 1);
+ ml++;
}
}
@@ -2013,16 +2091,15 @@ static void
ClearScreen()
{
register int i;
- register char **ppi = curr->w_image, **ppa = curr->w_attr, **ppf = curr->w_font;
+ register struct mline *ml = curr->w_mlines;
for (i = 0; i < rows; ++i)
{
#ifdef COPY_PASTE
- AddLineToHist(curr, ppi, ppa, ppf);
+ AddLineToHist(curr, ml);
#endif
- bclear(*ppi++, cols + 1);
- bzero(*ppa++, cols + 1);
- bzero(*ppf++, cols + 1);
+ clear_mline(ml, 0, cols + 1);
+ ml++;
}
if (display)
ClearDisplay();
@@ -2038,7 +2115,7 @@ ClearFromBOS()
for (n = 0; n < y; ++n)
ClearInLine(n, 0, cols - 1);
ClearInLine(y, 0, x);
- RestorePosAttrFont();
+ RestorePosRendition();
}
static void
@@ -2056,7 +2133,7 @@ ClearToEOS()
ClearInLine(y, x, cols - 1);
for (n = y + 1; n < rows; n++)
ClearInLine(n, 0, cols - 1);
- RestorePosAttrFont();
+ RestorePosRendition();
}
static void
@@ -2067,7 +2144,7 @@ ClearFullLine()
if (display)
Clear(0, y, 0, cols - 1, cols - 1, y, 1);
ClearInLine(y, 0, cols - 1);
- RestorePosAttrFont();
+ RestorePosRendition();
}
static void
@@ -2078,7 +2155,7 @@ ClearToEOL()
if (display)
Clear(x, y, 0, cols - 1, cols - 1, y, 1);
ClearInLine(y, x, cols - 1);
- RestorePosAttrFont();
+ RestorePosRendition();
}
static void
@@ -2089,7 +2166,7 @@ ClearFromBOL()
if (display)
Clear(0, y, 0, cols - 1, x, y, 1);
ClearInLine(y, 0, x);
- RestorePosAttrFont();
+ RestorePosRendition();
}
static void
@@ -2103,11 +2180,7 @@ int y, x1, x2;
if (x2 == cols - 1)
x2++;
if ((n = x2 - x1 + 1) != 0)
- {
- bclear(curr->w_image[y] + x1, n);
- bzero(curr->w_attr[y] + x1, n);
- bzero(curr->w_font[y] + x1, n);
- }
+ clear_mline(&curr->w_mlines[y], x1, n);
}
static void
@@ -2182,6 +2255,12 @@ int on;
case 20:
curr->w_autolf = on;
break;
+ case 34:
+ curr->w_curvvis = !on;
+ CursorVisibility(curr->w_curinv ? -1 : curr->w_curvvis);
+ break;
+ default:
+ break;
}
}
}
@@ -2196,11 +2275,22 @@ static char rendlist[] =
static void
SelectRendition()
{
- register int j, i = 0, a = curr->w_Attr;
+ register int j, i = 0, a = curr->w_rend.attr;
+#ifdef COLOR
+ register int c = curr->w_rend.color;
+#endif
do
{
j = curr->w_args[i];
+#ifdef COLOR
+ if (j >= 30 && j <= 39)
+ c = (c & 0xf0) | (39 - j);
+ else if (j >= 40 && j <= 49)
+ c = (c & 0x0f) | ((49 - j) << 4);
+ if (j == 0)
+ c = 0;
+#endif
if (j < 0 || j >= (sizeof(rendlist)/sizeof(*rendlist)))
continue;
j = rendlist[j];
@@ -2210,7 +2300,12 @@ SelectRendition()
a |= j;
}
while (++i < curr->w_NumArgs);
- SetAttr(curr->w_Attr = a);
+ if (curr->w_rend.attr != a)
+ SetAttr(curr->w_rend.attr = a);
+#ifdef COLOR
+ if (curr->w_rend.color != c)
+ SetColor(curr->w_rend.color = c);
+#endif
}
static void
@@ -2222,9 +2317,8 @@ FillWithEs()
curr->w_y = curr->w_x = 0;
for (i = 0; i < rows; ++i)
{
- bzero(curr->w_attr[i], cols);
- bzero(curr->w_font[i], cols);
- p = curr->w_image[i];
+ clear_mline(&curr->w_mlines[i], 0, cols + 1);
+ p = curr->w_mlines[i].image;
ep = p + cols;
while (p < ep)
*p++ = 'E';
@@ -2235,51 +2329,47 @@ FillWithEs()
static void
-UpdateLine(os, oa, of, y, from, to)
+UpdateLine(oml, y, from, to)
+struct mline *oml;
int from, to, y;
-char *os, *oa, *of;
{
ASSERT(display);
- DisplayLine(os, oa, of, curr->w_image[y], curr->w_attr[y],
- curr->w_font[y], y, from, to);
- RestorePosAttrFont();
+ DisplayLine(oml, &curr->w_mlines[y], y, from, to);
+ RestorePosRendition();
}
-void
+
+static void
CheckLP(n_ch)
-char n_ch;
+int n_ch;
{
- register int y, x;
- register char n_at, n_fo, o_ch, o_at, o_fo;
+ register int x;
+ register struct mline *ml;
ASSERT(display);
+ ml = &curr->w_mlines[D_bot];
x = cols - 1;
- y = D_bot;
- o_ch = curr->w_image[y][x];
- o_at = curr->w_attr[y][x];
- o_fo = curr->w_font[y][x];
- n_at = curr->w_Attr;
- n_fo = curr->w_Font;
+ curr->w_rend.image = n_ch;
- D_lp_image = n_ch;
- D_lp_attr = n_at;
- D_lp_font = n_fo;
+ D_lpchar = curr->w_rend;
D_lp_missing = 0;
- if (n_ch == o_ch && n_at == o_at && n_fo == o_fo)
+
+ if (cmp_mchar_mline(&curr->w_rend, ml, x))
return;
- if (n_ch != ' ' || n_at || n_fo)
+ if (!cmp_mchar(&mchar_blank, &curr->w_rend)) /* is new not blank */
D_lp_missing = 1;
- if (o_ch != ' ' || o_at || o_fo)
+ if (!cmp_mchar_mline(&mchar_blank, ml, x)) /* is old char not blank? */
{
- if (D_attr && D_UT)
- SetAttr(0);
- if (D_DC)
+ /* old char not blank, new blank, try to delete */
+ if (D_UT)
+ SetRendition(&mchar_null);
+ if (D_CE)
+ PutStr(D_CE);
+ else if (D_DC)
PutStr(D_DC);
else if (D_CDC)
CPutStr(D_CDC, 1);
- else if (D_CE)
- PutStr(D_CE);
else
D_lp_missing = 1;
}
@@ -2305,6 +2395,14 @@ int l;
if (p->w_akachange != p->w_akabuf)
if (p->w_akachange[0] == 0 || p->w_akachange[-1] == ':')
p->w_title = p->w_akabuf + strlen(p->w_akabuf) + 1;
+
+ /* yucc */
+ if (p->w_hstatus)
+ {
+ display = p->w_display;
+ if (display)
+ RefreshStatus();
+ }
}
static void
@@ -2318,7 +2416,7 @@ FindAKA()
y = (wp->w_autoaka > 0 && wp->w_autoaka <= wp->w_height) ? wp->w_autoaka - 1 : wp->w_y;
cols = wp->w_width;
try_line:
- cp = line = wp->w_image[y];
+ cp = line = wp->w_mlines[y].image;
if (wp->w_autoaka > 0 && *wp->w_akabuf != '\0')
{
for (;;)
@@ -2357,15 +2455,6 @@ FindAKA()
}
void
-MakeBlankLine(p, n)
-register char *p;
-register int n;
-{
- while (n--)
- *p++ = ' ';
-}
-
-void
SetCurr(wp)
struct win *wp;
{
@@ -2378,11 +2467,12 @@ struct win *wp;
}
static void
-RestorePosAttrFont()
+RestorePosRendition()
{
+ if (!display)
+ return;
GotoPos(curr->w_x, curr->w_y);
- SetAttr(curr->w_Attr);
- SetFont(curr->w_Font);
+ SetRendition(&curr->w_rend);
}
/* Send a terminal report as if it were typed. */
@@ -2405,24 +2495,33 @@ int n1, n2;
}
#ifdef COPY_PASTE
-void
-AddLineToHist(wp, pi, pa, pf)
+static void
+AddLineToHist(wp, ml)
struct win *wp;
-char **pi, **pa, **pf;
+struct mline *ml;
{
register char *q, *o;
+ struct mline *hml;
if (wp->w_histheight == 0)
return;
- q = *pi; *pi = wp->w_ihist[wp->w_histidx]; wp->w_ihist[wp->w_histidx] = q;
- q = *pa; o = wp->w_ahist[wp->w_histidx]; wp->w_ahist[wp->w_histidx] = q;
+ hml = &wp->w_hlines[wp->w_histidx];
+ q = ml->image; ml->image = hml->image; hml->image = q;
+
+ q = ml->attr; o = hml->attr; hml->attr = q; ml->attr = null;
if (o != null)
free(o);
- q = *pf; o = wp->w_fhist[wp->w_histidx]; wp->w_fhist[wp->w_histidx] = q;
+ q = ml->font; o = hml->font; hml->font = q; ml->font = null;
+ if (o != null)
+ free(o);
+
+#ifdef COLOR
+ q = ml->color; o = hml->color; hml->color = q; ml->color = null;
if (o != null)
free(o);
- *pa = *pf = null;
+#endif
+
if (++wp->w_histidx >= wp->w_histheight)
wp->w_histidx = 0;
}
diff --git a/src/ansi.h b/src/ansi.h
index 069cdba..6634e4b 100644
--- a/src/ansi.h
+++ b/src/ansi.h
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
* $Id$ FAU
@@ -55,7 +56,10 @@ enum state_t
PRIN, /* Printer mode */
PRINESC, /* ESC seen in printer mode */
PRINCSI, /* CSI seen in printer mode */
- PRIN4 /* CSI 4 seen in printer mode */
+ PRIN4, /* CSI 4 seen in printer mode */
+ TEK, /* Tektronix mode */
+ TEKESC, /* Tektronix escape */
+ TEKEND /* Tektronix ending sequence */
};
enum string_t
diff --git a/src/attacher.c b/src/attacher.c
index 3151b00..33ede26 100644
--- a/src/attacher.c
+++ b/src/attacher.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -32,9 +33,6 @@ RCS_ID("$Id$ FAU")
#include "extern.h"
#include <pwd.h>
-#ifdef SHADOWPW
-# include <shadow.h>
-#endif /* SHADOWPW */
static sigret_t AttacherSigInt __P(SIGPROTOARG);
#ifdef PASSWORD
@@ -269,7 +267,7 @@ int how;
#endif
ASSERT(how == MSG_ATTACH || how == MSG_CONT);
strcpy(m.m.attach.envterm, attach_term);
- debug1("attach: sending %d bytes... ", sizeof m);
+ debug1("attach: sending %d bytes... ", (int)sizeof(m));
strncpy(m.m.attach.auser, LoginName, sizeof(m.m.attach.auser) - 1);
m.m.attach.auser[sizeof(m.m.attach.auser) - 1] = 0;
@@ -636,9 +634,7 @@ LockTerminal()
sigret_t (*sigs[NSIG])__P(SIGPROTOARG);
for (sig = 1; sig < NSIG; sig++)
- {
- sigs[sig] = signal(sig, SIG_IGN);
- }
+ sigs[sig] = signal(sig, SIG_IGN);
signal(SIGHUP, LockHup);
printf("\n");
@@ -731,11 +727,7 @@ static void
screen_builtin_lck()
{
char fullname[100], *cp1, message[BUFSIZ];
- char c, *pass, mypass[9];
-#ifdef SHADOWPW
- static struct spwd *sss;
-#endif
- int t;
+ char *pass, mypass[9];
#ifdef undef
/* get password entry */
@@ -753,30 +745,8 @@ screen_builtin_lck()
}
#endif
pass = ppp->pw_passwd;
-#ifdef SHADOWPW
-realpw:
-#endif /* SHADOWPW */
- for (t = 0; t < 13; t++)
- {
- c = pass[t];
- if (!(c == '.' || c == '/' ||
- (c >= '0' && c <= '9') ||
- (c >= 'a' && c <= 'z') ||
- (c >= 'A' && c <= 'Z')))
- break;
- }
- if (t < 13)
+ if (pass == 0)
{
- debug("builtin_lock: ppp->pw_passwd bad, has it a shadow?\n");
-#ifdef SHADOWPW
- if (sss == 0)
- sss = getspnam(ppp->pw_name);
- if (sss && pass != sss->sp_pwdp)
- {
- pass = sss->sp_pwdp;
- goto realpw;
- }
-#endif /* SHADOWPW */
if ((pass = getpass("Key: ")))
{
strncpy(mypass, pass, 8);
@@ -801,8 +771,6 @@ realpw:
}
pass = 0;
}
- else
- pass[13] = 0; /* beware of linux's long passwords */
debug("screen_builtin_lck looking in gcos field\n");
strcpy(fullname, ppp->pw_gecos);
diff --git a/src/comm.c b/src/comm.c
index dbee9f3..2bd3846 100644
--- a/src/comm.c
+++ b/src/comm.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -24,7 +25,7 @@
RCS_ID("$Id$ FAU")
#include "config.h"
-#include "acl.h"
+#include "acls.h"
#include "comm.h"
/* Must be in alpha order ! */
@@ -56,6 +57,7 @@ struct comm comms[RC_LAST + 1] =
{ "bufferfile", ARGS_ZEROONE },
#endif
{ "c1", NEED_FORE|ARGS_ZEROONE },
+ { "charset", NEED_FORE|ARGS_ONE },
{ "chdir", ARGS_ZEROONE },
{ "clear", NEED_FORE|ARGS_ZERO },
#ifdef MULTI
@@ -73,9 +75,11 @@ struct comm comms[RC_LAST + 1] =
{ "defautonuke", ARGS_ONE },
#endif
{ "defc1", ARGS_ONE },
+ { "defcharset", ARGS_ZEROONE },
{ "defescape", ARGS_ONE },
{ "defflow", ARGS_ONETWO },
{ "defgr", ARGS_ONE },
+ { "defhstatus", ARGS_ZEROONE },
#ifdef KANJI
{ "defkanji", ARGS_ONE },
#endif
@@ -91,6 +95,7 @@ struct comm comms[RC_LAST + 1] =
{ "defwrap", ARGS_ONE },
{ "defwritelock", ARGS_ONE },
{ "detach", NEED_DISPLAY|ARGS_ZERO },
+ { "digraph", NEED_DISPLAY|ARGS_ZEROONE },
{ "displays", NEED_DISPLAY|ARGS_ZERO },
{ "dumptermcap", NEED_FORE|ARGS_ZERO },
{ "echo", ARGS_ONETWO },
@@ -120,7 +125,7 @@ struct comm comms[RC_LAST + 1] =
{ "lockscreen", NEED_DISPLAY|ARGS_ZERO },
#endif
{ "log", NEED_FORE|ARGS_ZEROONE },
- { "logdir", ARGS_ONE },
+ { "logfile", ARGS_ZEROONE },
#if defined(UTMPOK) && defined(LOGOUTOK)
{ "login", NEED_FORE|ARGS_ZEROONE },
#endif
@@ -187,6 +192,7 @@ struct comm comms[RC_LAST + 1] =
{ "silencewait", ARGS_ONE },
{ "sleep", ARGS_ONE },
{ "slowpaste", ARGS_ONE },
+ { "sorendition", ARGS_ZEROONETWO },
{ "startup_message", ARGS_ONE },
{ "stuff", NEED_DISPLAY|ARGS_ONE },
#ifdef BSDJOBS
@@ -194,6 +200,7 @@ struct comm comms[RC_LAST + 1] =
#endif
{ "term", ARGS_ONE },
{ "termcap", ARGS_TWOTHREE },
+ { "termcapinfo", ARGS_TWOTHREE },
{ "terminfo", ARGS_TWOTHREE },
{ "time", ARGS_ZERO },
{ "title", NEED_FORE|ARGS_ZEROONE },
diff --git a/src/comm.h.dist b/src/comm.h.dist
index 2227544..bbe0052 100644
--- a/src/comm.h.dist
+++ b/src/comm.h.dist
@@ -56,116 +56,122 @@ struct action
#define RC_BREAK 14
#define RC_BUFFERFILE 15
#define RC_C1 16
-#define RC_CHDIR 17
-#define RC_CLEAR 18
-#define RC_CLONE 19
-#define RC_COLON 20
-#define RC_COMMAND 21
-#define RC_CONSOLE 22
-#define RC_COPY 23
-#define RC_CRLF 24
-#define RC_DEBUG 25
-#define RC_DEFAUTONUKE 26
-#define RC_DEFC1 27
-#define RC_DEFESCAPE 28
-#define RC_DEFFLOW 29
-#define RC_DEFGR 30
-#define RC_DEFKANJI 31
-#define RC_DEFLOGIN 32
-#define RC_DEFMODE 33
-#define RC_DEFMONITOR 34
-#define RC_DEFOBUFLIMIT 35
-#define RC_DEFSCROLLBACK 36
-#define RC_DEFWRAP 37
-#define RC_DEFWRITELOCK 38
-#define RC_DETACH 39
-#define RC_DISPLAYS 40
-#define RC_DUMPTERMCAP 41
-#define RC_ECHO 42
-#define RC_ESCAPE 43
-#define RC_EXEC 44
-#define RC_FLOW 45
-#define RC_GR 46
-#define RC_HARDCOPY 47
-#define RC_HARDCOPY_APPEND 48
-#define RC_HARDCOPYDIR 49
-#define RC_HARDSTATUS 50
-#define RC_HEIGHT 51
-#define RC_HELP 52
-#define RC_HISTORY 53
-#define RC_INFO 54
-#define RC_KANJI 55
-#define RC_KILL 56
-#define RC_LASTMSG 57
-#define RC_LICENSE 58
-#define RC_LOCKSCREEN 59
-#define RC_LOG 60
-#define RC_LOGDIR 61
-#define RC_LOGIN 62
-#define RC_MAPDEFAULT 63
-#define RC_MAPNOTNEXT 64
-#define RC_MAPTIMEOUT 65
-#define RC_MARKKEYS 66
-#define RC_META 67
-#define RC_MONITOR 68
-#define RC_MSGMINWAIT 69
-#define RC_MSGWAIT 70
-#define RC_MULTIUSER 71
-#define RC_NETHACK 72
-#define RC_NEXT 73
-#define RC_NUMBER 74
-#define RC_OBUFLIMIT 75
-#define RC_OTHER 76
-#define RC_PARTIAL 77
-#define RC_PASSWORD 78
-#define RC_PASTE 79
-#define RC_PASTEFONT 80
-#define RC_POW_BREAK 81
-#define RC_POW_DETACH 82
-#define RC_POW_DETACH_MSG 83
-#define RC_PREV 84
-#define RC_PRINTCMD 85
-#define RC_PROCESS 86
-#define RC_QUIT 87
-#define RC_READBUF 88
-#define RC_READREG 89
-#define RC_REDISPLAY 90
-#define RC_REGISTER 91
-#define RC_REMOVEBUF 92
-#define RC_RESET 93
-#define RC_SCREEN 94
-#define RC_SCROLLBACK 95
-#define RC_SELECT 96
-#define RC_SESSIONNAME 97
-#define RC_SETENV 98
-#define RC_SHELL 99
-#define RC_SHELLAKA 100
-#define RC_SHELLTITLE 101
-#define RC_SILENCE 102
-#define RC_SILENCEWAIT 103
-#define RC_SLEEP 104
-#define RC_SLOWPASTE 105
-#define RC_STARTUP_MESSAGE 106
-#define RC_STUFF 107
-#define RC_SUSPEND 108
-#define RC_TERM 109
-#define RC_TERMCAP 110
-#define RC_TERMINFO 111
-#define RC_TIME 112
-#define RC_TITLE 113
-#define RC_UNSETENV 114
-#define RC_VBELL 115
-#define RC_VBELL_MSG 116
-#define RC_VBELLWAIT 117
-#define RC_VERSION 118
-#define RC_WALL 119
-#define RC_WIDTH 120
-#define RC_WINDOWS 121
-#define RC_WRAP 122
-#define RC_WRITEBUF 123
-#define RC_WRITELOCK 124
-#define RC_XOFF 125
-#define RC_XON 126
-#define RC_ZOMBIE 127
+#define RC_CHARSET 17
+#define RC_CHDIR 18
+#define RC_CLEAR 19
+#define RC_CLONE 20
+#define RC_COLON 21
+#define RC_COMMAND 22
+#define RC_CONSOLE 23
+#define RC_COPY 24
+#define RC_CRLF 25
+#define RC_DEBUG 26
+#define RC_DEFAUTONUKE 27
+#define RC_DEFC1 28
+#define RC_DEFCHARSET 29
+#define RC_DEFESCAPE 30
+#define RC_DEFFLOW 31
+#define RC_DEFGR 32
+#define RC_DEFHSTATUS 33
+#define RC_DEFKANJI 34
+#define RC_DEFLOGIN 35
+#define RC_DEFMODE 36
+#define RC_DEFMONITOR 37
+#define RC_DEFOBUFLIMIT 38
+#define RC_DEFSCROLLBACK 39
+#define RC_DEFWRAP 40
+#define RC_DEFWRITELOCK 41
+#define RC_DETACH 42
+#define RC_DIGRAPH 43
+#define RC_DISPLAYS 44
+#define RC_DUMPTERMCAP 45
+#define RC_ECHO 46
+#define RC_ESCAPE 47
+#define RC_EXEC 48
+#define RC_FLOW 49
+#define RC_GR 50
+#define RC_HARDCOPY 51
+#define RC_HARDCOPY_APPEND 52
+#define RC_HARDCOPYDIR 53
+#define RC_HARDSTATUS 54
+#define RC_HEIGHT 55
+#define RC_HELP 56
+#define RC_HISTORY 57
+#define RC_INFO 58
+#define RC_KANJI 59
+#define RC_KILL 60
+#define RC_LASTMSG 61
+#define RC_LICENSE 62
+#define RC_LOCKSCREEN 63
+#define RC_LOG 64
+#define RC_LOGFILE 65
+#define RC_LOGIN 66
+#define RC_MAPDEFAULT 67
+#define RC_MAPNOTNEXT 68
+#define RC_MAPTIMEOUT 69
+#define RC_MARKKEYS 70
+#define RC_META 71
+#define RC_MONITOR 72
+#define RC_MSGMINWAIT 73
+#define RC_MSGWAIT 74
+#define RC_MULTIUSER 75
+#define RC_NETHACK 76
+#define RC_NEXT 77
+#define RC_NUMBER 78
+#define RC_OBUFLIMIT 79
+#define RC_OTHER 80
+#define RC_PARTIAL 81
+#define RC_PASSWORD 82
+#define RC_PASTE 83
+#define RC_PASTEFONT 84
+#define RC_POW_BREAK 85
+#define RC_POW_DETACH 86
+#define RC_POW_DETACH_MSG 87
+#define RC_PREV 88
+#define RC_PRINTCMD 89
+#define RC_PROCESS 90
+#define RC_QUIT 91
+#define RC_READBUF 92
+#define RC_READREG 93
+#define RC_REDISPLAY 94
+#define RC_REGISTER 95
+#define RC_REMOVEBUF 96
+#define RC_RESET 97
+#define RC_SCREEN 98
+#define RC_SCROLLBACK 99
+#define RC_SELECT 100
+#define RC_SESSIONNAME 101
+#define RC_SETENV 102
+#define RC_SHELL 103
+#define RC_SHELLAKA 104
+#define RC_SHELLTITLE 105
+#define RC_SILENCE 106
+#define RC_SILENCEWAIT 107
+#define RC_SLEEP 108
+#define RC_SLOWPASTE 109
+#define RC_SORENDITION 110
+#define RC_STARTUP_MESSAGE 111
+#define RC_STUFF 112
+#define RC_SUSPEND 113
+#define RC_TERM 114
+#define RC_TERMCAP 115
+#define RC_TERMCAPINFO 116
+#define RC_TERMINFO 117
+#define RC_TIME 118
+#define RC_TITLE 119
+#define RC_UNSETENV 120
+#define RC_VBELL 121
+#define RC_VBELL_MSG 122
+#define RC_VBELLWAIT 123
+#define RC_VERSION 124
+#define RC_WALL 125
+#define RC_WIDTH 126
+#define RC_WINDOWS 127
+#define RC_WRAP 128
+#define RC_WRITEBUF 129
+#define RC_WRITELOCK 130
+#define RC_XOFF 131
+#define RC_XON 132
+#define RC_ZOMBIE 133
-#define RC_LAST 127
+#define RC_LAST 133
diff --git a/src/config.h.in b/src/config.h.in
index 24b2341..eee2a79 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -121,6 +121,7 @@
# define MULTI
# define MULTIUSER
# define MAPKEYS
+# define COLOR
#endif /* SIMPLESCREEN */
#define KANJI
@@ -201,6 +202,10 @@
#undef ISC
#endif
+#ifndef sysV68
+#undef sysV68
+#endif
+
#ifndef _POSIX_SOURCE
#undef _POSIX_SOURCE
#endif
diff --git a/src/configure b/src/configure
index b1586fd..8706866 100755
--- a/src/configure
+++ b/src/configure
@@ -2,7 +2,7 @@
# From configure.in Revision: 1.17
#!/bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 1.10
+# Generated automatically using autoconf version 1.11
# Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
# This configure script is free software; you can redistribute it and/or
@@ -199,7 +199,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 1.10"
+ echo "configure generated by autoconf version 1.11"
exit 0 ;;
-with-* | --with-*)
@@ -572,7 +572,7 @@ if test -z "$INSTALL"; then
# As a last resort, use the slow shell script.
for ac_dir in ${srcdir} ${srcdir}/.. ${srcdir}/../..; do
if test -f $ac_dir/install.sh; then
- INSTALL=$ac_dir/install.sh; break
+ INSTALL="$ac_dir/install.sh -c"; break
fi
done
fi
@@ -590,6 +590,11 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
test -n "$verbose" && echo " setting INSTALL_DATA to $INSTALL_DATA"
+if test -f etc/toolcheck; then
+test -n "$silent" || echo "checking for buggy tools"
+sh etc/toolcheck
+fi
+
if test -n "$ISC"; then
{
@@ -606,6 +611,21 @@ ac_sed_defs="${ac_sed_defs}\${ac_dA}ISC\${ac_dB}ISC\${ac_dC}1\${ac_dD}
fi
+if test -f /sysV68 ; then
+
+{
+test -n "$verbose" && \
+echo " defining sysV68"
+echo "#define" sysV68 "1" >> confdefs.h
+DEFS="$DEFS -DsysV68=1"
+ac_sed_defs="${ac_sed_defs}\${ac_dA}sysV68\${ac_dB}sysV68\${ac_dC}1\${ac_dD}
+\${ac_uA}sysV68\${ac_uB}sysV68\${ac_uC}1\${ac_uD}
+\${ac_eA}sysV68\${ac_eB}sysV68\${ac_eC}1\${ac_eD}
+"
+}
+
+fi
+
test -n "$silent" || echo "checking for MIPS"
if test -f /lib/libmld.a || test -f /usr/lib/libmld.a || test -f /usr/lib/cmplrs/cc/libmld.a; then
test -f /bin/mx || LIBS="$LIBS -lmld" # for nlist. But not on alpha.
@@ -992,7 +1012,7 @@ cat > conftest.${ac_ext} <<EOF
int main() { return 0; }
int t() {
-#if defined(linux) || defined(NeXT) || defined(_AUX_SOURCE) || defined(AUX) || defined(ultrix) || (defined(sun) && defined(SVR4))
+#if defined(linux) || defined(NeXT) || defined(_AUX_SOURCE) || defined(AUX) || defined(ultrix) || (defined(sun) && defined(SVR4)) || defined(ISC) || defined(sony_news)
seteuid_is_broken(0);
#else
seteuid(0);
@@ -1018,7 +1038,6 @@ fi
rm -f conftest*
-
test -n "$silent" || echo "checking for select"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
@@ -1727,6 +1746,50 @@ ac_sed_defs="${ac_sed_defs}\${ac_dA}GETUTENT\${ac_dB}GETUTENT\${ac_dC}1\${ac_dD}
}
+else
+ rm -rf conftest*
+ olibs="$LIBS"
+LIBS="$LIBS -lgen"
+test -n "$silent" || echo "checking for getutent with -lgen"
+cat > conftest.${ac_ext} <<EOF
+#include "confdefs.h"
+#include <time.h>
+#include <sys/types.h>
+#if defined(SVR4) && !defined(DGUX)
+#include <utmpx.h>
+#define utmp utmpx
+#else
+#include <utmp.h>
+#endif
+#ifdef __hpux
+#define pututline _pututline
+#endif
+
+int main() { return 0; }
+int t() { int x = DEAD_PROCESS; struct utmp *y = pututline((struct utmp *)0); getutent();; return 0; }
+EOF
+if eval $ac_compile; then
+ rm -rf conftest*
+
+{
+test -n "$verbose" && \
+echo " defining GETUTENT"
+echo "#define" GETUTENT "1" >> confdefs.h
+DEFS="$DEFS -DGETUTENT=1"
+ac_sed_defs="${ac_sed_defs}\${ac_dA}GETUTENT\${ac_dB}GETUTENT\${ac_dC}1\${ac_dD}
+\${ac_uA}GETUTENT\${ac_uB}GETUTENT\${ac_uC}1\${ac_uD}
+\${ac_eA}GETUTENT\${ac_eB}GETUTENT\${ac_eC}1\${ac_eD}
+"
+}
+
+
+else
+ rm -rf conftest*
+ LIBS="$olibs"
+fi
+rm -f conftest*
+
+
fi
rm -f conftest*
@@ -1849,7 +1912,7 @@ rm -f conftest*
fi
if test -z "$load" ; then
test -n "$silent" || echo "checking for kernelfile"
-for core in /unix /vmunix /dynix /hp-ux /xelos /386bsd /kernel/unix /unicos /mach; do
+for core in /unix /vmunix /dynix /hp-ux /xelos /386bsd /kernel/unix /unicos /mach /stand/vmunix; do
if test -f $core ; then
break
fi
@@ -2923,15 +2986,20 @@ ac_sed_defs="${ac_sed_defs}\${ac_dA}ETCSCREENRC\${ac_dB}ETCSCREENRC\${ac_dC}\"$p
fi
-# Set default prefixes.
+
+# The preferred way to propogate these variables is regular @ substitutions.
if test -n "$prefix"; then
- test -z "$exec_prefix" && exec_prefix='${prefix}' # Let make expand it.
ac_prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%"
+else
+ prefix=/usr/local
fi
if test -n "$exec_prefix"; then
ac_prsub="$ac_prsub
s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
+else
+ exec_prefix='${prefix}' # Let make expand it.
fi
+
# Any assignment to VPATH causes Sun make to only execute
# the first set of double-colon rules, so remove it if not needed.
# If there is a colon in the path, we need to keep it.
@@ -2968,7 +3036,7 @@ do
echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args --no-create
exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args --no-create ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "config.status generated by autoconf version 1.10"
+ echo "config.status generated by autoconf version 1.11"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -3001,7 +3069,7 @@ CONFIG_FILES=${CONFIG_FILES-"Makefile doc/Makefile"}
for ac_file in .. ${CONFIG_FILES}; do if test "x$ac_file" != x..; then
# Remove last slash and all that follows it. Not all systems have dirname.
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file"; then
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
# The file is in a subdirectory.
test ! -d "$ac_dir" && mkdir "$ac_dir"
ac_dir_suffix="/$ac_dir"
@@ -3012,7 +3080,9 @@ for ac_file in .. ${CONFIG_FILES}; do if test "x$ac_file" != x..; then
# A "../" for each directory in $ac_dir_suffix.
ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
case "$ac_given_srcdir" in
- .) srcdir=.; top_srcdir="$ac_dots." ;;
+ .) srcdir=.
+ if test -z "$ac_dir_suffix"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
/*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
*) # Relative path.
srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
@@ -3150,7 +3220,8 @@ rm -f conftest.sed
exit 0
EOF
chmod +x config.status
-test -n "$no_create" || ${CONFIG_SHELL-/bin/sh} config.status
+# Some shells look in PATH for config.status without the "./".
+test -n "$no_create" || ${CONFIG_SHELL-/bin/sh} ./config.status
# a hook for preserving undef directive in config.h
diff --git a/src/configure.in b/src/configure.in
index 8c2052f..f743154 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -56,6 +56,11 @@ AC_PROG_AWK
AC_PROG_INSTALL
+if test -f etc/toolcheck; then
+AC_CHECKING(for buggy tools)
+sh etc/toolcheck
+fi
+
dnl
dnl **** special unix variants ****
dnl
@@ -70,6 +75,10 @@ dnl AC_DEFINE(OSF1) # this disables MIPS again....
dnl fi
dnl fi
+if test -f /sysV68 ; then
+AC_DEFINE(sysV68)
+fi
+
AC_CHECKING(for MIPS)
if test -f /lib/libmld.a || test -f /usr/lib/libmld.a || test -f /usr/lib/cmplrs/cc/libmld.a; then
test -f /bin/mx || LIBS="$LIBS -lmld" # for nlist. But not on alpha.
@@ -195,11 +204,11 @@ setreuid(0, 0);
dnl
dnl seteuid() check:
dnl linux seteuid was broken before V1.1.11
-dnl NeXT, AUX and ultrix are still broken (no saved uid support)
+dnl NeXT, AUX, ISC, and ultrix are still broken (no saved uid support)
dnl Solaris seteuid doesn't change the saved uid, bad for
dnl multiuser screen sessions
AC_COMPILE_CHECK(seteuid, , [
-#if defined(linux) || defined(NeXT) || defined(_AUX_SOURCE) || defined(AUX) || defined(ultrix) || (defined(sun) && defined(SVR4))
+#if defined(linux) || defined(NeXT) || defined(_AUX_SOURCE) || defined(AUX) || defined(ultrix) || (defined(sun) && defined(SVR4)) || defined(ISC) || defined(sony_news)
seteuid_is_broken(0);
#else
seteuid(0);
@@ -631,7 +640,23 @@ AC_COMPILE_CHECK(getutent, [#include <time.h> /* to get time_t on SCO */
#define pututline _pututline
#endif
],
-[int x = DEAD_PROCESS; struct utmp *y = pututline((struct utmp *)0); getutent();], AC_DEFINE(GETUTENT))
+[int x = DEAD_PROCESS; struct utmp *y = pututline((struct utmp *)0); getutent();], AC_DEFINE(GETUTENT),
+olibs="$LIBS"
+LIBS="$LIBS -lgen"
+AC_COMPILE_CHECK(getutent with -lgen, [#include <time.h>
+#include <sys/types.h>
+#if defined(SVR4) && !defined(DGUX)
+#include <utmpx.h>
+#define utmp utmpx
+#else
+#include <utmp.h>
+#endif
+#ifdef __hpux
+#define pututline _pututline
+#endif
+],
+[int x = DEAD_PROCESS; struct utmp *y = pututline((struct utmp *)0); getutent();], AC_DEFINE(GETUTENT), LIBS="$olibs")
+)
AC_COMPILE_CHECK(ut_host, [#include <time.h>
#include <sys/types.h>
#if defined(SVR4) && !defined(DGUX)
@@ -669,7 +694,7 @@ AC_PROGRAM_EGREP(yes,
fi
if test -z "$load" ; then
AC_CHECKING(for kernelfile)
-for core in /unix /vmunix /dynix /hp-ux /xelos /386bsd /kernel/unix /unicos /mach; do
+for core in /unix /vmunix /dynix /hp-ux /xelos /386bsd /kernel/unix /unicos /mach /stand/vmunix; do
if test -f $core ; then
break
fi
diff --git a/src/display.c b/src/display.c
index 7fefa45..5ffef82 100644
--- a/src/display.c
+++ b/src/display.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -42,6 +43,8 @@ extern int use_hardstatus;
extern int MsgMinWait;
extern int Z0width, Z1width;
extern char *blank, *null;
+extern struct mline mline_blank, mline_null;
+extern struct mchar mchar_null, mchar_blank, mchar_so;
/*
* tputs needs this to calculate the padding
@@ -91,7 +94,7 @@ void
DefClearLine(y, xs, xe)
int y, xs, xe;
{
- DisplayLine(null, null, null, blank, null, null, y, xs, xe);
+ DisplayLine(&mline_null, &mline_blank, y, xs, xe);
}
/*ARGSUSED*/
@@ -123,8 +126,8 @@ DefRestore()
ChangeScrollRegion(0, D_height - 1);
KeypadMode(0);
CursorkeysMode(0);
- CursorInvisible(0);
- SetAttrFont(0, ASCII);
+ CursorVisibility(0);
+ SetRendition(&mchar_null);
SetFlow(FLOW_NOW);
}
@@ -173,6 +176,9 @@ struct mode *Mode;
{
struct user **u;
+ if (!*(u = FindUserPtr(uname)) && UserAdd(uname, (char *)0, u))
+ return 0; /* could not find or add user */
+
#ifdef MULTI
if ((display = (struct display *)malloc(sizeof(*display))) == 0)
return 0;
@@ -196,8 +202,12 @@ struct mode *Mode;
D_obufp = D_obuf;
D_printfd = -1;
D_userpid = pid;
-#ifdef POSIX
+#if defined(POSIX) || defined(TERMIO)
+# ifdef POSIX
switch (cfgetospeed(&D_OldMode.tio))
+# else
+ switch (D_OldMode.tio.c_cflag & CBAUD)
+# endif
{
#ifdef B0
case B0: D_dospeed = 0; break;
@@ -255,20 +265,13 @@ struct mode *Mode;
#endif
default: ;
}
-#else
-# ifndef TERMIO
+#else /* POSIX || TERMIO */
D_dospeed = (short) D_OldMode.m_ttyb.sg_ospeed;
-# endif
-#endif
+#endif /* POSIX || TERMIO */
debug1("New displays ospeed = %d\n", D_dospeed);
strcpy(D_usertty, utty);
strcpy(D_termname, term);
- if (!*(u = FindUserPtr(uname)) && UserAdd(uname, NULL, u))
- {
- FreeDisplay();
- return NULL; /* could not find or add user */
- }
D_user = *u;
D_lay = &BlankLayer;
D_layfn = BlankLayer.l_layfn;
@@ -281,7 +284,15 @@ FreeDisplay()
struct win *p;
#ifdef MULTI
struct display *d, **dp;
+#endif
+ FreeTransTable();
+ freetty();
+ if (D_tentry)
+ free(D_tentry);
+ D_tentry = 0;
+ D_tcinited = 0;
+#ifdef MULTI
for (dp = &displays; (d = *dp) ; dp = &d->d_next)
if (d == display)
break;
@@ -336,8 +347,11 @@ int adapt;
#endif
D_keypad = 0;
D_cursorkeys = 0;
+ PutStr(D_ME);
+ PutStr(D_EA);
PutStr(D_CE0);
- D_font = ASCII;
+ D_rend = mchar_null;
+ D_atyp = 0;
if (adapt == 0)
ResizeDisplay(D_defwidth, D_defheight);
ChangeScrollRegion(0, D_height - 1);
@@ -358,7 +372,7 @@ FinitTerm()
{
ResizeDisplay(D_defwidth, D_defheight);
DefRestore();
- SetAttrFont(0, ASCII);
+ SetRendition(&mchar_null);
#ifdef MAPKEYS
PutStr(D_KE);
PutStr(D_CCE);
@@ -427,9 +441,8 @@ int c;
return;
}
D_lp_missing = 1;
- D_lp_image = c;
- D_lp_attr = D_attr;
- D_lp_font = D_font;
+ D_rend.image = c;
+ D_lpchar = D_rend;
}
/*
@@ -443,7 +456,7 @@ int c;
{
ASSERT(display);
#ifdef KANJI
- if (D_font == KANJI)
+ if (D_rend.font == KANJI)
{
int t = c;
if (D_mbcs == 0)
@@ -468,7 +481,7 @@ int c;
}
D_mbcs = t;
}
- else if (D_font == KANA)
+ else if (D_rend.font == KANA)
{
if (D_kanji == EUC)
{
@@ -476,18 +489,15 @@ int c;
c |= 0x80;
}
else if (D_kanji == SJIS)
- {
- c |= 0x80;
- }
+ c |= 0x80;
}
kanjiloop:
#endif
- if (D_font == '0')
- {
- AddChar(D_c0_tab[c]);
- }
+ if (D_xtable && D_xtable[(int)(unsigned char)D_rend.font] && D_xtable[(int)(unsigned char)D_rend.font][(int)(unsigned char)c])
+ AddStr(D_xtable[(int)(unsigned char)D_rend.font][(int)(unsigned char)c]);
else
- AddChar(c);
+ AddChar(D_rend.font != '0' ? c : D_c0_tab[(int)(unsigned char)c]);
+
if (++D_x >= D_width)
{
if (D_AM == 0)
@@ -612,16 +622,21 @@ int on;
}
void
-CursorInvisible(on)
-int on;
+CursorVisibility(v)
+int v;
{
- if (display && D_curinv != on && D_VI)
+ if (display && D_curvis != v)
{
- D_curinv = on;
- if (D_curinv)
+ if (D_curvis)
+ PutStr(D_VE); /* do this always, just to be safe */
+ D_curvis = 0;
+ if (v == -1 && D_VI)
PutStr(D_VI);
+ else if (v == 1 && D_VS)
+ PutStr(D_VS);
else
- PutStr(D_VE);
+ return;
+ D_curvis = v;
}
}
@@ -640,15 +655,12 @@ CalcCost(s)
register char *s;
{
ASSERT(display);
- if (s)
- {
- StrCost = 0;
- ospeed = D_dospeed;
- tputs(s, 1, CountChars);
- return StrCost;
- }
- else
+ if (!s)
return EXPENSIVE;
+ StrCost = 0;
+ ospeed = D_dospeed;
+ tputs(s, 1, CountChars);
+ return StrCost;
}
void
@@ -678,11 +690,9 @@ int x2, y2;
dx = x2 - x1;
dy = y2 - y1;
if (dy == 0 && dx == 0)
- {
- return;
- }
- if (!D_MS && (D_attr || D_font != ASCII)) /* Safe to move ? */
- SetAttrFont(0, ASCII);
+ return;
+ if (!D_MS) /* Safe to move ? */
+ SetRendition(&mchar_null);
if (y1 < 0 /* don't know the y position */
|| (y2 > D_bot && y1 <= D_bot) /* have to cross border */
|| (y2 < D_top && y1 >= D_top)) /* of scrollregion ? */
@@ -859,8 +869,8 @@ int x1, y1, xs, xe, x2, y2, uselayfn;
x1--;
if (x2 == D_width)
x2--;
- if (D_attr && D_UT) /* Safe to erase ? */
- SetAttr(0);
+ if (D_UT) /* Safe to erase ? */
+ SetRendition(&mchar_null);
if (D_lp_missing && y1 <= D_bot && xe >= D_width - 1)
{
if (y2 > D_bot || (y2 == D_bot && x2 >= D_width - 1))
@@ -915,7 +925,7 @@ int x1, y1, xs, xe, x2, y2, uselayfn;
if (uselayfn)
ClearLine(y, x1, xxe);
else
- DisplayLine(null, null, null, blank, null, null, y, x1, xxe);
+ DisplayLine(&mline_null, &mline_blank, y, x1, xxe);
}
}
@@ -951,9 +961,9 @@ int cur_only;
void
-ScrollH(y, xs, xe, n, oi, oa, of)
+ScrollH(y, xs, xe, n, oml)
int y, xs, xe, n;
-char *oi, *oa, *of;
+struct mline *oml;
{
int i;
@@ -962,12 +972,12 @@ char *oi, *oa, *of;
if (xe != D_width - 1)
{
RefreshLine(y, xs, xe, 0);
- /* UpdateLine(oi, oa, of, y, xs, xe); */
+ /* UpdateLine(oml, y, xs, xe); */
return;
}
GotoPos(xs, y);
- if (D_attr && D_UT)
- SetAttr(0);
+ if (D_UT)
+ SetRendition(&mchar_null);
if (n > 0)
{
if (D_CDC && !(n == 1 && D_DC))
@@ -980,7 +990,7 @@ char *oi, *oa, *of;
else
{
RefreshLine(y, xs, xe, 0);
- /* UpdateLine(oi, oa, of, y, xs, xe); */
+ /* UpdateLine(oml, y, xs, xe); */
return;
}
}
@@ -1003,7 +1013,7 @@ char *oi, *oa, *of;
}
else
{
- /* UpdateLine(oi, oa, of, y, xs, xe); */
+ /* UpdateLine(oml, y, xs, xe); */
RefreshLine(y, xs, xe, 0);
return;
}
@@ -1093,8 +1103,8 @@ int xs, ys, xe, ye, n;
aldlfaster = (n > 1 && ye == D_bot && ((up && D_CDL) || (!up && D_CAL)));
- if (D_attr && D_UT)
- SetAttr(0);
+ if (D_UT)
+ SetRendition(&mchar_null);
if ((up || D_SR) && D_top == ys && D_bot == ye && !aldlfaster)
{
if (up)
@@ -1149,7 +1159,7 @@ register int new;
{
register int i, j, old, typ;
- if (!display || (old = D_attr) == new)
+ if (!display || (old = D_rend.attr) == new)
return;
typ = D_atyp;
if ((new & old) != old)
@@ -1159,7 +1169,14 @@ register int new;
if ((typ & ATYP_S))
PutStr(D_SE);
if ((typ & ATYP_M))
- PutStr(D_ME);
+ {
+ PutStr(D_ME);
+#ifdef COLOR
+ /* ansi attrib handling: \E[m resets color, too */
+ if (D_CAF || D_CAB)
+ D_rend.color = 0;
+#endif
+ }
old = 0;
typ = 0;
}
@@ -1175,7 +1192,7 @@ register int new;
typ |= D_attrtyp[i];
}
}
- D_attr = new;
+ D_rend.attr = new;
D_atyp = typ;
}
@@ -1183,13 +1200,23 @@ void
SetFont(new)
int new;
{
- if (!display || D_font == new)
+ if (!display || D_rend.font == new)
return;
- D_font = new;
+ D_rend.font = new;
#ifdef KANJI
if ((new == KANJI || new == KANA) && D_kanji)
return; /* all done in RAW_PUTCHAR */
#endif
+ if (D_xtable && D_xtable[(int)(unsigned char)new] &&
+ D_xtable[(int)(unsigned char)new][256])
+ {
+ PutStr(D_xtable[(int)(unsigned char)new][256]);
+ return;
+ }
+
+ if (!D_CG0 && new != '0')
+ new = ASCII;
+
if (new == ASCII)
PutStr(D_CE0);
#ifdef KANJI
@@ -1203,12 +1230,73 @@ int new;
CPutStr(D_CS0, new);
}
+#ifdef COLOR
void
-SetAttrFont(newattr, newcharset)
-int newattr, newcharset;
+SetColor(new)
+int new;
{
- SetAttr(newattr);
- SetFont(newcharset);
+ int of, ob, f, b;
+
+ if (!display || D_rend.color == new)
+ return;
+ of = D_rend.color & 0xf;
+ ob = (D_rend.color >> 4) & 0xf;
+ f = new & 0xf;
+ b = (new >> 4) & 0xf;
+
+ if (!D_CAX && ((f == 0 && f != of) || (b == 0 && b != ob)))
+ {
+ int oattr;
+
+ oattr = D_rend.attr;
+ AddStr("\033[m");
+ D_rend.attr = 0;
+ D_rend.color = 0;
+ of = ob = 0;
+ SetAttr(oattr);
+ }
+ if (D_CAF || D_CAB)
+ {
+ if (f != of)
+ CPutStr(D_CAF, 9 - f);
+ if (b != ob)
+ CPutStr(D_CAB, 9 - b);
+ }
+ D_rend.color = new;
+}
+#endif
+
+void
+SetRendition(mc)
+struct mchar *mc;
+{
+ if (!display)
+ return;
+ if (D_rend.attr != mc->attr)
+ SetAttr(mc->attr);
+#ifdef COLOR
+ if (D_rend.color != mc->color)
+ SetColor(mc->color);
+#endif
+ if (D_rend.font != mc->font)
+ SetFont(mc->font);
+}
+
+void
+SetRenditionMline(ml, x)
+struct mline *ml;
+int x;
+{
+ if (!display)
+ return;
+ if (D_rend.attr != ml->attr[x])
+ SetAttr(ml->attr[x]);
+#ifdef COLOR
+ if (D_rend.color != ml->color[x])
+ SetColor(ml->color[x]);
+#endif
+ if (D_rend.font != ml->font[x])
+ SetFont(ml->font[x]);
}
void
@@ -1278,7 +1366,7 @@ char *msg;
{
debug1("using STATLINE %d\n", STATLINE);
GotoPos(0, STATLINE);
- SetAttrFont(A_SO, ASCII);
+ SetRendition(&mchar_so);
InsertMode(0);
AddStr(msg);
D_x = -1;
@@ -1286,7 +1374,7 @@ char *msg;
else
{
debug("using HS\n");
- SetAttrFont(0, ASCII);
+ SetRendition(&mchar_null);
InsertMode(0);
if (D_hstatus)
PutStr(D_DS);
@@ -1341,7 +1429,7 @@ RemoveStatus()
else
{
/*
- SetAttrFont(0, ASCII);
+ SetRendition(&mchar_null);
if (D_hstatus)
PutStr(D_DS);
*/
@@ -1357,24 +1445,30 @@ RemoveStatus()
void
RefreshStatus()
{
+ char *buf;
+
if (D_HS)
{
- SetAttrFont(0, ASCII);
+ SetRendition(&mchar_null);
if (D_hstatus)
PutStr(D_DS);
if (D_fore && D_fore->w_hstatus)
{
+ buf = MakeWinMsg(D_fore->w_hstatus, D_fore, '\005');
CPutStr(D_TS, 0);
- if (strlen(D_fore->w_hstatus) > D_WS)
- AddStrn(D_fore->w_hstatus, D_WS);
+ if (strlen(buf) > D_WS)
+ AddStrn(buf, D_WS);
else
- AddStr(D_fore->w_hstatus);
+ AddStr(buf);
PutStr(D_FS);
D_hstatus = 1;
}
}
else if (D_fore && D_fore->w_hstatus)
- Msg(0, D_fore->w_hstatus);
+ {
+ buf = MakeWinMsg(D_fore->w_hstatus, D_fore, '\005');
+ Msg(0, "%s", buf);
+ }
}
void
@@ -1387,8 +1481,8 @@ int y, from, to, isblank;
if (isblank == 0 && D_CE && to == D_width - 1)
{
GotoPos(from, y);
- if (D_attr && D_UT)
- SetAttr(0);
+ if (D_UT)
+ SetRendition(&mchar_null);
PutStr(D_CE);
isblank = 1;
}
@@ -1399,20 +1493,21 @@ void
FixLP(x2, y2)
register int x2, y2;
{
- int oldattr = D_attr, oldfont = D_font;
+ struct mchar oldrend;
ASSERT(display);
+ oldrend = D_rend;
GotoPos(x2, y2);
- SetAttrFont(D_lp_attr, D_lp_font);
- PUTCHAR(D_lp_image);
+ SetRendition(&D_lpchar);
+ PUTCHAR(D_lpchar.image);
D_lp_missing = 0;
- SetAttrFont(oldattr, oldfont);
+ SetRendition(&oldrend);
}
void
-DisplayLine(os, oa, of, s, as, fs, y, from, to)
+DisplayLine(oml, ml, y, from, to)
+struct mline *oml, *ml;
int from, to, y;
-register char *os, *oa, *of, *s, *as, *fs;
{
register int x;
int last2flag = 0, delete_lp = 0;
@@ -1422,8 +1517,7 @@ register char *os, *oa, *of, *s, *as, *fs;
ASSERT(from >= 0 && from < D_width);
ASSERT(to >= 0 && to < D_width);
if (!D_CLP && y == D_bot && to == D_width - 1)
- if (D_lp_missing
- || s[to] != os[to] || as[to] != oa[to] || of[to] != fs[to])
+ if (D_lp_missing || !cmp_mline(oml, ml, to))
{
if ((D_IC || D_IM) && from < to)
{
@@ -1435,55 +1529,52 @@ register char *os, *oa, *of, *s, *as, *fs;
{
to--;
delete_lp = (D_CE || D_DC || D_CDC);
- D_lp_missing = (s[to] != ' ' || as[to] || fs[to]);
- D_lp_image = s[to];
- D_lp_attr = as[to];
- D_lp_font = fs[to];
+ D_lp_missing = !cmp_mchar_mline(&mchar_blank, ml, to);
+ copy_mline2mchar(&D_lpchar, ml, to);
}
}
else
to--;
- for (x = from; x <= to; ++x)
+ for (x = from; x <= to; x++)
{
if (x || D_x != D_width || D_y != y - 1)
{
- if (x < to || x != D_width - 1 || s[x + 1] == ' ')
- if (s[x] == os[x] && as[x] == oa[x] && of[x] == fs[x])
+ if (x < to || x != D_width - 1 || ml->image[x + 1] == ' ')
+ if (cmp_mline(oml, ml, x))
continue;
GotoPos(x, y);
}
#ifdef KANJI
- if (badkanji(fs, x))
+ if (badkanji(ml->font, x))
{
x--;
GotoPos(x, y);
}
#endif
- SetAttr(as[x]);
- SetFont(fs[x]);
- PUTCHAR(s[x]);
+ SetRenditionMline(ml, x);
+ PUTCHAR(ml->image[x]);
#ifdef KANJI
- if (fs[x] == KANJI)
- PUTCHAR(s[++x]);
+ if (ml->font[x] == KANJI)
+ PUTCHAR(ml->image[++x]);
#endif
}
- if (to == D_width - 1 && y < D_height - 1 && s[to + 1] == ' ')
+ if (to == D_width - 1 && y < D_height - 1 && ml->image[to + 1] == ' ')
GotoPos(0, y + 1);
if (last2flag)
{
GotoPos(x, y);
- SetAttr(as[x + 1]);
- SetFont(fs[x + 1]);
- PUTCHAR(s[x + 1]);
+ SetRenditionMline(ml, x + 1);
+ PUTCHAR(ml->image[x + 1]);
GotoPos(x, y);
- SetAttr(as[x]);
- SetFont(fs[x]);
- INSERTCHAR(s[x]);
+ SetRenditionMline(ml, x);
+ INSERTCHAR(ml->image[x]);
}
else if (delete_lp)
{
- if (D_attr && D_UT)
- SetAttr(0);
+ if (D_UT)
+ {
+ SetRendition(&mchar_null);
+ }
if (D_DC)
PutStr(D_DC);
else if (D_CDC)
@@ -1571,7 +1662,7 @@ int block;
if ((newlay = (struct layer *)malloc(sizeof(struct layer))) == 0)
{
Msg(0, "No memory for layer struct");
- return(-1);
+ return -1;
}
data = 0;
if (datasize)
@@ -1580,7 +1671,7 @@ int block;
{
free((char *)newlay);
Msg(0, "No memory for layer data");
- return(-1);
+ return -1;
}
bzero(data, datasize);
}
@@ -1596,7 +1687,7 @@ int block;
D_lay = newlay;
D_layfn = newlay->l_layfn;
Restore();
- return(0);
+ return 0;
}
void
@@ -1741,9 +1832,12 @@ void
NukePending()
{/* Nuke pending output in current display, clear screen */
register int len;
- int oldfont = D_font, oldattr = D_attr, oldtop = D_top, oldbot = D_bot;
+ int oldtop = D_top, oldbot = D_bot;
+ struct mchar oldrend;
int oldkeypad = D_keypad, oldcursorkeys = D_cursorkeys;
+ int oldcurvis = D_curvis;
+ oldrend = D_rend;
len = D_obufp - D_obuf;
debug1("NukePending: nuking %d chars\n", len);
@@ -1769,6 +1863,7 @@ NukePending()
PutStr(D_SE);
PutStr(D_UE);
}
+ /* FIXME: reset color! */
/* Check for toggle */
if (D_IM && strcmp(D_IM, D_EI))
PutStr(D_EI);
@@ -1783,15 +1878,17 @@ NukePending()
D_cursorkeys = 0;
#endif
PutStr(D_CE0);
- D_font = ASCII;
- D_attr = 0;
+ D_rend = mchar_null;
D_atyp = 0;
PutStr(D_DS);
D_hstatus = 0;
+ PutStr(D_VE);
+ D_curvis = 0;
ChangeScrollRegion(oldtop, oldbot);
- SetAttrFont(oldattr, oldfont);
+ SetRendition(&oldrend);
KeypadMode(oldkeypad);
CursorkeysMode(oldcursorkeys);
+ CursorVisibility(oldcurvis);
if (D_CWS)
{
debug("ResizeDisplay: using WS\n");
diff --git a/src/display.h b/src/display.h
index 7e5daa0..9189ee9 100644
--- a/src/display.h
+++ b/src/display.h
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
* $Id$ FAU
@@ -35,7 +36,7 @@ struct kmap
#define KMAP_KEYS (T_OCAPS-T_CAPS)
#define KMAP_AKEYS (T_OCAPS-T_CURSOR)
-#define KMAP_EXT 10
+#define KMAP_EXT 50
#define KMAP_NOTIMEOUT 0x4000
@@ -53,15 +54,14 @@ struct display
struct win *d_other; /* pointer to other window */
char d_nonblock; /* don't block when d_obufmax reached */
char d_termname[20 + 1]; /* $TERM */
- char d_tentry[TERMCAP_BUFSIZE]; /* buffer for tgetstr */
+ char *d_tentry; /* buffer for tgetstr */
char d_tcinited; /* termcap inited flag */
int d_width, d_height; /* width/height of the screen */
int d_defwidth, d_defheight; /* default width/height of windows */
int d_top, d_bot; /* scrollregion start/end */
int d_x, d_y; /* cursor position */
- char d_attr; /* current attributes */
+ struct mchar d_rend; /* current rendition */
char d_atyp; /* current attribute types */
- char d_font; /* current font */
#ifdef KANJI
int d_mbcs; /* saved char for multibytes charset */
int d_kanji; /* what kanji type the display is */
@@ -70,12 +70,10 @@ struct display
int d_keypad; /* application keypad flag */
int d_cursorkeys; /* application cursorkeys flag */
int d_revvid; /* reverse video */
- int d_curinv; /* cursor invisible */
+ int d_curvis; /* cursor visibility */
int d_hstatus; /* hardstatus used */
int d_lp_missing; /* last character on bot line missing */
- int d_lp_image; /* missing image */
- int d_lp_attr; /* missing attr */
- int d_lp_font; /* missing font */
+ struct mchar d_lpchar; /* missing char */
time_t d_status_time; /* time of status display */
char d_status; /* is status displayed? */
char d_status_bell; /* is it only a vbell? */
@@ -113,6 +111,7 @@ struct display
char d_attrtyp[NATTR]; /* attrib group table */
short d_dospeed; /* baudrate of tty */
char d_c0_tab[256]; /* conversion for C0 */
+ char ***d_xtable; /* char translation table */
int d_UPcost, d_DOcost, d_LEcost, d_NDcost;
int d_CRcost, d_IMcost, d_EIcost, d_NLcost;
int d_printfd; /* fd for vt100 print sequence */
@@ -150,21 +149,18 @@ extern struct display TheDisplay;
#define D_bot DISPLAY(d_bot)
#define D_x DISPLAY(d_x)
#define D_y DISPLAY(d_y)
-#define D_attr DISPLAY(d_attr)
+#define D_rend DISPLAY(d_rend)
#define D_atyp DISPLAY(d_atyp)
-#define D_font DISPLAY(d_font)
#define D_mbcs DISPLAY(d_mbcs)
#define D_kanji DISPLAY(d_kanji)
#define D_insert DISPLAY(d_insert)
#define D_keypad DISPLAY(d_keypad)
#define D_cursorkeys DISPLAY(d_cursorkeys)
#define D_revvid DISPLAY(d_revvid)
-#define D_curinv DISPLAY(d_curinv)
+#define D_curvis DISPLAY(d_curvis)
#define D_hstatus DISPLAY(d_hstatus)
#define D_lp_missing DISPLAY(d_lp_missing)
-#define D_lp_image DISPLAY(d_lp_image)
-#define D_lp_attr DISPLAY(d_lp_attr)
-#define D_lp_font DISPLAY(d_lp_font)
+#define D_lpchar DISPLAY(d_lpchar)
#define D_status DISPLAY(d_status)
#define D_status_time DISPLAY(d_status_time)
#define D_status_bell DISPLAY(d_status_bell)
@@ -198,6 +194,7 @@ extern struct display TheDisplay;
#define D_attrtyp DISPLAY(d_attrtyp)
#define D_dospeed DISPLAY(d_dospeed)
#define D_c0_tab DISPLAY(d_c0_tab)
+#define D_xtable DISPLAY(d_xtable)
#define D_UPcost DISPLAY(d_UPcost)
#define D_DOcost DISPLAY(d_DOcost)
#define D_LEcost DISPLAY(d_LEcost)
@@ -217,10 +214,9 @@ extern struct display TheDisplay;
#define OUTPUT_BLOCK_SIZE 256 /* Block size of output to tty */
-#define AddChar(c) \
- { \
- if (--D_obuffree == 0) \
- Resize_obuf(); \
- *D_obufp++ = (c); \
- }
+#define AddChar(c) do { \
+ if (--D_obuffree == 0) \
+ Resize_obuf(); \
+ *D_obufp++ = (c); \
+} while (0)
diff --git a/src/doc/FAQ b/src/doc/FAQ
new file mode 100644
index 0000000..6c9c8af
--- /dev/null
+++ b/src/doc/FAQ
@@ -0,0 +1,253 @@
+ jw 21.10.93
+ 05.05.94
+
+ screen: frequently asked questions -- known problems -- unimplemented bugs
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+
+Q: Why is it impossible to download a file with Kermit/sz/rz when
+ screen is running? Do I need to set some special variables?
+
+A: Screen always interprets control-sequences sent by the
+ applications and translates/optimizes them for the current
+ terminal type. Screen always parses the user input for its
+ escape character (CTRL-A). Both are basic screen features and
+ cannot be switched off. Even if it were possible to switch
+ screen into a completely transparent mode, you could never switch
+ between windows, while kermit/sz/rz is downloading a file. You
+ must wait til the end as kermit/sz/rz will not transmit your
+ input during a file transfer and as kermit/sz/rz would be very
+ confused if screen switched away the window containing the
+ other kermit/sz/rz. Simply detach your screen session for each
+ file transfer and start the transfer program only from the shell
+ where you started screen.
+
+Q: I am using screen with a YYY terminal, which supports the XXX
+ graphic language. I am very happy with it, except one thing: I
+ cannot render graphics into screen windows.
+
+A: You are out of luck there. Screen provides a fixed set of escape
+ sequences in order to make it possible to switch terminal types.
+ Screen has to know exactly what the escape sequences do to the
+ terminal because it must hold an image in memory. Otherwise
+ screen could not restore the image if you switch to another
+ window. Because of this you have to change screens escape
+ sequence parser (ansi.c) to pass the XXX graphics sequences to
+ the terminal. Of course the graphics will be lost if you switch
+ to another window. Screen will only honour graphics sequences
+ that are demanded by an overwhelming majority.
+
+Q: For some unknown reason, the fifo in /tmp/screens/S-myname is
+ gone, and i can't resume my screen session. Is there a way to
+ recreate the fifo?
+
+A: Screen checks the fifo/socket whenever it receives a SIGCHLD
+ signal. If missing, the fifo/socket is recreated then. If screen
+ is running non set-uid the user can issue a 'kill -CHLD
+ screenpid' directly (it is -CHILD on some systems). Screenpid is
+ the process-id of the screen process found in a 'ps -x' listing.
+ But usually this won't work, as screen should be installed set-
+ uid root. In this case you will not be able to send it a signal,
+ but the kernel will. It does so, whenever a child of screen
+ changes its state. Find the process-id (shellpid below) of the
+ "least important" shell running inside screen. The try 'kill
+ -STOP shellpid'. If the fifo/socket does not reappear, destroy
+ the shell process. You sacrify one shell to save the rest. If
+ nothing works, please do not forget to remove all processes
+ running in the lost screen session.
+
+Q: When you start "screen" a page of text comes up to start you
+ off. Is there a way to get rid of this text as a command line
+ argument or by using a switch of some sort.
+
+A: Just put the following line in your ~/.screenrc:
+ startup_message off
+ Many peole ask this, although it is in the man page, too :-)
+
+Q: Start "screen emacs" and run emacs function suspend-emacs
+ (ctrl-z). The window containing emacs vanishes.
+
+A: This is a known bug. Unfortunatly there is no easy fix
+ because this is specified in the POSIX standard. When a new
+ window is created Screen opens up a new session because the
+ window has to get the pty as a controlling terminal (a
+ session can only have one controlling terminal). With the
+ setsid() call the process also creates a new process
+ group. This process group is orphaned, because there is no
+ process in the session which is not in the process
+ group. Now if the process group leader (i.e. your program)
+ gets a TTIN/TTOU/TSTP, POSIX states that the kernel must
+ send a KILL signal to the process group because there is no
+ one left to continue the process. Even if screen would
+ try to restart the program, that would be after it received the
+ KILL signal which cannot be caught or ignored.
+
+ tromey@klab.caltech.edu (Tom Tromey): I've noticed this exact
+ same problem. I put this in my .emacs file. It seems to work:
+
+ ;; If running under screen, disable C-z.
+ (if (and (getenv "STY") (not window-system))
+ (global-unset-key "\C-z"))
+
+Q: Screen gets the terminal size wrong and messes up.
+
+A: Before you start screen: Check with 'stty -a' what the terminal
+ driver thinks about rows and columns. Check the environment
+ variables LINES and COLUMNS. Then from within screen check with
+ the info command (CTRL-A i) what size screen thinks your terminal
+ is. If correcting tty driver setting and environment variables
+ does not help, look up the terminal capability definition. First
+ the TERMCAP environment variable. If this is not set, look up the
+ terminals name as defined in the environment variable TERM in
+ /etc/termcap or in the terminfo database with untic or infocmp.
+ There may be :li=...: and :co=...: or even :ll=...: entries
+ (cols#... and lines#... when it's terminfo) defined incorrectly.
+ Either construct your own TERMCAP environment variables with
+ correct settings, use screens terminfo/termcap command in your
+ .screenrc file or have the database corrected by the system
+ administrator.
+
+Q: Screen messes up the terminal output when I use my favourite ap-
+ plication. Setting the terminal size does not help.
+
+A: Probably you got the termcap/terminfo entries wrong. Fixing this
+ is a three stage procedure. First, find out if terminfo or
+ termcap is used. If your system only has /etc/termcap,
+ but not /usr/lib/terminfo/... then you are using termcap.
+ Easy. But if your system has both, then it depends how the appli-
+ cation and how screen were linked. Beware, if your applica-
+ tion runs on another host via rlogin, telnet or the like, you
+ should check the terminfo/termcap databases there. If you cannot
+ tell if terminfo or termcap is used (or you just want to be
+ save), the do all steps in stage 3 in parallel for both
+ systems (on all envolved hosts). Second: Understand the basic
+ rules how screen does its terminal emulation. When screen is
+ started or reattached, it relies on the TERM environment variable
+ to correctly reflect the terminal type you have physically
+ in front of you. And the entry should either exist in the system
+ terminfo/termcap database or be specified via the TERMCAP en-
+ vironment variable (if screen is using the termcap system). On
+ the other end, screen understands one set of control codes. It
+ relies on the application using these codes. This means applica-
+ tions that run under screen must be able to adapt their con-
+ trol codes to screen. The application should use the TERM vari-
+ able and termcap or terminfo library to find out how to drive
+ its terminal. When running under screen, the terminal is virtual
+ and is only defined by the set of control codes that screen
+ understands. The TERM variable is automatically set to
+ "screen" and the "screen"-entries should exist in the data-
+ bases. If your application uses hardcoded control codes rather
+ than a database, you are on your own. Hint: The codes under-
+ stood by screen are a superset of the very common definition
+ named "vt100". Look at the documentation of screen. The
+ codes are listed there. Third: Have the entry "screen" in-
+ stalled on all hosts or make sure you can live with "vt100".
+ Check the codes sent by your application, when the TERM variable
+ is set to "screen". Do not try to set the TERM variable inside
+ screen to anything other than "screen" or "vt100" or compati-
+ ble. Thus your application can drive screen correctly. Also take
+ care that a good entry is installed for your physical terminal
+ that screen has to drive. Even if the entry was good enough
+ for your application to drive the terminal directly, screen may
+ find flaws, as it tries to use other capabilities while op-
+ timizing the screen output. The screenrc commands
+ "termcap" and/or "terminfo" may help to fine-tune capabilities
+ without calling the supervisor to change the database.
+
+Q: I cannot configure screen. Sed does not work.
+
+A: The regular expressions used in our configure scrip are too
+ complicated for GNU sed version 2.03. In this regard it is bug
+ compatible with Ultrix 3.1 "sed": GNU sed version 2.03 dumps
+ core with our configure script. Try an older release. E.g. from
+ ftp.uni-erlangen.de:/pub/utilities/screen/sed-2.02b.tar.gz
+
+Q: When reattaching a session from a different Workstation, the
+ DISPLAY environment variable should be updated. Even ``CTLR-A
+ : setenv DISPLAY newhost:0'' does not work as expected.
+
+A: Under unix every process has its own environment. The environ-
+ ment of the SCREEN process can be changed with the `setenv' com-
+ mand. This however cannot affect the environment of the
+ shells or applications already running under screen. Subsequently
+ spawned processes will reflect the changes. One should be aware
+ of this problem when running applications from very old shells.
+ Screen is a means for keeping processes alive.
+
+Q: About once every 5 times I ran the program, rather than getting
+ a "screen," I got someone elses IRC output/input.
+
+A: What probably happened is that an IRC process was left running on
+ a pseudo tty in such a way that the kernel thought the tty was
+ available for reallocation. You can fix this behaviour by
+ applying the SunOS 4.1.x tty jumbo patch (100513-04).
+
+Q: Screen compiled on SunOS 5.3 cannot reattach a detached session.
+
+A: You are using /usr/ucb/cc, this compiler is wrong. Actually it
+ links with a C-library that mis-interprets dirent. Try again
+ with /opt/SUNWspro/bin/cc!
+
+Q: The "talk" command does not work when Screen is active.
+
+A: Talk and several other programs rely on entries in the Utmp-
+ Database (/etc/utmp). On some systems this Database is world
+ writable, on others it is not. If it is not, screen must be
+ installed with the appropriate permissions (user or group s-bit)
+ just like any program that uses PTYs (rlogin, xterm, ...). When
+ screen cannot write to utmp, you will see messages on you display
+ which do not belong to any screen window.
+ When screen can update utmp, it is not guaranteed that it does as
+ you expect. First this depends on the config.h file defining
+ UTMPOK, LOGINDEFAULT, and perhaps CAREFULUTMP. Second it depends
+ on the screenrc files (system wide and per user), if utmp entries
+ are done. Third, you can control whether windows are logged in
+ with screens ``login'' command.
+
+Q: Seteuid() does not work as expected in AIX. Attempting a multi-
+ user-attach results in a screen-panic: "seteuid: not owner".
+
+A: This is not a screen problem. According to Kay Nettle
+ (pkn@cs.utexas.edu) you need the AIX patch PTF 423674.
+
+Q: When I type cd directory (any directory or just blank) from
+ within one of the windows in screen, the whole thing just freezes
+ up.
+
+A: You display the current working directory in xterm's title bar,
+ This may be caused by hardcoded ESC-sequences in the shell prompt
+ or in an cd alias. In Xterm the coding is
+ ESC ] n ; string_to_display ^G
+ where n = 1, 2, 3 selects the location of the displayed string.
+ Screen misinterprets this as the ansi operating system comment
+ sequence:
+ ESC ] osc_string
+ and waits (according to ansi) for the string terminator
+ ESC \
+ Screen versions after 3.5.12 may provide a workaround.
+
+Q: Mesg or biff cannot be turned on or off while running screen.
+
+A: Screen failed to change the owner of the pty it uses. You need to
+ install screen setuid-root. See the file INSTALL for details.
+
+Q: The cursor left key deletes the characters instead of just moving the
+ cursor. A redisplay (^Al) brings everything back.
+
+A: Your terminal emulator treats the backspace as "destructive". You
+ can probably change this somewhere in the setup. We can't think
+ of a reason why anybody would want a destructive backspace, but
+ if you really must have it, add the lines
+ termcap <TERM> 'bc@:bs@'
+ terminfo <TERM> 'bc@:bs@'
+ to your ~/.screenrc (replace <TERM> with the terminal type your
+ emulator uses).
+
+Q: I have an old SysV OS (like Motorola SysV68) and sometimes screen
+ doesn't reset the attributes correctly. A redisplay (^Al) doesn't
+ make things better.
+
+A: The libcurses library has a bug if attributes are cleared with
+ the special ue/se capabilities. As a workaround (other than upgrading
+ your system) modify 'rmul' (and 'rmso'?) in screen's terminfo entry:
+ rmul=\E[m, rmso=\E[m
diff --git a/src/doc/Makefile.in b/src/doc/Makefile.in
index ac604c1..3f11826 100644
--- a/src/doc/Makefile.in
+++ b/src/doc/Makefile.in
@@ -22,17 +22,17 @@ dvi screen.dvi: screen.texinfo mostlyclean
info screen.info: screen.texinfo
$(MAKEINFO) $(srcdir)/screen.texinfo -o screen.info
-install:
- $(INSTALL_DATA) -c $(srcdir)/screen.1 $(mandir)/man1/screen.1
+install: installdirs
+ $(INSTALL_DATA) $(srcdir)/screen.1 $(mandir)/man1/screen.1
-$(MAKE) screen.info
-if test -f screen.info; then d=.; else d=$(srcdir); fi; \
if test -f $$d/screen.info; then \
- for f in $$d/screen.info*; do $(INSTALL_DATA) -c $$f $(infodir)/$$f;done; \
+ for f in $$d/screen.info*; do $(INSTALL_DATA) $$f $(infodir)/$$f;done; \
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
install-info --infodir=$(infodir) $$d/screen.info; \
else true; fi; \
fi
-
+
uninstall:
rm -f $(mandir)/man1/screen.1
rm -f $(infodir)/screen.info*
diff --git a/src/doc/screen.1 b/src/doc/screen.1
index c30f5d5..daabf6c 100644
--- a/src/doc/screen.1
+++ b/src/doc/screen.1
@@ -1,4 +1,5 @@
-.TH SCREEN 1 "28 Nov 1994"
+.\" vi:set wm=5
+.TH SCREEN 1 "15 Oct 1995"
.if n .ds Q \&"
.if n .ds U \&"
.if t .ds Q ``
@@ -112,44 +113,20 @@ commands and their bindings. Each keystroke is discussed in
the section \*QDEFAULT KEY BINDINGS\*U. The manual section \*QCUSTOMIZATION\*U
deals with the contents of your .screenrc.
.PP
-If possible, choose a version of your terminal's termcap that has automatic
-margins turned \fIoff\fP.
-This will ensure an accurate and optimal update of the screen
-in all circumstances.
-The next best thing is an auto-margin terminal that allows the last position
-on the screen to be updated without scrolling the screen (such as a VT100).
-This also allows the entire screen to be updated.
-Lastly, if all you've got is a \*Qtrue\*U auto-margin terminal
-.I screen
-will be content to use it, but updating a character put into the last position
-on the screen may not be possible until the screen scrolls or the character
-is moved into a safe position in some other way.
-This delay can be shortened by using a terminal with insert-character
+If your terminal is a \*Qtrue\*U auto-margin terminal (it doesn't allow
+the last position on the screen to be updated without scrolling the
+screen) consider to use a version of your terminal's termcap that has
+automatic margins turned \fIoff\fP. This will ensure an accurate and
+optimal update of the screen in all circumstances. Most terminals
+nowadays have \*Qmagic\*U margins (automatic margins plus usable last
+column). This is the VT100 style type and perfectly suited for
+\fIscreen\fP.
+If all you've got is a \*Qtrue\*U auto-margin terminal \fIscreen\fP
+will be content to use it, but updating a character put into the last
+position on the screen may not be possible until the screen scrolls or
+the character is moved into a safe position in some other way. This
+delay can be shortened by using a terminal with insert-character
capability.
-.PP
-If your terminal is of the second type (firm-margined `am'), you will
-want to let
-.I screen
-know about this, since a normal termcap doesn't distinguish this type of
-automatic margins from a \*Qtrue\*U `am' terminal.
-You do this by specifying the `LP' capability in your termcap
-(see the \*Qtermcap\*U .screenrc command), or by using the
-.B \-L
-command-line option.
-.I Screen
-needs this information to correctly update the screen. Note that a `xv' together
-with an `am' flag effects like `LP'.
-.PP
-If you are using a \*Qtrue\*U auto-margin terminal (no `LP') at low baud
-rates, you may want to turn on a more optimal output mode by including the
-flag `OP' in your termcap entry, or by specifying the
-.B \-O
-command-line option.
-The trade-off is that
-.I screen
-will no-longer accurately emulate the VT100's line-end quirks (e.\|g. the
-screen will scroll after putting \fIone\fP character in the last screen
-position).
.SH "COMMAND-LINE OPTIONS"
@@ -332,7 +309,7 @@ Switch to window number 0 \- 9.
Toggle to the window displayed previously.
Note that this binding defaults to the command character typed twice,
unless overridden; for instance, if you use the option \*Q\fB\-e]x\fP\*U,
-this function becomes \*Q]]\*U, not \*Q]C-a\*U.
+this command becomes \*Q]]\*U, not \*Q]C-a\*U.
.IP "\fBC-a a\fP (meta)"
Send the command character (C-a) to window. See \fIescape\fP command.
.IP "\fBC-a A\fP (title)"
@@ -436,11 +413,12 @@ Send a control-s to the current window.
.IP "\fBC-a C-t\fP (time)"
.PD
Show system information.
-.IP "\fBC-a v\fP"
-.PD 0
-.IP "\fBC-a C-v\fP (version)"
+.IP "\fBC-a v\fP (version)"
.PD
Display the version and compilation date.
+.IP "\fBC-a C-v\fP (digraph)"
+.PD
+Enter digraph.
.IP "\fBC-a w\fP"
.PD 0
.IP "\fBC-a C-w\fP (windows)"
@@ -798,8 +776,7 @@ you have to press the key twice (i.e. escape the escape binding).
bindkey -k F1 command
.fi
Make the F11 (not F1!) key an alternative screen
-escape (besides ^A). Note that \*QF11 F11\*U does not work in
-the current release of screen.
+escape (besides ^A).
.sp
.ne 3
.B break
@@ -839,6 +816,22 @@ Users with fonts that have usable characters in the
c1 positions may want to turn this off.
.sp
.ne 3
+.BI "charset " set
+.PP
+Change the current character set slot designation and charset
+mapping. The first four character of
+.I set
+are treated as charset designators while the fifth and sixth
+character must be in range '0' to '3' and set the GL/GR charset
+mapping. On every position a '.' may be used to indicate that
+the corresponding charset/mapping should not be changed
+(\fIset\fP is padded to six characters internally by appending '.'
+chars). New windows have "BBBB02" as default charset, unless a
+\*Qkanji\*U command is active.
+.br
+The current setting can be viewed with the \*Qinfo\*U command.
+.sp
+.ne 3
.B chdir
.RI [ directory ]
.PP
@@ -1043,7 +1036,14 @@ to that file: \*QC-A [ g SPACE G $ >\*U.
\fBC-g\fP gives information about the current line and column.
.br
.ti -2n
+\fBx\fP exchanges the first mark and the current cursor position. You
+can use this to adjust an already placed mark.
+.br
+.ti -2n
\fB@\fP does nothing. Does not even exit copy mode.
+.br
+.ti -2n
+All keys not described here exit copy mode.
.in -4n
.sp
.ne 3
@@ -1082,6 +1082,13 @@ Note that you can use the special `AN' terminal capability if you
want to have a dependency on the terminal type.
.sp
.ne 3
+.BR "defcharset " [ \fIset ]
+.PP
+Like the \fBcharset\fP command except that the default setting for
+new windows is changed. Shows current default if called without
+argument.
+.sp
+.ne 3
.BI "defescape " xy
.PP
Set the default command characters. This is equivalent to the
@@ -1108,6 +1115,23 @@ Same as the \fBgr\fP command except that the default setting for new
windows is changed. Initial setting is `off'.
.sp
.ne 3
+.BR "defhstatus " [ \fIstatus ]
+.PP
+The hardstatus line that all new windows will get is set to
+.I status\fR.
+This command is useful to make the hardstatus of every window
+display the window number or title or the like.
+.I Status
+may contain the same directives as in the window messages, but
+the directive escape character is '^E' (octal 005) instead of '%'.
+This was done to make a misinterpretion of program generated
+hardstatus lines impossible.
+If the parameter
+.I status
+is omitted, the current default string is displayed.
+Per default the hardstatus line of new windows is empty.
+.sp
+.ne 3
.BR "defkanji jis" | sjis | euc
.PP
Same as the \fBkanji\fP command except that the default setting for new
@@ -1181,6 +1205,22 @@ with the
option. (See also section \*QCOMMAND-LINE OPTIONS\*U.)
.sp
.ne 3
+.BR "digraph " [ \fIpreset ]
+.PP
+This command prompts the user for a digraph sequence. The next
+two characters typed are looked up in a builtin table and the
+resulting character is inserted in the input stream. For example,
+if the user enters 'a"', an a-umlaut will be inserted. If the
+first character entered is a 0 (zero),
+.I screen
+will treat the following charcters (up to three) as an octal
+number instead. The optional argument
+.I preset
+is treated as user input, thus one can create an \*Qumlaut\*U key.
+For example the command "bindkey ^K digraph '"'" enables the user
+to generate an a-umlaut by typing CTRL-K a.
+.sp
+.ne 3
.B dumptermcap
.PP
Write the termcap entry for the virtual terminal optimized for the currently
@@ -1244,11 +1284,11 @@ running subprocess in this window.
When a subprocess is running the `kill' command will affect it instead of the
windows process.
.br
-Refer to the postscript file `fdpat.ips' for illustration of all 21 possible
-combinations. Each drawing shows the numbers 210 representing the three
-file descriptors of newcommand. The box marked `W' is usual pty that has
-the old process (shell) on its slave side. The box marked `P' is the
-secondary pty that now has
+Refer to the postscript file `fdpat.ips' for a confusing illustration
+of all 21 possible combinations. Each drawing shows the digits 2,1,0
+representing the three file descriptors of newcommand. The box marked
+`W' is usual pty that has the application-process on its slave side.
+The box marked `P' is the secondary pty that now has
.I screen
at its master side.
.sp
@@ -1286,7 +1326,16 @@ exec !..| less
.PP
This adds a pager to the window output. The special character `|' is needed to
give the user control over the pager although it gets its input from the
-original process.
+window's process. This works, because
+.I less
+listens on stderr (a behavior that
+.I screen
+would not expect without the `|')
+when its stdin is not a tty.
+.I Less
+versions newer than 177 fail miserably here; good old
+.I pg
+still works.
.IP
!:sed -n s/.*Error.*/\e007/p
.PP
@@ -1367,8 +1416,7 @@ The first pages list all the internal commands followed by their current
bindings.
Subsequent pages will display the custom commands, one command per key.
Press space when you're done reading each page, or return to exit early.
-All other characters are ignored, except for the command character, which will
-allow you to execute commands even when the help screen is still visible.
+All other characters are ignored.
See also \*QDEFAULT KEY BINDINGS\*U section.
.sp
.ne 3
@@ -1472,19 +1520,18 @@ is started) and is executed with the user's uid and gid.
.PP
Start/stop writing output of the current window to a file
\*Qscreenlog.\fIn\fP\*U in the window's default directory, where \fIn\fP
-is the number of the current window. If no parameter is given, the state
+is the number of the current window. This filename can be changed with
+the `logfile' command. If no parameter is given, the state
of logging is toggled. The session log is appended to the previous contents
of the file if it already exists. The current contents and the contents
of the scrollback history are not included in the session log.
Default is `off'.
.sp
.ne 3
-.BI "logdir "directory
+.BI "logfile " filename
.PP
-Defines a directory where logfiles will be placed. If unset logfiles are written
-in
-.IR screen's
-current working directory.
+Defines the name the logfiles will get. The default is
+\*Qscreenlog.%n\*U.
.sp
.ne 3
.BR "login " [ on | off ]
@@ -1842,7 +1889,7 @@ is assigned to this window.
Thus, the first window can be activated by \*Qselect 0\*U (there can be no more
than 10 windows present simultaneously unless
.I screen
-is compiled with a higher MAXWIN setting).
+was compiled with a higher MAXWIN setting).
.sp
.ne
.BR "sessionname " [ \fIname ]
@@ -1916,6 +1963,22 @@ underlying system exposes flow control problems while pasting large amounts of
text.
.sp
.ne 3
+.B sorendition
+.RB [ "\fIattr\fR " [ \fIcolor ]]
+.PP
+Change the way screen does highlighting for text marking and printing
+messages.
+.I Attr
+is a hexadecimal number and describes the attributes (inverse,
+underline, ...) the text will get.
+.I Color
+is a 2 digit number and changes the
+forground/background of the highlighted text.
+Some knowledge of screen's internal character representation is
+needed to make the characters appear in the desired way. The default
+is currently 10 99 (standout, default colors).
+.sp
+.ne 3
.B "startup_message on\fP|\fBoff"
.PP
Select whether you want to see the copyright notice during startup.
@@ -1956,8 +2019,7 @@ is VT100/ANSI compatible.
The use of the \*Qterm\*U command is discouraged for non-default purpose.
That is, one may want to specify special $TERM settings (e.g. vt100) for the
next \*Qscreen rlogin othermachine\*U command. Use the command \*Qscreen -T vt100
-rlogin othermachine\*U rather than setting (\*Qterm vt100\*U) and resetting
-(\*Qterm screen\*U) the default before and after the \*Qscreen\*U command.
+rlogin othermachine\*U rather than setting and resetting the default.
.sp
.ne 3
.BI termcap " term terminal-tweaks"
@@ -1965,6 +2027,9 @@ rlogin othermachine\*U rather than setting (\*Qterm vt100\*U) and resetting
.br
.BI terminfo " term terminal-tweaks"
.RI [ window-tweaks ]
+.br
+.BI termcapinfo " term terminal-tweaks"
+.RI [ window-tweaks ]
.PP
Use this command to modify your terminal's termcap entry without going through
all the hassles involved in creating a custom termcap entry.
@@ -1973,9 +2038,14 @@ If your system works with terminfo-database rather than with
termcap,
.I screen
will understand the `terminfo' command, which has the same effects as
-the `termcap' command. Thus users can write one .screenrc file that handles
-both cases, although terminfo syntax is slightly different
-from termcap syntax.
+the `termcap' command. Two separate commands are provided, as there are subtle
+syntactic differences, e.g. when parameter interpolation (using `%') is
+required. Note that termcap names of the capabilities have to be used
+with the `terminfo' command.
+.br
+In many cases, where the arguments are valid in both terminfo and termcap
+syntax, you can use the command `termcapinfo', which is just a shorthand
+for a pair of `termcap' and `terminfo' commands with identical arguments.
.PP
The first argument specifies which terminal(s) should be affected by this
definition.
@@ -2094,7 +2164,7 @@ visual bell message. The default is 1 second.
Print the current version and the compile date in the status line.
.sp
.ne 3
-.BI "wall " "message ..."
+.BI "wall " "message"
.PP
Write a message to all displays. The message will appear in the terminal's
status line.
@@ -2336,7 +2406,7 @@ Here's some .screenrc examples:
screen -t top 2 nice top
.PP
Adding this line to your .screenrc would start a nice-d version of the
-\*Qtop\*U command in window 2 name \*Qtop\*U rather than \*Qnice\*U.
+\*Qtop\*U command in window 2 named \*Qtop\*U rather than \*Qnice\*U.
.sp
.nf
shelltitle '> |csh'
@@ -2404,6 +2474,11 @@ PROMPT_COMMAND='echo -n -e "\e033k\e033\e134"'
.SH "THE VIRTUAL TERMINAL"
+Each window in a
+.I screen
+session emulates a VT100 terminal, with some extra functions added. The
+VT100 emulator is hardcoded, no other terminal types can be emulated.
+.br
Usually
.I screen
tries to emulate as much of the VT100/ANSI standard
@@ -2519,6 +2594,16 @@ As a side-effect, programs running in different windows can
send output to the printer simultaneously.
Data sent to the printer is not displayed in the window.
.PP
+.I Screen
+maintains a hardstatus line for every window. If a window
+gets selected, the display's hardstatus will be updated to match
+the window's hardstatus line. If the display has no hardstatus
+the line will be displayed as a standard screen message.
+The hardstatus line can be changed with the ANSI Application
+Program Command (APC): \*QESC_<string>ESC\e\*U. As a convenience
+for xterm users the sequence \*QESC]0..2;<string>^G\*U is
+also accepted.
+.PP
Some capabilities are only put into the $TERMCAP
variable of the virtual terminal if they can be efficiently
implemented by the physical terminal.
@@ -2565,6 +2650,18 @@ Restore Cursor and Attributes
.B "ESC c"
Reset to Initial State
.TP 27
+.B "ESC g"
+Visual Bell
+.TP 27
+.B "ESC \fPPn\fB p"
+Cursor Visibility (97801)
+.TP 27
+\h'\w'ESC 'u'Pn = \fB6\fP
+Invisible
+.TP 27
+\h'\w'ESC Pn = 'u'\fB7\fP
+Visible
+.TP 27
.BR "ESC =" " (V)"
Application Keypad Mode
.TP 27
@@ -2592,10 +2689,10 @@ Outputs a string directly to the host
terminal without interpretation.
.TP 27
.BR "ESC _" " (A)"
-Application Program Command (not used)
+Application Program Command (Hardstatus)
.TP 27
.BR "ESC ]" " (A)"
-Operating System Command (not used)
+Operating System Command (Hardstatus, xterm title hack)
.TP 27
.BR "Control-N" " (A)"
Lock Shift G1 (SO)
@@ -2637,10 +2734,10 @@ Direct Cursor Addressing
Erase in Display
.TP 27
\h'\w'ESC [ 'u'Pn = None or \fB0\fP
->From Cursor to End of Screen
+From Cursor to End of Screen
.TP 27
\h'\w'ESC [ Pn = 'u'\fB1\fP
->From Beginning of Screen to Cursor
+From Beginning of Screen to Cursor
.TP 27
\h'\w'ESC [ Pn = 'u'\fB2\fP
Entire Screen
@@ -2649,10 +2746,10 @@ Entire Screen
Erase in Line
.TP 27
\h'\w'ESC [ 'u'Pn = None or \fB0\fP
->From Cursor to End of Line
+From Cursor to End of Line
.TP 27
\h'\w'ESC [ Pn = 'u'\fB1\fP
->From Beginning of Line to Cursor
+From Beginning of Line to Cursor
.TP 27
\h'\w'ESC [ Pn = 'u'\fB2\fP
Entire Line
@@ -2708,6 +2805,42 @@ Not Blinking
\h'\w'ESC [ Ps = 'u'\fB27\fP (A)
Positive Image
.TP 27
+\h'\w'ESC [ Ps = 'u'\fB30\fP (A)
+Foreground Black
+.TP 27
+\h'\w'ESC [ Ps = 'u'\fB31\fP (A)
+Foreground Red
+.TP 27
+\h'\w'ESC [ Ps = 'u'\fB32\fP (A)
+Foreground Green
+.TP 27
+\h'\w'ESC [ Ps = 'u'\fB33\fP (A)
+Foreground Yellow
+.TP 27
+\h'\w'ESC [ Ps = 'u'\fB34\fP (A)
+Foreground Blue
+.TP 27
+\h'\w'ESC [ Ps = 'u'\fB35\fP (A)
+Foreground Magenta
+.TP 27
+\h'\w'ESC [ Ps = 'u'\fB36\fP (A)
+Foreground Cyan
+.TP 27
+\h'\w'ESC [ Ps = 'u'\fB37\fP (A)
+Foreground White
+.TP 27
+\h'\w'ESC [ Ps = 'u'\fB39\fP (A)
+Foreground Default
+.TP 27
+\h'\w'ESC [ Ps = 'u'\fB40\fP (A)
+Background Black
+.TP 27
+\h'\w'ESC [ Ps = 'u'\fB...\fP
+...
+.TP 27
+\h'\w'ESC [ Ps = 'u'\fB49\fP (A)
+Background Default
+.TP 27
.B "ESC [ \fPPn\fB g"
Tab Clear
.TP 27
@@ -2738,6 +2871,12 @@ Insert Character
.BR "ESC [ \fPPn\fB P" " (A)"
Delete Character
.TP 27
+.B "ESC [ \fPPn\fB S"
+Scroll Scrolling Region Up
+.TP 27
+.B "ESC [ \fPPn\fB T"
+Scroll Scrolling Region Down
+.TP 27
.B "ESC [ \fPPs\fB ;\fP...\fB; \fPPs\fB h"
Set Mode
.TP 27
@@ -2747,6 +2886,12 @@ Reset Mode
\h'\w'ESC [ 'u'Ps = \fB4\fP (A)
Insert Mode
.TP 27
+\h'\w'ESC [ Ps = 'u'\fB20\fP (A)
+\fIAutomatic Linefeed\fP Mode
+.TP 27
+\h'\w'ESC [ Ps = 'u'\fB34\fP
+Normal Cursor Visibility
+.TP 27
\h'\w'ESC [ Ps = 'u'\fB?1\fP (V)
Application Cursor Keys
.TP 27
@@ -2754,7 +2899,7 @@ Application Cursor Keys
Change Terminal Width to 132 columns
.TP 27
\h'\w'ESC [ Ps = 'u'\fB?5\fP (V)
-Visible Bell (\fIOn\fP followed by \fIOff\fP)
+Reverse Video
.TP 27
\h'\w'ESC [ Ps = 'u'\fB?6\fP (V)
\fIOrigin\fP Mode
@@ -2762,6 +2907,9 @@ Visible Bell (\fIOn\fP followed by \fIOff\fP)
\h'\w'ESC [ Ps = 'u'\fB?7\fP (V)
\fIWrap\fP Mode
.TP 27
+\h'\w'ESC [ Ps = 'u'\fB?25\fP (V)
+Visible Cursor
+.TP 27
.BR "ESC [ 5 i" " (A)"
Start relay to printer (ANSI Media Copy)
.TP 27
@@ -2774,6 +2922,9 @@ Resize the window to `Ph' lines and `Pw' columns (SunView special)
.B "ESC [ c"
Send VT100 Identification String
.TP 27
+.B "ESC [ x"
+Send Terminal Parameter Report
+.TP 27
.B "ESC [ > c"
Send VT220 Secondary Device Attributes String
.TP 27
@@ -2877,12 +3028,16 @@ Keypad enter fe stuff \e015
The following table describes all terminal capabilities
that are recognized by \fIscreen\fP and are not in the
termcap(5) manual.
+You can place these capabilities in your termcap entries (in
+`/etc/termcap') or use them with the commands `termcap', `terminfo' and
+`termcapinfo' in your screenrc files. It is often not possible to place
+these capabilities in the terminfo database.
.PP
.ta 5n
.TP 13
.BI LP " (bool)"
Terminal has VT100 style margins (`magic margins'). Note that
-this capability is obsolete because \fIscreen\fP uses 'xn'
+this capability is obsolete because \fIscreen\fP uses the standard 'xn'
instead.
.TP 13
.BI Z0 " (str)"
@@ -2895,16 +3050,6 @@ Change width to 80 columns.
Resize display. This capability has the desired width and height as
arguments. \fISunView(tm)\fP example: '\eE[8;%d;%dt'.
.TP 13
-.BI B8 " (str)"
-Tell \fIscreen\fP to look out for characters with 8th bit set. If such
-a character is found \fIscreen\fP processes the specified string
-and than outputs the character with the 8th bit stripped off.
-Note that the string can contain any esc-sequences known to
-\fIscreen\fP, too. (Example: Single Shift G2 = \eEN.)
-.TP 13
-.BI OP " (bool)"
-Don't do a full VT100 style margin emulation. Same as the -O option.
-.TP 13
.BI NF " (bool)"
Terminal doesn't need flow control. Send ^S and ^Q direct to
the application. Same as 'flow off'. The opposite of this
@@ -2915,7 +3060,7 @@ Terminal can deal with ISO 2022 font selection sequences.
.TP 13
.BI S0 " (str)"
Switch charset 'G0' to the specified charset. Default
-is '\eE(%d'.
+is '\eE(%.'.
.TP 13
.BI E0 " (str)"
Switch charset 'G0' back to standard charset. Default
@@ -2940,7 +3085,78 @@ Set the output buffer limit. See the 'obuflimit' command for more details.
.BI KJ " (str)"
Set the kanji type of the terminal. Valid strings are \*Qjis\*U,
\*Qeuc\*U and \*Qsjis\*U.
+.TP 13
+.BI AF " (str)"
+Change character forground color in an ANSI conform way. This
+capability will almost always be set to '\eE[3%dm' ('\eE[3%p1%dm'
+on terminfo machines).
+.TP 13
+.BI AB " (str)"
+Same as 'AF', but change background color.
+.TP 13
+.BI AX " (bool)"
+Does understand ANSI set default fg/bg color (\eE[39m / \eE[49m).
+.TP 13
+.BI XC " (str)"
+Describe a translation of characters to strings depending on the
+current font. More details follow in the next section.
+
+.SH CHARACTER TRANSLATION
+\fIScreen\fP has a powerful mechanism to translate characters to arbitrary
+strings depending on the current font and terminal type.
+Use this feature if you want to work with a common standard character
+set (say ISO8851-latin1) even on terminals that scatter the more
+unusual characters over several national language font pages.
+
+Syntax:
+.nf
+ \fBXC=\fP\fI<charset-mapping>\fP{\fB,,\fP\fI<charset-mapping>\fP}
+ \fI<charset-mapping>\fP := \fI<designator><template>\fP{\fB,\fP\fI<mapping>\fP}
+ \fI<mapping>\fP := \fI<char-to-be-mapped><template-arg>\fP
+.fi
+The things in braces may be repeated any number of times.
+
+A \fI<charset-mapping>\fP tells \fIscreen\fP how to map characters
+in font \fI<designator>\fP ('B': Ascii, 'A': UK, 'K': german, etc.)
+to strings. Every \fI<mapping>\fP describes to what string a single
+character will be translated. A template mechanism is used, as
+most of the time the codes have a lot in common (for example
+strings to switch to and from another charset). Each occurence
+of '%' in \fI<template>\fP gets substituted with the \fI<template-arg>\fP
+specified together with the character. If your strings are not
+similar at all, then use '%' as a template and place the full
+string in \fI<template-arg>\fP. A quoting mechanism was added to make
+it possible to use a real '%'. The '\e' character quotes the
+special characters '\e', '%', and ','.
+
+Here is an example:
+
+ termcap hp700 'XC=B\eE(K%\eE(B,\e304[,\e326\e\e\e\e,\e334]'
+
+This tells \fIscreen\fP, how to translate ISOlatin1 (charset 'B')
+upper case umlaut characters on a hp700 terminal that has a
+german charset. '\e304' gets translated to '\eE(K[\eE(B' and so on.
+Note that this line gets parsed *three* times before the internal
+lookup table is built, therefore a lot of quoting is needed to
+create a single '\e'.
+
+Another extension was added to allow more emulation: If a mapping
+translates the unquoted '%' char, it will be sent to the terminal
+whenever \fIscreen\fP switches to the corresponding \fI<designator>\fP. In this
+special case the template is assumed to be just '%' because
+the charset switch sequence and the character mappings normaly
+haven't much in common.
+
+This example shows one use of the extension:
+
+ termcap xterm 'XC=K%,%\eE(B,[\e304,\e\e\e\e\e326,]\e334'
+
+Here, a part of the german ('K') charset is emulated on an xterm.
+If \fIscreen\fP has to change to the 'K' charset, '\eE(B' will be sent
+to the terminal, i.e. the ASCII charset is used instead. The
+template is just '%', so the mapping is straightforward: '['
+to '\e304', '\e' to '\e326', and ']' to '\e334'.
.SH ENVIRONMENT
.PD 0
@@ -3040,7 +3256,8 @@ GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License
along with this program (see the file COPYING); if not, write to the
-Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+Free Software Foundation, Inc.,
+59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
.SH CONTRIBUTORS
.nf
@@ -3073,7 +3290,7 @@ Gregory Neil Shapiro (gshapiro@wpi.WPI.EDU).
.SH VERSION
-This is version 3.6.0. Its roots are a merge of a custom version
+This is version 3.7.0. Its roots are a merge of a custom version
2.3PR7 by Wayne Davison
and several enhancements to Oliver Laumann's version 2.0. Note that all versions
numbered 2.x are copyright by Oliver Laumann.
@@ -3092,9 +3309,6 @@ But this is the only area where
.I vttest
is allowed to fail.
.IP \(bu
-.I Screen
-does not support color, although this has repeatedly been asked for.
-.IP \(bu
It is not possible to change the environment variable $TERMCAP when
reattaching under a different terminal type.
.IP \(bu
diff --git a/src/doc/screen.info b/src/doc/screen.info
index f20488f..06243df 100644
--- a/src/doc/screen.info
+++ b/src/doc/screen.info
@@ -1,7 +1,7 @@
This is Info file screen.info, produced by Makeinfo-1.55 from the input
file ./screen.texinfo.
- This file documents the the `Screen' virtual terminal manager.
+ This file documents the `Screen' virtual terminal manager.
Copyright (c) 1993 Free Software Foundation, Inc.
@@ -21,144 +21,147 @@ translation approved by the Foundation.

Indirect:
-screen.info-1: 877
-screen.info-2: 50270
-screen.info-3: 99564
-screen.info-4: 146565
+screen.info-1: 873
+screen.info-2: 50135
+screen.info-3: 99940
+screen.info-4: 149859

Tag Table:
(Indirect)
-Node: Top877
-Node: Overview2760
-Node: Getting Started6133
-Node: Invoking Screen8337
-Node: Customization14009
-Node: Startup Files14496
-Node: Colon16206
-Node: Commands16828
-Node: Default Key Bindings17786
-Node: Command Summary22681
-Node: New Window32520
-Node: Chdir33225
-Node: Screen Command34196
-Node: Setenv35834
-Node: Shell36354
-Node: Term37027
-Node: Selecting37861
-Node: Next and Previous38398
-Node: Other Window38924
-Node: Select39466
-Node: Session Management40069
-Node: Detach40906
-Node: Power Detach42191
-Node: Lock42830
-Node: Multiuser Session43716
-Node: Multiuser44474
-Node: Acladd44861
-Node: Aclchg45356
-Node: Acldel46679
-Node: Wall47012
-Node: Writelock47254
-Node: Session Name48147
-Node: Suspend48694
-Node: Quit49026
-Node: Window Settings49451
-Node: Naming Windows50270
-Node: Title Command51771
-Node: Dynamic Titles52045
-Node: Title Prompts53579
-Node: Title Screenrc54660
-Node: Autonuke56298
-Node: Console56948
-Node: Kill57384
-Node: Login58207
-Node: Mode59026
-Node: Monitor59424
-Node: Obuflimit60837
-Node: Windows61659
-Node: Virtual Terminal62651
-Node: Control Sequences63644
-Node: Input Translation68906
-Node: Bell73419
-Node: Clear75267
-Node: Height75472
-Node: Info75748
-Node: Redisplay76575
-Node: Wrap77707
-Node: Reset78458
-Node: Width78770
-Node: Character Processing79192
-Node: Copy and Paste81230
-Node: Copy81835
-Node: Line Termination82680
-Node: Scrollback83089
-Node: Copy Mode Keys83578
-Node: Movement84393
-Node: Marking85547
-Node: Repeat count85922
-Node: Searching86236
-Node: Specials86498
-Node: Paste88271
-Node: Registers90832
-Node: Screen-Exchange91838
-Node: History92921
-Node: Subprocess Execution93661
-Node: Exec94025
-Node: Using Exec95599
-Node: Key Binding97254
-Node: Bind97897
-Node: Bind Examples98884
-Node: Command Character99564
-Node: Help101071
-Node: Bindkey101677
-Node: Bindkey Examples103220
-Node: Bindkey Control104173
-Node: Flow Control104770
-Node: Flow Control Summary105346
-Node: Flow108280
-Node: XON/XOFF109054
-Node: Termcap109427
-Node: Window Termcap110132
-Node: Dump Termcap115290
-Node: Termcap Syntax116005
-Node: Termcap Examples117610
-Node: Special Capabilities119651
-Node: Message Line121469
-Node: Privacy Message122380
-Node: Hardware Status Line122877
-Node: Last Message123506
-Node: Message Wait123933
-Node: Logging124359
-Node: Hardcopy124683
-Node: Log125479
-Node: Startup126214
-Node: echo126621
-Node: sleep127027
-Node: Startup Message127368
-Node: Miscellaneous127641
-Node: At128575
-Node: Break129883
-Node: Debug130286
-Node: License130670
-Node: Nethack130935
-Node: Number131611
-Node: Silence131980
-Node: Time132747
-Node: Version133121
-Node: Zombie133338
-Node: Printcmd134392
-Node: Environment135078
-Node: Files136160
-Node: Credits137286
-Node: Bugs139203
-Node: Known Bugs139673
-Node: Reporting Bugs141251
-Node: Availability142027
-Node: Installation142473
-Node: Socket Directory142863
-Node: Compiling Screen143393
-Node: Concept Index144785
-Node: Command Index146565
-Node: Keystroke Index153105
+Node: Top873
+Node: Overview2756
+Node: Getting Started6129
+Node: Invoking Screen7887
+Node: Customization13559
+Node: Startup Files14046
+Node: Colon15692
+Node: Commands16314
+Node: Default Key Bindings17272
+Node: Command Summary22227
+Node: New Window32611
+Node: Chdir33374
+Node: Screen Command34345
+Node: Setenv35983
+Node: Shell36503
+Node: Term37176
+Node: Selecting37936
+Node: Next and Previous38473
+Node: Other Window38999
+Node: Select39408
+Node: Session Management40011
+Node: Detach40848
+Node: Power Detach42133
+Node: Lock42772
+Node: Multiuser Session43658
+Node: Multiuser44416
+Node: Acladd44803
+Node: Aclchg45298
+Node: Acldel46621
+Node: Wall46954
+Node: Writelock47192
+Node: Session Name48085
+Node: Suspend48632
+Node: Quit48964
+Node: Window Settings49389
+Node: Naming Windows50135
+Node: Title Command51635
+Node: Dynamic Titles51909
+Node: Title Prompts53443
+Node: Title Screenrc54524
+Node: Console56163
+Node: Kill56605
+Node: Login57428
+Node: Mode58247
+Node: Monitor58645
+Node: Windows60056
+Node: Hardstatus61065
+Node: Virtual Terminal62236
+Node: Control Sequences63293
+Node: Input Translation69794
+Node: Digraph74310
+Node: Bell75102
+Node: Clear76940
+Node: Info77143
+Node: Redisplay77969
+Node: Wrap79101
+Node: Reset79852
+Node: Window Size80170
+Node: Character Processing80785
+Node: Copy and Paste83657
+Node: Copy84262
+Node: Line Termination85107
+Node: Scrollback85516
+Node: Copy Mode Keys86005
+Node: Movement86820
+Node: Marking87974
+Node: Repeat count88349
+Node: Searching88663
+Node: Specials88925
+Node: Paste90857
+Node: Registers93418
+Node: Screen-Exchange94424
+Node: History95507
+Node: Subprocess Execution96247
+Node: Exec96611
+Node: Using Exec98201
+Node: Key Binding99940
+Node: Bind100583
+Node: Bind Examples101570
+Node: Command Character102250
+Node: Help103758
+Node: Bindkey104271
+Node: Bindkey Examples105814
+Node: Bindkey Control106699
+Node: Flow Control107296
+Node: Flow Control Summary107872
+Node: Flow110806
+Node: XON/XOFF111580
+Node: Termcap111953
+Node: Window Termcap112810
+Node: Dump Termcap117968
+Node: Termcap Syntax118683
+Node: Termcap Examples120843
+Node: Special Capabilities122884
+Node: Autonuke125348
+Node: Obuflimit125998
+Node: Character Translation126827
+Node: Message Line129438
+Node: Privacy Message130349
+Node: Hardware Status Line130846
+Node: Last Message131475
+Node: Message Wait131902
+Node: Logging132328
+Node: Hardcopy132652
+Node: Log133448
+Node: Startup134196
+Node: echo134603
+Node: sleep135009
+Node: Startup Message135350
+Node: Miscellaneous135623
+Node: At136612
+Node: Break137920
+Node: Debug138323
+Node: License138707
+Node: Nethack138972
+Node: Number139648
+Node: Silence140017
+Node: Time140784
+Node: Version141158
+Node: Zombie141364
+Node: Printcmd142418
+Node: Sorendition143124
+Node: Environment143775
+Node: Files144857
+Node: Credits145983
+Node: Bugs147900
+Node: Known Bugs148370
+Node: Reporting Bugs149859
+Node: Availability150635
+Node: Installation151081
+Node: Socket Directory151471
+Node: Compiling Screen152001
+Node: Concept Index153393
+Node: Command Index155173
+Node: Keystroke Index162058

End Tag Table
diff --git a/src/doc/screen.info-1 b/src/doc/screen.info-1
index 995cff0..6d39c2c 100644
--- a/src/doc/screen.info-1
+++ b/src/doc/screen.info-1
@@ -1,7 +1,7 @@
This is Info file screen.info, produced by Makeinfo-1.55 from the input
file ./screen.texinfo.
- This file documents the the `Screen' virtual terminal manager.
+ This file documents the `Screen' virtual terminal manager.
Copyright (c) 1993 Free Software Foundation, Inc.
@@ -26,7 +26,7 @@ Screen
******
This file documents the `Screen' virtual terminal manager, version
-3.6.0.
+3.7.0.
* Menu:
@@ -142,26 +142,19 @@ discussed in the section on keystrokes (*note Default Key Bindings::.).
Another section (*note Customization::.) deals with the contents of your
`.screenrc'.
- If possible, choose a version of your terminal's termcap that has
+ If your terminal is a "true" auto-margin terminal (it doesn't allow
+the last position on the screen to be updated without scrolling the
+screen) consider to use a version of your terminal's termcap that has
automatic margins turned *off*. This will ensure an accurate and
-optimal update of the screen in all circumstances. The next best thing
-is an auto-margin terminal that allows the last position on the screen
-to be updated without scrolling the screen (such as a VT100). This also
-allows the entire screen to be updated. If all you've got is a "true"
-auto-margin terminal, `screen' will be content to use it, but updating
-a character put into the last position on the screen may not be
-possible until the screen scrolls or the character is moved into a safe
-position in some other way. This delay can be shortened by using a
-terminal with insert-character capability.
-
- If your terminal is of the second type (firm-margined `am'), you will
-want to let `screen' know about this, since a normal termcap doesn't
-distinguish this type of automatic margins from a "true" `am' terminal.
-You do this by specifying the `xn' capability in your termcap (*note
-`termcap' command: Termcap.), or by using the `-L' command-line option.
-`screen' needs this information to correctly update the screen. You
-don't need to worry about this if your terminal type starts with `vt',
-as `screen' assumes `xn' in that case.
+optimal update of the screen in all circumstances. Most terminals
+nowadays have "magic" margins (automatic margins plus usable last
+column). This is the VT100 style type and perfectly suited for
+`screen'. If all you've got is a "true" auto-margin terminal `screen'
+will be content to use it, but updating a character put into the last
+position on the screen may not be possible until the screen scrolls or
+the character is moved into a safe position in some other way. This
+delay can be shortened by using a terminal with insert-character
+capability.
*Note Special Capabilities::, for more information about telling
`screen' what kind of terminal you have.
@@ -331,10 +324,9 @@ the files `.screenrc' in the user's home directory and
following ways: For the global screenrc file `screen' searches for the
environment variable `$SYSSCREENRC' (this override feature may be
disabled at compile-time). The user specific screenrc file is searched
-for in `$ISCREENRC', then `$SCREENRC', then ``$HOME'/.iscreenrc' and
-finally defaults to ``$HOME'/.screenrc'. The command line option `-c'
-specifies which file to use (*note Invoking Screen::.. Commands in
-these files are used to set options, bind commands to keys, and to
+for in `$SCREENRC', then ``$HOME'/.screenrc'. The command line option
+`-c' specifies which file to use (*note Invoking Screen::.. Commands
+in these files are used to set options, bind commands to keys, and to
automatically establish one or more windows at the beginning of your
`screen' session. Commands are listed one per line, with empty lines
being ignored. A command's arguments are separated by tabs or spaces,
@@ -549,10 +541,13 @@ Thus, both `C-a c' and `C-a C-c' can be used to create a window.
Show the load average and xref. *Note Time::.
`C-a v'
-`C-a C-v'
(version)
Display the version and compilation date. *Note Version::.
+`C-a C-v'
+ (digraph)
+ Enter digraph. *Note Digraph::.
+
`C-a w'
`C-a C-w'
(windows)
@@ -560,7 +555,7 @@ Thus, both `C-a c' and `C-a C-c' can be used to create a window.
`C-a W'
(width)
- Toggle between 80 and 132 columns. *Note Width::.
+ Toggle between 80 and 132 columns. *Note Window Size::.
`C-a x'
`C-a C-x'
@@ -681,6 +676,10 @@ Command Summary
`c1 [STATE]'
Change c1 code processing. *Note Character Processing::.
+`charset SET'
+ Change character set slot designation. *Note Character
+ Processing::.
+
`chdir [DIRECTORY]'
Change the current directory for future windows. *Note Chdir::.
@@ -715,6 +714,10 @@ Command Summary
Select default c1 processing behavior. *Note Character
Processing::.
+`defcharset [SET]'
+ Change defaul character set slot designation. *Note Character
+ Processing::.
+
`defescape XY'
Set the default command and `meta' characters. *Note Command
Character::.
@@ -726,6 +729,9 @@ Command Summary
Select default GR processing behavior. *Note Character
Processing::.
+`defhstatus [STATUS]'
+ Select default window hardstatus line. *Note Hardstatus::.
+
`defkanji WTYPE'
Select default GR processing behavior. *Note Character
Processing::.
@@ -757,6 +763,9 @@ Command Summary
`detach'
Disconnect `screen' from the terminal. *Note Detach::.
+`digraph'
+ Enter digraph sequence. *Note Digraph::.
+
`dumptermcap'
Write the window's termcap entry to a file. *Note Dump Termcap::.
@@ -788,7 +797,7 @@ Command Summary
Use the hardware status line. *Note Hardware Status Line::.
`height [LINES]'
- Set display height. *Note Height::.
+ Set display height. *Note Window Size::.
`help'
Display current key bindings. *Note Help::.
@@ -820,7 +829,7 @@ Command Summary
`log [STATE]'
Log all output in the current window. *Note Log::.
-`logdir DIRECTORY'
+`logfile FILENAME'
Place where to collect logfiles. *Note Log::.
`login [STATE]'
@@ -957,6 +966,9 @@ Command Summary
`slowpaste MSEC'
Slow down pasting in windows. *Note Paste::.
+`sorendition [ATTR [COLOR]]'
+ Change text highlighting. *Note Sorendition::.
+
`startup_message STATE'
Display copyright notice on startup. *Note Startup::.
@@ -976,6 +988,9 @@ Command Summary
`terminfo TERM TERMINAL-TWEAKS [WINDOW-TWEAKS]'
Ditto, for terminfo systems. *Note Termcap Syntax::.
+`termcapinfo TERM TERMINAL-TWEAKS [WINDOW-TWEAKS]'
+ Ditto, for both systems. *Note Termcap Syntax::.
+
`time'
Display time and load average. *Note Time::.
@@ -997,11 +1012,11 @@ Command Summary
`version'
Display `screen' version. *Note Version::.
-`wall MESSAGE ...'
+`wall MESSAGE'
Write a message to all displays. *Note Multiuser Session::.
`width [NUM]'
- Set the width of the window. *Note Width::.
+ Set the width of the window. *Note Window Size::.
`windows'
List active windows. *Note Windows::.
@@ -1034,7 +1049,8 @@ New Window
This section describes the commands for creating a new window for
running programs. When a new window is created, the first available
number from the range 0...9 is assigned to it. There can be no more
-than 10 windows active at any one time.
+than 10 windows active at any one time unless `screen' was compiled
+with a higher MAXWIN setting.
* Menu:
@@ -1157,8 +1173,7 @@ Term
That is, one may want to specify special `$TERM' settings (e.g.
vt100) for the next `screen rlogin othermachine' command. Use the
command `screen -T vt100 rlogin othermachine' rather than setting
- (`term vt100') and resetting (`term screen') the default before
- and after the `screen' command.
+ and resetting the default.

File: screen.info, Node: Selecting, Next: Session Management, Prev: New Window, Up: Top
@@ -1202,11 +1217,9 @@ Other Window
- Command: other
(`C-a C-a')
Switch to the last window displayed. Note that this command
- defaults to the command character typed twice, unless overridden;
- for instance, if you use the option `-e]x', this command becomes
- `]]', not `]C-a' (*note Command Character::.). On the other hand,
- if you use the option `-e``', this command remains `` C-a', since
- ```' is bound to `meta'.
+ defaults to the command character typed twice, unless overridden.
+ For instance, if you use the option `-e]x', this command becomes
+ `]]' (*note Command Character::.).

File: screen.info, Node: Select, Prev: Other Window, Up: Selecting
@@ -1409,7 +1422,7 @@ File: screen.info, Node: Wall, Next: Writelock, Prev: Acldel, Up: Multiuser
Wall
----
- - Command: wall MESSAGE ...
+ - Command: wall MESSAGE
(none)
Write a message to all displays. The message will appear in the
terminal's status line.
@@ -1490,13 +1503,12 @@ terminal emulation itself.
* Menu:
-* Naming Windows:: Control the name of the window
-* Autonuke:: Flush unseen output
+* Naming Windows:: Control the name of the window
* Console:: See the host's console messages
* Kill:: Destroy an unwanted window
* Login:: Control `/etc/utmp' logging
* Mode:: Control the file mode of the pty
* Monitor:: Watch for activity in a window
-* Obuflimit:: Allow pending output when reading more
-* Windows:: List the active windows
+* Windows:: List the active windows
+* Hardstatus:: Set a window's hardstatus line
diff --git a/src/doc/screen.info-2 b/src/doc/screen.info-2
index 5f24596..dfeec60 100644
--- a/src/doc/screen.info-2
+++ b/src/doc/screen.info-2
@@ -1,7 +1,7 @@
This is Info file screen.info, produced by Makeinfo-1.55 from the input
file ./screen.texinfo.
- This file documents the the `Screen' virtual terminal manager.
+ This file documents the `Screen' virtual terminal manager.
Copyright (c) 1993 Free Software Foundation, Inc.
@@ -20,7 +20,7 @@ versions, except that this permission notice may be stated in a
translation approved by the Foundation.

-File: screen.info, Node: Naming Windows, Next: Autonuke, Up: Window Settings
+File: screen.info, Node: Naming Windows, Next: Console, Up: Window Settings
Naming Windows (Titles)
=======================
@@ -124,7 +124,7 @@ PROMPT_COMMAND:

File: screen.info, Node: Title Screenrc, Prev: Title Prompts, Up: Naming Windows
-Setting up shell Titles in your `.screenrc'
+Setting up shell titles in your `.screenrc'
-------------------------------------------
Here are some .screenrc examples:
@@ -132,7 +132,7 @@ Setting up shell Titles in your `.screenrc'
screen -t top 2 nice top
Adding this line to your .screenrc would start a niced version of the
-`top' command in window 2 name `top' rather than `nice'.
+`top' command in window 2 named `top' rather than `nice'.
shelltitle '> |csh'
screen 1
@@ -171,26 +171,7 @@ auto-titles current setting (C-a E). The third binding would set the
current window's title to `(unknown)' (C-a u).

-File: screen.info, Node: Autonuke, Next: Console, Prev: Naming Windows, Up: Window Settings
-
-Autonuke
-========
-
- - Command: autonuke STATE
- (none)
- Sets whether a clear screen sequence should nuke all the output
- that has not been written to the terminal. *Note Obuflimit::.
- This property is set per display, not per window.
-
- - Command: defautonuke STATE
- (none)
- Same as the `autonuke' command except that the default setting for
- new displays is also changed. Initial setting is `off'. Note that
- you can use the special `AN' terminal capability if you want to
- have a terminal type dependent setting.
-
-
-File: screen.info, Node: Console, Next: Kill, Prev: Autonuke, Up: Window Settings
+File: screen.info, Node: Console, Next: Kill, Prev: Naming Windows, Up: Window Settings
Console
=======
@@ -259,7 +240,7 @@ Mode
specified for creation. *Note Screen Command::).

-File: screen.info, Node: Monitor, Next: Obuflimit, Prev: Mode, Up: Window Settings
+File: screen.info, Node: Monitor, Next: Windows, Prev: Mode, Up: Window Settings
Monitoring
==========
@@ -294,29 +275,7 @@ Monitoring
Windows::.). Monitoring defaults to `off' for all windows.

-File: screen.info, Node: Obuflimit, Next: Windows, Prev: Monitor, Up: Window Settings
-
-Obuflimit
-=========
-
- - Command: obuflimit [LIMIT]
- (none)
- If the output buffer contains more bytes than the specified limit,
- no more data will be read from the windows. The default value is
- 256. If you have a fast display (like `xterm'), you can set it to
- some higher value. If no argument is specified, the current
- setting is displayed. This property is set per display, not per
- window.
-
- - Command: defobuflimit LIMIT
- (none)
- Same as the `obuflimit' command except that the default setting
- for new displays is also changed. Initial setting is 256 bytes.
- Note that you can use the special `OL' terminal capability if you
- want to have a terminal type dependent limit.
-
-
-File: screen.info, Node: Windows, Prev: Obuflimit, Up: Window Settings
+File: screen.info, Node: Windows, Next: Hardstatus, Prev: Monitor, Up: Window Settings
Windows
=======
@@ -338,27 +297,54 @@ Windows
displayed.

+File: screen.info, Node: Hardstatus, Prev: Windows, Up: Window Settings
+
+Hardstatus
+==========
+
+ `Screen' maintains a hardstatus line for every window. If a window
+gets selected, the display's hardstatus will be updated to match the
+window's hardstatus line. If the display has no hardstatus the line
+will be displayed as a standard screen message. The hardstatus line
+can be changed with the ANSI Application Program Command (APC):
+`ESC_<string>ESC\'. As a convenience for xterm users the sequence
+`ESC]0..2;<string>^G' is also accepted.
+
+ - Command: defhstatus
+ (none)
+ The hardstatus line that all new windows will get is set to STATUS.
+ This command is useful to make the hardstatus of every window
+ display the window number or title or the like. STATUS may
+ contain the same directives as in the window messages, but the
+ directive escape character is `^E' (octal 005) instead of `%'.
+ This was done to make a misinterpretion of program generated
+ hardstatus lines impossible. If the parameter STATUS is omitted,
+ the current default string is displayed. Per default the
+ hardstatus line of new windows is empty.
+
+
File: screen.info, Node: Virtual Terminal, Next: Copy and Paste, Prev: Window Settings, Up: Top
Virtual Terminal
****************
Each window in a `screen' session emulates a VT100 terminal, with
-some extra functions added. The commands described here modify the
+some extra functions added. The VT100 emulator is hardcoded, no other
+terminal types can be emulated. The commands described here modify the
terminal emulation.
* Menu:
* Control Sequences:: Details of the internal VT100 emulation.
* Input Translation:: How keystrokes are remapped.
+* Digraph:: Entering digraph sequences.
* Bell:: Getting your attention.
* Clear:: Clear the window display.
-* Height:: Changing the height of your terminal.
* Info:: Terminal emulation statistics.
* Redisplay:: When the display gets confusing.
* Wrap:: Automatic margins.
* Reset:: Recovering from ill-behaved applications.
-* Width:: Changing the width of your terminal.
+* Window Size:: Changing the size of your terminal.
* Character Processing:: Change the effect of special characters.

@@ -381,6 +367,10 @@ functions, respectively.
ESC [s (A) Save Cursor and Attributes
ESC [u (A) Restore Cursor and Attributes
ESC c Reset to Initial State
+ ESC g Visual Bell
+ ESC Pn p Cursor Visibility (97801)
+ Pn = 6 Invisible
+ 7 Visible
ESC = (V) Application Keypad Mode
ESC > (V) Numeric Keypad Mode
ESC # 8 (V) Fill Screen with E's
@@ -391,8 +381,9 @@ functions, respectively.
ESC P (A) Device Control String
Outputs a string directly to the host
terminal without interpretation.
- ESC _ (A) Application Program Command (not used)
- ESC ] (A) Operating System Command (not used)
+ ESC _ (A) Application Program Command (Hardstatus)
+ ESC ] (A) Operating System Command (Hardstatus, xterm
+ title hack)
Control-N (A) Lock Shift G1 (SO)
Control-O (A) Lock Shift G0 (SI)
ESC n (A) Lock Shift G2
@@ -430,6 +421,18 @@ functions, respectively.
24 (A) Not Underlined
25 (A) Not Blinking
27 (A) Positive Image
+ 30 (A) Foreground Black
+ 31 (A) Foreground Red
+ 32 (A) Foreground Green
+ 33 (A) Foreground Yellow
+ 34 (A) Foreground Blue
+ 35 (A) Foreground Magenta
+ 36 (A) Foreground Cyan
+ 37 (A) Foreground White
+ 39 (A) Foreground Default
+ 40 (A) Background Black
+ ... ...
+ 49 (A) Background Default
ESC [ Pn g Tab Clear
Pn = None or 0 Clear Tab at Current Position
3 Clear All Tabs
@@ -440,24 +443,30 @@ functions, respectively.
ESC [ Pn M (A) Delete Line
ESC [ Pn @ (A) Insert Character
ESC [ Pn P (A) Delete Character
+ ESC [ Pn S Scroll Scrolling Region Up
+ ESC [ Pn T Scroll Scrolling Region Down
ESC [ Ps ;...; Ps h Set Mode
ESC [ Ps ;...; Ps l Reset Mode
Ps = 4 (A) Insert Mode
+ 20 (A) `Automatic Linefeed' Mode.
+ 34 Normal Cursor Visibility
?1 (V) Application Cursor Keys
?3 (V) Change Terminal Width to 132 columns
- ?5 (V) Visible Bell (`On' followed by `Off')
+ ?5 (V) Reverse Video
?6 (V) `Origin' Mode
?7 (V) `Wrap' Mode
+ ?25 (V) Visible Cursor
ESC [ 5 i (A) Start relay to printer (ANSI Media Copy)
ESC [ 4 i (A) Stop relay to printer (ANSI Media Copy)
ESC [ 8 ; Ph ; Pw t Resize the window to `Ph' lines and
`Pw' columns (SunView special)
ESC [ c Send VT100 Identification String
+ ESC [ x (V) Send Terminal Parameter Report
ESC [ > c Send Secondary Device Attributes String
ESC [ 6 n Send Cursor Position Report

-File: screen.info, Node: Input Translation, Next: Bell, Prev: Control Sequences, Up: Virtual Terminal
+File: screen.info, Node: Input Translation, Next: Digraph, Prev: Control Sequences, Up: Virtual Terminal
Input Translation
=================
@@ -546,7 +555,26 @@ command is executed if the keyboard is switched into application mode.
stuff \033OM (A)

-File: screen.info, Node: Bell, Next: Clear, Prev: Input Translation, Up: Virtual Terminal
+File: screen.info, Node: Digraph, Next: Bell, Prev: Input Translation, Up: Virtual Terminal
+
+Digraph
+=======
+
+ - Command: digraph [PRESET]
+ (none)
+ This command prompts the user for a digraph sequence. The next two
+ characters typed are looked up in a builtin table and the
+ resulting character is inserted in the input stream. For example,
+ if the user enters `a"', an a-umlaut will be inserted. If the
+ first character entered is a 0 (zero), `screen' will treat the
+ following charcters (up to three) as an octal number instead. The
+ optional argument PRESET is treated as user input, thus one can
+ create an "umlaut" key. For example the command `bindkey ^K
+ digraph '"'' enables the user to generate an a-umlaut by typing
+ `CTRL-K a'.
+
+
+File: screen.info, Node: Bell, Next: Clear, Prev: Digraph, Up: Virtual Terminal
Bell
====
@@ -592,7 +620,7 @@ Bell
bell message. The default is 1 second.

-File: screen.info, Node: Clear, Next: Height, Prev: Bell, Up: Virtual Terminal
+File: screen.info, Node: Clear, Next: Info, Prev: Bell, Up: Virtual Terminal
Clear
=====
@@ -602,18 +630,7 @@ Clear
Clears the screen and saves its contents to the scrollback buffer.

-File: screen.info, Node: Height, Next: Info, Prev: Clear, Up: Virtual Terminal
-
-Height
-======
-
- - Command: height [LINES]
- (none)
- Set the display height to a specified number of lines. When no
- argument is given it toggles between 24 and 42 lines display.
-
-
-File: screen.info, Node: Info, Next: Redisplay, Prev: Height, Up: Virtual Terminal
+File: screen.info, Node: Info, Next: Redisplay, Prev: Clear, Up: Virtual Terminal
Info
====
@@ -683,7 +700,7 @@ Wrap
on|off".

-File: screen.info, Node: Reset, Next: Width, Prev: Wrap, Up: Virtual Terminal
+File: screen.info, Node: Reset, Next: Window Size, Prev: Wrap, Up: Virtual Terminal
Reset
=====
@@ -695,10 +712,10 @@ Reset
are left over from an application.

-File: screen.info, Node: Width, Next: Character Processing, Prev: Reset, Up: Virtual Terminal
+File: screen.info, Node: Window Size, Next: Character Processing, Prev: Reset, Up: Virtual Terminal
-Width
-=====
+Window Size
+===========
- Command: width [NUM]
(`C-a W')
@@ -707,8 +724,13 @@ Width
terminal and the termcap entries `Z0' and `Z1'. See the `termcap'
command (*note Termcap::.), for more information.
+ - Command: height [LINES]
+ (none)
+ Set the display height to a specified number of lines. When no
+ argument is given it toggles between 24 and 42 lines display.
+

-File: screen.info, Node: Character Processing, Prev: Width, Up: Virtual Terminal
+File: screen.info, Node: Character Processing, Prev: Window Size, Up: Virtual Terminal
Character Processing
====================
@@ -743,6 +765,19 @@ Character Processing
termcap entry. *Note Special Capabilities::. See also `defkanji',
which changes the default setting of a new window.
+ - Command: charset SET
+ (none)
+ Change the current character set slot designation and charset
+ mapping. The first four character of SET are treated as charset
+ designators while the fifth and sixth character must be in range
+ `0' to `3' and set the GL/GR charset mapping. On every position a
+ `.' may be used to indicate that the corresponding charset/mapping
+ should not be changed (SET is padded to six characters internally
+ by appending `.' chars). New windows have `BBBB02' as default
+ charset, unless a `kanji' command is active.
+
+ The current setting can be viewed with the *Note Info:: command.
+
- Command: defc1 STATE
(none)
Same as the `c1' command except that the default setting for new
@@ -758,6 +793,11 @@ Character Processing
Same as the `kanji' command except that the default setting for
new windows is changed. Initial setting is `off', i.e. `jis'.
+ - Command: defcharset [SET]
+ Like the `charset' command except that the default setting for new
+ windows is changed. Shows current default if called without
+ argument.
+

File: screen.info, Node: Copy and Paste, Next: Subprocess Execution, Prev: Virtual Terminal, Up: Top
@@ -970,8 +1010,13 @@ that file:
`C-g' gives information about the current line and column.
+`x' exchanges the first mark and the current cursor position. You can
+use this to adjust an already placed mark.
+
`@' does nothing. Absolutely nothing. Does not even exit copy mode.
+All keys not described here exit copy mode.
+

File: screen.info, Node: Paste, Next: Registers, Prev: Copy, Up: Copy and Paste
@@ -1150,12 +1195,12 @@ Exec
currently running subprocess in this window.
When a subprocess is running the `kill' command will affect it
instead of the window's process.
- Refer to the postscript file `doc/fdpat.ps' for illustration of
- all 21 possible combinations. Each drawing shows the numbers 210
- representing the three file descriptors of newcommand. The box
- marked `W' is usual pty that has the old process (shell) on its
- slave side. The box marked `P' is the secondary pty that now has
- screen at its master side.
+ Refer to the postscript file `doc/fdpat.ps' for a confusing
+ illustration of all 21 possible combinations. Each drawing shows
+ the digits 2, 1, 0 representing the three file descriptors of
+ newcommand. The box marked `W' is usual pty that has the
+ application-process on its slave side. The box marked `P' is the
+ secondary pty that now has screen at its master side.

File: screen.info, Node: Using Exec, Prev: Exec, Up: Subprocess Execution
@@ -1199,7 +1244,8 @@ Examples:
is needed to give the user control over the pager although it gets
its input from the window's process. This works, because `less'
listens on stderr (a behavior that `screen' would not expect
- without the `|') when its stdin is not a tty.
+ without the `|') when its stdin is not a tty. `Less' versions
+ newer than 177 fail miserably here; good old `pg' still works.
`!:sed -n s/.*Error.*/\007/p'
Sends window output to both, the user and the sed command. The sed
@@ -1207,64 +1253,3 @@ Examples:
output seen by screen. This will cause 'Bell in window x'
messages, whenever the string `Error' appears in the window.
-
-File: screen.info, Node: Key Binding, Next: Flow Control, Prev: Subprocess Execution, Up: Top
-
-Key Binding
-***********
-
- You may disagree with some of the default bindings (I know I do).
-The `bind' command allows you to redefine them to suit your preferences.
-
-* Menu:
-
-* Bind:: `bind' syntax.
-* Bind Examples:: Using `bind'.
-* Command Character:: The character used to start keyboard commands.
-* Help:: Show current key bindings.
-* Bindkey:: `bindkey' syntax.
-* Bindkey Examples:: Some easy examples.
-* Bindkey Control:: How to control the bindkey mechanism.
-
-
-File: screen.info, Node: Bind, Next: Bind Examples, Up: Key Binding
-
-The `bind' command
-==================
-
- - Command: bind KEY [COMMAND [ARGS]]
- (none)
- Bind a command to a key. The KEY argument is either a single
- character, a two-character sequence of the form `^x' (meaning
- `C-x'), a backslash followed by an octal number (specifying the
- ASCII code of the character), or a backslash followed by a second
- character, such as `\^' or `\\'. The argument can also be quoted,
- if you like. If no further argument is given, any previously
- established binding for this key is removed. The COMMAND argument
- can be any command (*note Command Index::.).
-
- By default, most suitable commands are bound to one or more keys
- (*note Default Key Bindings::.; for instance, the command to
- create a new window is bound to `C-c' and `c'. The `bind' command
- can be used to redefine the key bindings and to define new
- bindings.
-
-
-File: screen.info, Node: Bind Examples, Next: Command Character, Prev: Bind, Up: Key Binding
-
-Examples of the `bind' command
-==============================
-
-Some examples:
-
- bind ' ' windows
- bind ^f screen telnet foobar
- bind \033 screen -ln -t root -h 1000 9 su
-
-would bind the space key to the command that displays a list of windows
-(so that the command usually invoked by `C-a C-w' would also be
-available as `C-a space'), bind `C-f' to the command "create a window
-with a TELNET connection to foobar", and bind ESC to the command that
-creates an non-login window with title `root' in slot #9, with a
-super-user shell and a scrollbackbuffer of 1000 lines.
-
diff --git a/src/doc/screen.info-3 b/src/doc/screen.info-3
index 02a331b..66f750a 100644
--- a/src/doc/screen.info-3
+++ b/src/doc/screen.info-3
@@ -1,7 +1,7 @@
This is Info file screen.info, produced by Makeinfo-1.55 from the input
file ./screen.texinfo.
- This file documents the the `Screen' virtual terminal manager.
+ This file documents the `Screen' virtual terminal manager.
Copyright (c) 1993 Free Software Foundation, Inc.
@@ -20,6 +20,67 @@ versions, except that this permission notice may be stated in a
translation approved by the Foundation.

+File: screen.info, Node: Key Binding, Next: Flow Control, Prev: Subprocess Execution, Up: Top
+
+Key Binding
+***********
+
+ You may disagree with some of the default bindings (I know I do).
+The `bind' command allows you to redefine them to suit your preferences.
+
+* Menu:
+
+* Bind:: `bind' syntax.
+* Bind Examples:: Using `bind'.
+* Command Character:: The character used to start keyboard commands.
+* Help:: Show current key bindings.
+* Bindkey:: `bindkey' syntax.
+* Bindkey Examples:: Some easy examples.
+* Bindkey Control:: How to control the bindkey mechanism.
+
+
+File: screen.info, Node: Bind, Next: Bind Examples, Up: Key Binding
+
+The `bind' command
+==================
+
+ - Command: bind KEY [COMMAND [ARGS]]
+ (none)
+ Bind a command to a key. The KEY argument is either a single
+ character, a two-character sequence of the form `^x' (meaning
+ `C-x'), a backslash followed by an octal number (specifying the
+ ASCII code of the character), or a backslash followed by a second
+ character, such as `\^' or `\\'. The argument can also be quoted,
+ if you like. If no further argument is given, any previously
+ established binding for this key is removed. The COMMAND argument
+ can be any command (*note Command Index::.).
+
+ By default, most suitable commands are bound to one or more keys
+ (*note Default Key Bindings::.; for instance, the command to
+ create a new window is bound to `C-c' and `c'. The `bind' command
+ can be used to redefine the key bindings and to define new
+ bindings.
+
+
+File: screen.info, Node: Bind Examples, Next: Command Character, Prev: Bind, Up: Key Binding
+
+Examples of the `bind' command
+==============================
+
+Some examples:
+
+ bind ' ' windows
+ bind ^f screen telnet foobar
+ bind \033 screen -ln -t root -h 1000 9 su
+
+would bind the space key to the command that displays a list of windows
+(so that the command usually invoked by `C-a C-w' would also be
+available as `C-a space'), bind `C-f' to the command "create a window
+with a TELNET connection to foobar", and bind ESC to the command that
+creates an non-login window with title `root' in slot #9, with a
+super-user shell and a scrollbackbuffer of 1000 lines.
+
+
File: screen.info, Node: Command Character, Next: Help, Prev: Bind Examples, Up: Key Binding
Command Character
@@ -55,7 +116,7 @@ Command Character
(none)
This command has the same effect as typing the screen escape
character (`C-a'). It is probably only useful for key bindings.
- *Note Bindkey::
+ *Note Bindkey::.

File: screen.info, Node: Help, Next: Bindkey, Prev: Command Character, Up: Key Binding
@@ -69,9 +130,8 @@ Help
pages list all the internal commands followed by their bindings.
Subsequent pages will display the custom commands, one command per
key. Press space when you're done reading each page, or return to
- exit early. All other characters are ignored, except for the
- command character, which will exit the help display and begin a
- command. *Note Default Key Bindings::.
+ exit early. All other characters are ignored. *Note Default Key
+ Bindings::.

File: screen.info, Node: Bindkey, Next: Bindkey Examples, Prev: Help, Up: Key Binding
@@ -139,9 +199,7 @@ key twice (i.e. escape the escape binding).
bindkey -k F1 command
-Make the F11 (not F1!) key an alternative screen escape (besides
-`C-a'). Note that `F11 F11' does not work in the current release of
-screen.
+Make the F11 (not F1!) key an alternative screen escape (besides `C-a').

File: screen.info, Node: Bindkey Control, Prev: Bindkey Examples, Up: Key Binding
@@ -286,6 +344,9 @@ and the one simulated by `screen'.
* Termcap Syntax:: The `termcap' and `terminfo' commands.
* Termcap Examples:: Uses for `termcap'.
* Special Capabilities:: Non-standard capabilities used by `screen'.
+* Autonuke:: Flush unseen output
+* Obuflimit:: Allow pending output when reading more
+* Character Translation:: Emulating fonts and charsets.

File: screen.info, Node: Window Termcap, Next: Dump Termcap, Up: Termcap
@@ -406,16 +467,27 @@ The `termcap' command
- Command: termcap TERM TERMINAL-TWEAKS [WINDOW-TWEAKS]
- Command: terminfo TERM TERMINAL-TWEAKS [WINDOW-TWEAKS]
+ - Command: termcapinfo TERM TERMINAL-TWEAKS [WINDOW-TWEAKS]
(none)
Use this command to modify your terminal's termcap entry without
going through all the hassles involved in creating a custom
termcap entry. Plus, you can optionally customize the termcap
- generated for the windows. If your system uses the terminfo
- database rather than termcap, `screen' will understand the
- `terminfo' command which has the same effects as the `termcap'
- command. Thus users can write one .screenrc file that handles both
- cases, although terminfo syntax is slightly different from termcap
- syntax.
+ generated for the windows. You have to place these commands in
+ one of the screenrc starup files, as they are meaningless once the
+ terminal emulator is booted.
+
+ If your system uses the terminfo database rather than termcap,
+ `screen' will understand the `terminfo' command which has the same
+ effects as the `termcap' command. Two separate commands are
+ provided, as there are subtle syntactic differences, e.g. when
+ parameter interpolation (using `%') is required. Note that the
+ termcap names of the capabilities have to be used with the
+ `terminfo' command.
+
+ In many cases, where the arguments are valid in both terminfo and
+ termcap syntax, you can use the command `termcapinfo', which is
+ just a shorthand for a pair of `termcap' and `terminfo' commands
+ with identical arguments.
The first argument specifies which terminal(s) should be affected by
this definition. You can specify multiple terminal names by separating
@@ -481,19 +553,22 @@ emulation. *Note Termcap: (termcap)Top, for more information on
termcap definitions.

-File: screen.info, Node: Special Capabilities, Prev: Termcap Examples, Up: Termcap
+File: screen.info, Node: Special Capabilities, Next: Autonuke, Prev: Termcap Examples, Up: Termcap
Special Terminal Capabilities
=============================
The following table describes all terminal capabilities that are
recognized by `screen' and are not in the termcap manual (*note
-Termcap: (termcap)Top.).
-
+Termcap: (termcap)Top.). You can place these capabilities in your
+termcap entries (in `/etc/termcap') or use them with the commands
+`termcap', `terminfo' and `termcapinfo' in your `screenrc' files. It is
+often not possible to place these capabilities in the terminfo database.
`LP'
(bool)
Terminal has VT100 style margins (`magic margins'). Note that this
- capability is obsolete -- `screen' now uses `xn' instead.
+ capability is obsolete -- `screen' now uses the standard `xn'
+ instead.
`Z0'
(str)
@@ -508,14 +583,6 @@ Termcap: (termcap)Top.).
Resize display. This capability has the desired width and height as
arguments. SunView(tm) example: `\E[8;%d;%dt'.
-`B8'
- (str)
- Tell `screen' to look out for characters with 8th bit set. If such
- a character is found `screen' processes the specified string and
- than outputs the character with the 8th bit stripped off. Note
- that the string can contain any esc-sequences known to `screen',
- too. (Example: Single Shift G2 = \EN.)
-
`NF'
(bool)
Terminal doesn't need flow control. Send ^S and ^Q direct to the
@@ -528,7 +595,7 @@ Termcap: (termcap)Top.).
`S0'
(str)
- Switch charset `G0' to the specified charset. Default is `\E(%d'.
+ Switch charset `G0' to the specified charset. Default is `\E(%.'.
`E0'
(str)
@@ -547,11 +614,139 @@ Termcap: (termcap)Top.).
(str)
Switch cursor keys to cursor mode.
+`AN'
+ (bool)
+ Enable autonuke for displays of this terminal type. (*note
+ Autonuke::.).
+
+`OL'
+ (num)
+ Set the output buffer limit. See the `obuflimit' command (*note
+ Obuflimit::.) for more details.
+
`KJ'
(str)
Set the kanji type of the terminal. Valid strings are `jis', `euc'
and `sjis'.
+`AF'
+ (str)
+ Change character forground color in an ANSI conform way. This
+ capability will almost always be set to `\E[3%dm' (`\E[3%p1%dm' on
+ terminfo machines).
+
+`AB'
+ (str)
+ Same as `AF', but change background color.
+
+`AX'
+ (bool)
+ Does understand ANSI set default fg/bg color (`\E[39m / \E[49m').
+
+`XC'
+ (str)
+ Describe a translation of characters to strings depending on the
+ current font. (*note Character Translation::.).
+
+
+File: screen.info, Node: Autonuke, Next: Obuflimit, Prev: Special Capabilities, Up: Termcap
+
+Autonuke
+========
+
+ - Command: autonuke STATE
+ (none)
+ Sets whether a clear screen sequence should nuke all the output
+ that has not been written to the terminal. *Note Obuflimit::.
+ This property is set per display, not per window.
+
+ - Command: defautonuke STATE
+ (none)
+ Same as the `autonuke' command except that the default setting for
+ new displays is also changed. Initial setting is `off'. Note that
+ you can use the special `AN' terminal capability if you want to
+ have a terminal type dependent setting.
+
+
+File: screen.info, Node: Obuflimit, Next: Character Translation, Prev: Autonuke, Up: Termcap
+
+Obuflimit
+=========
+
+ - Command: obuflimit [LIMIT]
+ (none)
+ If the output buffer contains more bytes than the specified limit,
+ no more data will be read from the windows. The default value is
+ 256. If you have a fast display (like `xterm'), you can set it to
+ some higher value. If no argument is specified, the current
+ setting is displayed. This property is set per display, not per
+ window.
+
+ - Command: defobuflimit LIMIT
+ (none)
+ Same as the `obuflimit' command except that the default setting
+ for new displays is also changed. Initial setting is 256 bytes.
+ Note that you can use the special `OL' terminal capability if you
+ want to have a terminal type dependent limit.
+
+
+File: screen.info, Node: Character Translation, Prev: Obuflimit, Up: Termcap
+
+Character Translation
+=====================
+
+ `Screen' has a powerful mechanism to translate characters to
+arbitrary strings depending on the current font and terminal type. Use
+this feature if you want to work with a common standard character set
+(say ISO8851-latin1) even on terminals that scatter the more unusual
+characters over several national language font pages.
+
+ Syntax:
+
+ XC=<CHARSET-MAPPING>{,,<CHARSET-MAPPING>}
+ <CHARSET-MAPPING> := <DESIGNATOR><TEMPLATE>{,<MAPPING>}
+ <MAPPING> := <CHAR-TO-BE-MAPPED><TEMPLATE-ARG>
+
+ The things in braces may be repeated any number of times.
+
+ A <CHARSET-MAPPING> tells screen how to map characters in font
+<DESIGNATOR> (`B': Ascii, `A': UK, `K': german, etc.) to strings. Every
+<MAPPING> describes to what string a single character will be
+translated. A template mechanism is used, as most of the time the codes
+have a lot in common (for example strings to switch to and from another
+charset). Each occurence of `%' in <TEMPLATE> gets substituted with the
+TEMPLATE-ARG specified together with the character. If your strings are
+not similar at all, then use `%' as a template and place the full
+string in <TEMPLATE-ARG>. A quoting mechanism was added to make it
+possible to use a real `%'. The `\' character quotes the special
+characters `\', `%', and `,'.
+
+ Here is an example:
+
+ termcap hp700 'XC=B\E(K%\E(B,\304[,\326\\\\,\334]'
+
+ This tells `screen', how to translate ISOlatin1 (charset `B') upper
+case umlaut characters on a `hp700' terminal that has a german charset.
+`\304' gets translated to `\E(K[\E(B' and so on. Note that this line
+gets parsed *three* times before the internal lookup table is built,
+therefore a lot of quoting is needed to create a single `\'.
+
+ Another extension was added to allow more emulation: If a mapping
+translates the unquoted `%' char, it will be sent to the terminal
+whenever screen switches to the corresponding <DESIGNATOR>. In this
+special case the template is assumed to be just `%' because the charset
+switch sequence and the character mappings normaly haven't much in
+common.
+
+ This example shows one use of the extension:
+ termcap xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334'
+
+ Here, a part of the german (`K') charset is emulated on an xterm.
+If screen has to change to the `K' charset, `\E(B' will be sent to the
+terminal, i.e. the ASCII charset is used instead. The template is just
+`%', so the mapping is straightforward: `[' to `\304', `\' to `\326',
+and `]' to `\334'.
+

File: screen.info, Node: Message Line, Next: Logging, Prev: Termcap, Up: Top
@@ -680,16 +875,17 @@ log
(`C-a H')
Begins/ends logging of the current window to the file
`screenlog.N' in the window's default directory, where N is the
- number of the current window. If no parameter is given, the
- logging state is toggled. The session log is appended to the
- previous contents of the file if it already exists. The current
- contents and the contents of the scrollback history are not
- included in the session log. Default is `off'.
-
- - Command: logdir DIRECTORY
+ number of the current window. This filename can be changed with
+ the `logfile' command. If no parameter is given, the logging
+ state is toggled. The session log is appended to the previous
+ contents of the file if it already exists. The current contents
+ and the contents of the scrollback history are not included in the
+ session log. Default is `off'.
+
+ - Command: logfile FILENAME
(none)
- Defines a directory where logfiles will be placed. If unset
- logfiles are written in `screen's current working directory.
+ Defines the name the logfiles will get. The default is
+ `screenlog.%n'.

File: screen.info, Node: Startup, Next: Miscellaneous, Prev: Logging, Up: Top
@@ -765,6 +961,7 @@ categories.
* Version:: Display the version of `screen'.
* Zombie:: Keep dead windows.
* Printcmd:: Set command for VT100 printer port emulation.
+* Sorendition:: Change the text highlighting method.

File: screen.info, Node: At, Next: Break, Up: Miscellaneous
@@ -905,7 +1102,7 @@ Version
=======
- Command: version
- (`C-a v', `C-a C-v')
+ (`C-a v')
Display the version and modification date in the message line.

@@ -934,7 +1131,7 @@ Zombie
synonymous.

-File: screen.info, Node: Printcmd, Prev: Zombie, Up: Miscellaneous
+File: screen.info, Node: Printcmd, Next: Sorendition, Prev: Zombie, Up: Miscellaneous
Printcmd
========
@@ -953,6 +1150,23 @@ Printcmd
commands.

+File: screen.info, Node: Sorendition, Prev: Printcmd, Up: Miscellaneous
+
+Sorendition
+===========
+
+ - Command: sorendition [ATTR [COLOR]]
+ (none)
+ Change the way screen does highlighting for text marking and
+ printing messages. ATTR is a hexadecimal number and describes the
+ attributes (inverse, underline, ...) the text will get. COLOR is
+ a 2 digit number and changes the forground/background of the
+ highlighted text. Some knowledge of screen's internal character
+ representation is needed to make the characters appear in the
+ desired way. The default is currently `10 99' (standout, default
+ colors).
+
+
File: screen.info, Node: Environment, Next: Files, Prev: Miscellaneous, Up: Top
Environment Variables
@@ -1102,7 +1316,7 @@ Contributors
Version
=======
- This manual describes version 3.6.0 of the `screen' program. Its
+ This manual describes version 3.7.0 of the `screen' program. Its
roots are a merge of a custom version 2.3PR7 by Wayne Davison and
several enhancements to Oliver Laumann's version 2.0. Note that all
versions numbered 2.x are copyright by Oliver Laumann.
@@ -1137,9 +1351,6 @@ Known Bugs
* `screen' has no clue about double-high or double-wide characters.
But this is the only area where `vttest' is allowed to fail.
- * `screen' does not support color, although this has repeatedly been
- asked for.
-
* It is not possible to change the environment variable `$TERMCAP'
when reattaching under a different terminal type.
@@ -1168,135 +1379,3 @@ Known Bugs
* A weird imagination is most useful to gain full advantage of all
the features.
-
-File: screen.info, Node: Reporting Bugs, Next: Availability, Prev: Known Bugs, Up: Bugs
-
-Reporting Bugs
-==============
-
- If you find a bug in `Screen', please send electronic mail to
-`screen@uni-erlangen.de', and also to `bug-gnu-utils@prep.ai.mit.edu'.
-Include the version number of `Screen' which you are using. Also
-include in your message the hardware and operating system, the compiler
-used to compile, a description of the bug behavior, and the conditions
-that triggered the bug. Please recompile `screen' with the `-DDEBUG
--DTMPTEST' options enabled, reproduce the bug, and have a look at the
-debug output written to the directory `/tmp/debug'. If necessary quote
-suspect passages from the debug output and show the contents of your
-`config.h' if it matters.
-
-
-File: screen.info, Node: Availability, Prev: Reporting Bugs, Up: Bugs
-
-Availability
-============
-
- `Screen' is available under the `GNU' copyleft.
-
- The latest official release of `screen' available via anonymous ftp
-from `prep.ai.mit.edu', `nic.funet.fi' or any other `GNU' distribution
-site. The latest beta testing release of `screen' is available from
-`ftp.uni-erlangen.de (131.188.1.43)', in the directory
-`pub/utilities/screen'.
-
-
-File: screen.info, Node: Installation, Next: Concept Index, Prev: Bugs, Up: Top
-
-Installation
-************
-
- Since `screen' uses pseudo-ttys, the select system call, and
-UNIX-domain sockets/named pipes, it will not run under a system that
-does not include these features of 4.2 and 4.3 BSD UNIX.
-
-* Menu:
-
-* Socket Directory:: Where screen stores its handle.
-* Compiling Screen::
-
-
-File: screen.info, Node: Socket Directory, Next: Compiling Screen, Up: Installation
-
-Socket Directory
-================
-
- The socket directory defaults either to `$HOME/.screen' or simply to
-`/tmp/screens' or preferably to `/usr/local/screens' chosen at
-compile-time. If `screen' is installed setuid root, then the
-administrator should compile screen with an adequate (not NFS mounted)
-`SOCKDIR'. If `screen' is not running setuid-root, the user can specify
-any mode 777 directory in the environment variable `$SCREENDIR'.
-
-
-File: screen.info, Node: Compiling Screen, Prev: Socket Directory, Up: Installation
-
-Compiling Screen
-================
-
- To compile and install screen:
-
- The `screen' package comes with a `GNU Autoconf' configuration
-script. Before you compile the package run
-
- `sh ./configure'
-
- This will create a `config.h' and `Makefile' for your machine. If
-`configure' fails for some reason, then look at the examples and
-comments found in the `Makefile.in' and `config.h.in' templates.
-Rename `config.status' to `config.status.MACHINE' when you want to keep
-configuration data for multiple architectures. Running `sh
-./config.status.MACHINE' recreates your configuration significantly
-faster than rerunning `configure'.
-Read through the "User Configuration" section of `config.h', and verify
-that it suits your needs. A comment near the top of this section
-explains why it's best to install screen setuid to root. Check for the
-place for the global `screenrc'-file and for the socket directory.
-Check the compiler used in `Makefile', the prefix path where to install
-`screen'. Then run
-
- `make'
-
- If `make' fails to produce one of the files `term.h', `comm.h' or
-`tty.c', then use `FILENAME.X.dist' instead. For additional
-information about installation of `screen' refer to the file
-`INSTALLATION', coming with this package.
-
-
-File: screen.info, Node: Concept Index, Next: Command Index, Prev: Installation, Up: Top
-
-Concept Index
-*************
-
-* Menu:
-
-* .screenrc: Startup Files.
-* availability: Availability.
-* binding: Key Binding.
-* bug report: Reporting Bugs.
-* bugs: Bugs.
-* capabilities: Special Capabilities.
-* command line options: Invoking Screen.
-* command summary: Command Summary.
-* compiling screen: Compiling Screen.
-* control sequences: Control Sequences.
-* copy and paste: Copy and Paste.
-* customization: Customization.
-* environment: Environment.
-* files: Files.
-* flow control: Flow Control.
-* input translation: Input Translation.
-* installation: Installation.
-* introduction: Getting Started.
-* invoking: Invoking Screen.
-* key binding: Key Binding.
-* marking: Copy.
-* message line: Message Line.
-* multiuser session: Multiuser Session.
-* options: Invoking Screen.
-* overview: Overview.
-* screenrc: Startup Files.
-* scrollback: Copy.
-* socket directory: Socket Directory.
-* terminal capabilities: Special Capabilities.
-* title: Naming Windows.
-
diff --git a/src/doc/screen.info-4 b/src/doc/screen.info-4
index e8bc0dd..f466b1a 100644
--- a/src/doc/screen.info-4
+++ b/src/doc/screen.info-4
@@ -1,7 +1,7 @@
This is Info file screen.info, produced by Makeinfo-1.55 from the input
file ./screen.texinfo.
- This file documents the the `Screen' virtual terminal manager.
+ This file documents the `Screen' virtual terminal manager.
Copyright (c) 1993 Free Software Foundation, Inc.
@@ -20,6 +20,138 @@ versions, except that this permission notice may be stated in a
translation approved by the Foundation.

+File: screen.info, Node: Reporting Bugs, Next: Availability, Prev: Known Bugs, Up: Bugs
+
+Reporting Bugs
+==============
+
+ If you find a bug in `Screen', please send electronic mail to
+`screen@uni-erlangen.de', and also to `bug-gnu-utils@prep.ai.mit.edu'.
+Include the version number of `Screen' which you are using. Also
+include in your message the hardware and operating system, the compiler
+used to compile, a description of the bug behavior, and the conditions
+that triggered the bug. Please recompile `screen' with the `-DDEBUG
+-DTMPTEST' options enabled, reproduce the bug, and have a look at the
+debug output written to the directory `/tmp/debug'. If necessary quote
+suspect passages from the debug output and show the contents of your
+`config.h' if it matters.
+
+
+File: screen.info, Node: Availability, Prev: Reporting Bugs, Up: Bugs
+
+Availability
+============
+
+ `Screen' is available under the `GNU' copyleft.
+
+ The latest official release of `screen' available via anonymous ftp
+from `prep.ai.mit.edu', `nic.funet.fi' or any other `GNU' distribution
+site. The latest beta testing release of `screen' is available from
+`ftp.uni-erlangen.de (131.188.1.43)', in the directory
+`pub/utilities/screen'.
+
+
+File: screen.info, Node: Installation, Next: Concept Index, Prev: Bugs, Up: Top
+
+Installation
+************
+
+ Since `screen' uses pseudo-ttys, the select system call, and
+UNIX-domain sockets/named pipes, it will not run under a system that
+does not include these features of 4.2 and 4.3 BSD UNIX.
+
+* Menu:
+
+* Socket Directory:: Where screen stores its handle.
+* Compiling Screen::
+
+
+File: screen.info, Node: Socket Directory, Next: Compiling Screen, Up: Installation
+
+Socket Directory
+================
+
+ The socket directory defaults either to `$HOME/.screen' or simply to
+`/tmp/screens' or preferably to `/usr/local/screens' chosen at
+compile-time. If `screen' is installed setuid root, then the
+administrator should compile screen with an adequate (not NFS mounted)
+`SOCKDIR'. If `screen' is not running setuid-root, the user can specify
+any mode 777 directory in the environment variable `$SCREENDIR'.
+
+
+File: screen.info, Node: Compiling Screen, Prev: Socket Directory, Up: Installation
+
+Compiling Screen
+================
+
+ To compile and install screen:
+
+ The `screen' package comes with a `GNU Autoconf' configuration
+script. Before you compile the package run
+
+ `sh ./configure'
+
+ This will create a `config.h' and `Makefile' for your machine. If
+`configure' fails for some reason, then look at the examples and
+comments found in the `Makefile.in' and `config.h.in' templates.
+Rename `config.status' to `config.status.MACHINE' when you want to keep
+configuration data for multiple architectures. Running `sh
+./config.status.MACHINE' recreates your configuration significantly
+faster than rerunning `configure'.
+Read through the "User Configuration" section of `config.h', and verify
+that it suits your needs. A comment near the top of this section
+explains why it's best to install screen setuid to root. Check for the
+place for the global `screenrc'-file and for the socket directory.
+Check the compiler used in `Makefile', the prefix path where to install
+`screen'. Then run
+
+ `make'
+
+ If `make' fails to produce one of the files `term.h', `comm.h' or
+`tty.c', then use `FILENAME.X.dist' instead. For additional
+information about installation of `screen' refer to the file
+`INSTALLATION', coming with this package.
+
+
+File: screen.info, Node: Concept Index, Next: Command Index, Prev: Installation, Up: Top
+
+Concept Index
+*************
+
+* Menu:
+
+* .screenrc: Startup Files.
+* availability: Availability.
+* binding: Key Binding.
+* bug report: Reporting Bugs.
+* bugs: Bugs.
+* capabilities: Special Capabilities.
+* command line options: Invoking Screen.
+* command summary: Command Summary.
+* compiling screen: Compiling Screen.
+* control sequences: Control Sequences.
+* copy and paste: Copy and Paste.
+* customization: Customization.
+* environment: Environment.
+* files: Files.
+* flow control: Flow Control.
+* input translation: Input Translation.
+* installation: Installation.
+* introduction: Getting Started.
+* invoking: Invoking Screen.
+* key binding: Key Binding.
+* marking: Copy.
+* message line: Message Line.
+* multiuser session: Multiuser Session.
+* options: Invoking Screen.
+* overview: Overview.
+* screenrc: Startup Files.
+* scrollback: Copy.
+* socket directory: Socket Directory.
+* terminal capabilities: Special Capabilities.
+* title: Naming Windows.
+
+
File: screen.info, Node: Command Index, Next: Keystroke Index, Prev: Concept Index, Up: Top
Command Index
@@ -43,6 +175,7 @@ Command Index
* break: Break.
* bufferfile: Screen-Exchange.
* c1: Character Processing.
+* charset: Character Processing.
* chdir: Chdir.
* clear: Clear.
* colon: Colon.
@@ -54,9 +187,11 @@ Command Index
* debug: Debug.
* defautonuke: Autonuke.
* defc1: Character Processing.
+* defcharset: Character Processing.
* defescape: Command Character.
* defflow: Flow.
* defgr: Character Processing.
+* defhstatus: Hardstatus.
* defkanji: Character Processing.
* deflogin: Login.
* defmode: Mode.
@@ -67,6 +202,7 @@ Command Index
* defwritelock: Writelock.
* defzombie: Zombie.
* detach: Detach.
+* digraph: Digraph.
* dumptermcap: Dump Termcap.
* echo: echo.
* escape: Command Character.
@@ -77,7 +213,7 @@ Command Index
* hardcopydir: Hardcopy.
* hardcopy_append: Hardcopy.
* hardstatus: Hardware Status Line.
-* height: Height.
+* height: Window Size.
* help: Help.
* history: History.
* info: Info.
@@ -88,7 +224,7 @@ Command Index
* license: License.
* lockscreen: Lock.
* log: Log.
-* logdir: Log.
+* logfile: Log.
* login: Login.
* mapdefault: Bindkey Control.
* mapnotnext: Bindkey Control.
@@ -132,11 +268,13 @@ Command Index
* silencewait: Silence.
* sleep: sleep.
* slowpaste: Paste.
+* sorendition: Sorendition.
* startup_message: Startup Message.
* stuff: Registers.
* suspend: Suspend.
* term: Term.
* termcap: Termcap Syntax.
+* termcapinfo: Termcap Syntax.
* terminfo: Termcap Syntax.
* time: Time.
* title: Title Command.
@@ -146,7 +284,7 @@ Command Index
* vbell_msg: Bell.
* version: Version.
* wall: Wall.
-* width: Width.
+* width: Window Size.
* windows: Windows.
* wrap: Wrap.
* writebuf: Screen-Exchange.
@@ -180,8 +318,8 @@ omitted from the key sequences, since it is the same for all bindings.
* {: History.
* a: Command Character.
* A: Title Command.
-* C: Clear.
* c: Screen Command.
+* C: Clear.
* C-a: Other Window.
* C-c: Screen Command.
* C-d: Detach.
@@ -198,7 +336,7 @@ omitted from the key sequences, since it is the same for all bindings.
* C-r: Wrap.
* C-s: XON/XOFF.
* C-t: Time.
-* C-v: Version.
+* C-v: Digraph.
* C-w: Windows.
* C-x: Lock.
* C-z: Suspend.
@@ -209,14 +347,14 @@ omitted from the key sequences, since it is the same for all bindings.
* d: Detach.
* ESC: Copy.
* f: Flow.
-* h: Hardcopy.
* H: Log.
+* h: Hardcopy.
* i: Info.
* k: Kill.
-* l: Redisplay.
* L: Login.
-* M: Monitor.
+* l: Redisplay.
* m: Last Message.
+* M: Monitor.
* N: Number.
* n: Next and Previous.
* p: Next and Previous.
@@ -227,7 +365,7 @@ omitted from the key sequences, since it is the same for all bindings.
* t: Time.
* v: Version.
* w: Windows.
-* W: Width.
+* W: Window Size.
* x: Lock.
* Z: Reset.
* z: Suspend.
diff --git a/src/doc/screen.texinfo b/src/doc/screen.texinfo
index 8db4f3f..a500018 100644
--- a/src/doc/screen.texinfo
+++ b/src/doc/screen.texinfo
@@ -5,7 +5,7 @@
@finalout
@setchapternewpage odd
@c %**end of header
-@set version 3.6.0
+@set version 3.7.0
@c For examples, use a literal escape in info.
@ifinfo
@@ -16,7 +16,7 @@
@end iftex
@ifinfo
-This file documents the the @code{Screen} virtual terminal manager.
+This file documents the @code{Screen} virtual terminal manager.
Copyright (c) 1993 Free Software Foundation, Inc.
@@ -46,7 +46,7 @@ by the Foundation.
@title Screen
@subtitle The virtual terminal manager
@subtitle for Version @value{version}
-@subtitle Nov 1994
+@subtitle Oct 1995
@page
@vskip 0pt plus 1filll
@@ -188,26 +188,20 @@ discussed in the section on keystrokes (@pxref{Default Key Bindings}).
Another section (@pxref{Customization}) deals with the contents of your
@file{.screenrc}.
-If possible, choose a version of your terminal's termcap that has
-automatic margins turned @emph{off}. This will ensure an accurate and
-optimal update of the screen in all circumstances. The next best thing
-is an auto-margin terminal that allows the last position on the screen
-to be updated without scrolling the screen (such as a VT100). This also
-allows the entire screen to be updated. If all you've got is a
-``true'' auto-margin terminal, @code{screen} will be content to use it,
-but updating a character put into the last position on the screen may
-not be possible until the screen scrolls or the character is moved into
-a safe position in some other way. This delay can be shortened by using
-a terminal with insert-character capability.
-
-If your terminal is of the second type (firm-margined @samp{am}), you will
-want to let @code{screen} know about this, since a normal termcap
-doesn't distinguish this type of automatic margins from a ``true'' @samp{am}
-terminal. You do this by specifying the @samp{xn} capability in your termcap
-(@pxref{Termcap,@code{termcap} command}), or by using the @samp{-L}
-command-line option. @code{screen} needs this information to correctly
-update the screen. You don't need to worry about this if your terminal
-type starts with @samp{vt}, as @code{screen} assumes @samp{xn} in that case.
+If your terminal is a ``true'' auto-margin terminal (it doesn't allow
+the last position on the screen to be updated without scrolling the
+screen) consider to use a version of your terminal's termcap that has
+automatic margins turned @emph{off}. This will ensure an accurate
+and optimal update of the screen in all circumstances. Most terminals
+nowadays have ``magic'' margins (automatic margins plus usable last
+column). This is the VT100 style type and perfectly suited for
+@code{screen}.
+If all you've got is a ``true'' auto-margin terminal @code{screen}
+will be content to use it, but updating a character put into the last
+position on the screen may not be possible until the screen scrolls or
+the character is moved into a safe position in some other way. This
+delay can be shortened by using a terminal with insert-character
+capability.
@xref{Special Capabilities}, for more information about telling
@code{screen} what kind of terminal you have.
@@ -375,8 +369,7 @@ following ways:
For the global screenrc file @code{screen} searches for the environment
variable @code{$SYSSCREENRC} (this override feature may be disabled at
compile-time). The user specific screenrc file is
-searched for in @code{$ISCREENRC}, then @code{$SCREENRC}, then
-@file{@code{$HOME}/.iscreenrc} and finally defaults to
+searched for in @code{$SCREENRC}, then
@file{@code{$HOME}/.screenrc}. The command line option @samp{-c}
specifies which file to use (@pxref{Invoking Screen}. Commands in these
files are used to set options, bind commands to keys, and to
@@ -595,10 +588,13 @@ Send a ^S (ASCII XOFF) to the current window. @xref{XON/XOFF}.
Show the load average and xref. @xref{Time}.
@item @kbd{C-a v}
-@itemx @kbd{C-a C-v}
(version)@*
Display the version and compilation date. @xref{Version}.
+@item @kbd{C-a C-v}
+(digraph)@*
+Enter digraph. @xref{Digraph}.
+
@item @kbd{C-a w}
@itemx @kbd{C-a C-w}
(windows)@*
@@ -606,7 +602,7 @@ Show a list of active windows. @xref{Windows}.
@item @kbd{C-a W}
(width)@*
-Toggle between 80 and 132 columns. @xref{Width}.
+Toggle between 80 and 132 columns. @xref{Window Size}.
@item @kbd{C-a x}
@itemx @kbd{C-a C-x}
@@ -711,6 +707,8 @@ Send a break signal to the current window. @xref{Break}.
Select a file for screen-exchange. @xref{Screen-Exchange}.
@item c1 @var{[state]}
Change c1 code processing. @xref{Character Processing}.
+@item charset @var{set}
+Change character set slot designation. @xref{Character Processing}.
@item chdir @var{[directory]}
Change the current directory for future windows. @xref{Chdir}.
@item clear
@@ -733,12 +731,16 @@ Suppress/allow debugging output. @xref{Debug}.
Select default autonuke behavior. @xref{Autonuke}.
@item defc1 @var{state}
Select default c1 processing behavior. @xref{Character Processing}.
+@item defcharset @var{[set]}
+Change defaul character set slot designation. @xref{Character Processing}.
@item defescape @var{xy}
Set the default command and @code{meta} characters. @xref{Command Character}.
@item defflow @var{fstate}
Select default flow control behavior. @xref{Flow}.
@item defgr @var{state}
Select default GR processing behavior. @xref{Character Processing}.
+@item defhstatus @var{[status]}
+Select default window hardstatus line. @xref{Hardstatus}.
@item defkanji @var{wtype}
Select default GR processing behavior. @xref{Character Processing}.
@item deflogin @var{state}
@@ -759,6 +761,8 @@ Set default writelock behavior. @xref{Multiuser}.
Keep dead windows. @xref{Zombie}.
@item detach
Disconnect @code{screen} from the terminal. @xref{Detach}.
+@item digraph
+Enter digraph sequence. @xref{Digraph}.
@item dumptermcap
Write the window's termcap entry to a file. @xref{Dump Termcap}.
@item echo [-n] @var{message}
@@ -780,7 +784,7 @@ Place, where to dump hardcopy files. @xref{Hardcopy}.
@item hardstatus @var{[state]}
Use the hardware status line. @xref{Hardware Status Line}.
@item height @var{[lines]}
-Set display height. @xref{Height}.
+Set display height. @xref{Window Size}.
@item help
Display current key bindings. @xref{Help}.
@item history
@@ -801,7 +805,7 @@ Display licensing information. @xref{Startup}.
Lock the controlling terminal. @xref{Lock}.
@item log @var{[state]}
Log all output in the current window. @xref{Log}.
-@item logdir @var{directory}
+@item logfile @var{filename}
Place where to collect logfiles. @xref{Log}.
@item login @var{[state]}
Log the window in @file{/etc/utmp}. @xref{Login}.
@@ -889,6 +893,8 @@ Default timeout to trigger an inactivity notify. @xref{Silence}.
Pause during startup. @xref{Startup}.
@item slowpaste @var{msec}
Slow down pasting in windows. @xref{Paste}.
+@item sorendition @var{[attr [color]]}
+Change text highlighting. @xref{Sorendition}.
@item startup_message @var{state}
Display copyright notice on startup. @xref{Startup}.
@item stuff @var{string}
@@ -901,6 +907,8 @@ Set @code{$TERM} for new windows. @xref{Term}.
Tweak termcap entries for best performance. @xref{Termcap Syntax}.
@item terminfo @var{term terminal-tweaks [window-tweaks]}
Ditto, for terminfo systems. @xref{Termcap Syntax}.
+@item termcapinfo @var{term terminal-tweaks [window-tweaks]}
+Ditto, for both systems. @xref{Termcap Syntax}.
@item time
Display time and load average. @xref{Time}.
@item title @var{[windowtitle]}
@@ -915,10 +923,10 @@ Set vbell message. @xref{Bell}.
Set delay for vbell message. @xref{Bell}.
@item version
Display @code{screen} version. @xref{Version}.
-@item wall @var{message ...}
+@item wall @var{message}
Write a message to all displays. @xref{Multiuser Session}.
@item width @var{[num]}
-Set the width of the window. @xref{Width}.
+Set the width of the window. @xref{Window Size}.
@item windows
List active windows. @xref{Windows}.
@item wrap @var{[state]}
@@ -941,7 +949,8 @@ Keep dead windows. @xref{Zombie}.
This section describes the commands for creating a new window for
running programs. When a new window is created, the first available
number from the range 0@dots{}9 is assigned to it. There can be no more
-than 10 windows active at any one time.
+than 10 windows active at any one time unless @code{screen} was compiled
+with a higher MAXWIN setting.
@menu
* Chdir:: Change the working directory for new windows.
@@ -1054,8 +1063,7 @@ use of the @code{term} command is discouraged for non-default purpose.
That is, one may want to specify special @code{$TERM} settings (e.g. vt100) for
the next @code{screen rlogin othermachine} command. Use the command
@code{screen -T vt100 rlogin othermachine} rather than setting
-(@code{term vt100}) and resetting (@code{term screen}) the default
-before and after the @code{screen} command.
+and resetting the default.
@end deffn
@node Selecting, Session Management, New Window, Top
@@ -1097,11 +1105,9 @@ Switch to the previous window (the opposite of @kbd{C-a n}).
@deffn Command other
(@kbd{C-a C-a})@*
Switch to the last window displayed. Note that this command
-defaults to the command character typed twice, unless overridden; for
-instance, if you use the option @samp{-e]x}, this command becomes
-@kbd{]]}, not @kbd{]C-a} (@pxref{Command Character}). On the other
-hand, if you use the option @samp{-e``}, this command remains @kbd{`
-C-a}, since @kbd{``} is bound to @code{meta}.
+defaults to the command character typed twice, unless overridden.
+For instance, if you use the option @samp{-e]x},
+this command becomes @kbd{]]} (@pxref{Command Character}).
@end deffn
@node Select, , Other Window, Selecting
@@ -1288,7 +1294,7 @@ Multi-user mode only.
@node Wall, Writelock, Acldel, Multiuser Session
@subsection Wall
-@deffn Command wall @var{message ...}
+@deffn Command wall @var{message}
(none)@*
Write a message to all displays. The message will appear in the terminal's
status line.
@@ -1358,18 +1364,17 @@ in a session. @xref{Virtual Terminal}, for commands to control the
terminal emulation itself.
@menu
-* Naming Windows:: Control the name of the window
-* Autonuke:: Flush unseen output
+* Naming Windows:: Control the name of the window
* Console:: See the host's console messages
* Kill:: Destroy an unwanted window
* Login:: Control @file{/etc/utmp} logging
* Mode:: Control the file mode of the pty
* Monitor:: Watch for activity in a window
-* Obuflimit:: Allow pending output when reading more
-* Windows:: List the active windows
+* Windows:: List the active windows
+* Hardstatus:: Set a window's hardstatus line
@end menu
-@node Naming Windows, Autonuke, , Window Settings
+@node Naming Windows, Console, , Window Settings
@section Naming Windows (Titles)
@cindex title
@@ -1467,7 +1472,7 @@ PROMPT_COMMAND='echo -n -e "\033k\033\134"'
(I used @samp{\134} to output a @samp{\} because of a bug in v1.04).
@node Title Screenrc, , Title Prompts, Naming Windows
-@subsection Setting up shell Titles in your @file{.screenrc}
+@subsection Setting up shell titles in your @file{.screenrc}
Here are some .screenrc examples:
@example
@@ -1475,7 +1480,7 @@ screen -t top 2 nice top
@end example
Adding this line to your .screenrc would start a niced version of the
-@code{top} command in window 2 name @samp{top} rather than @samp{nice}.
+@code{top} command in window 2 named @samp{top} rather than @samp{nice}.
@example
shelltitle '> |csh'
@@ -1524,24 +1529,7 @@ a title when you type @kbd{C-a o}. The second binding would clear an
auto-titles current setting (C-a E). The third binding would set the
current window's title to @samp{(unknown)} (C-a u).
-@node Autonuke, Console, Naming Windows, Window Settings
-@section Autonuke
-@deffn Command autonuke @var{state}
-(none)@*
-Sets whether a clear screen sequence should nuke all the output
-that has not been written to the terminal. @xref{Obuflimit}.
-This property is set per display, not per window.
-@end deffn
-
-@deffn Command defautonuke @var{state}
-(none)@*
-Same as the @code{autonuke} command except that the default setting for
-new displays is also changed. Initial setting is @code{off}.
-Note that you can use the special @code{AN} terminal capability if you
-want to have a terminal type dependent setting.
-@end deffn
-
-@node Console, Kill, Autonuke, Window Settings
+@node Console, Kill, Naming Windows, Window Settings
@section Console
@deffn Command console @var{[state]}
(none)@*
@@ -1605,7 +1593,7 @@ windows which are logged in, 0600 for others (e.g. when @code{-ln} was
specified for creation. @xref{Screen Command}).
@end deffn
-@node Monitor, Obuflimit, Mode, Window Settings
+@node Monitor, Windows, Mode, Window Settings
@section Monitoring
@deffn Command activity message
@@ -1643,26 +1631,7 @@ the window-status display (@pxref{Windows}). Monitoring defaults to
@samp{off} for all windows.
@end deffn
-@node Obuflimit, Windows, Monitor, Window Settings
-@section Obuflimit
-@deffn Command obuflimit @var{[limit]}
-(none)@*
-If the output buffer contains more bytes than the specified limit, no
-more data will be read from the windows. The default value is 256. If
-you have a fast display (like @code{xterm}), you can set it to some
-higher value. If no argument is specified, the current setting is displayed.
-This property is set per display, not per window.
-@end deffn
-
-@deffn Command defobuflimit @var{limit}
-(none)@*
-Same as the @code{obuflimit} command except that the default setting for new
-displays is also changed. Initial setting is 256 bytes. Note that you can use
-the special @code{OL} terminal capability if you want to have a terminal
-type dependent limit.
-@end deffn
-
-@node Windows, , Obuflimit, Window Settings
+@node Windows, Hardstatus, Monitor, Window Settings
@section Windows
@kindex w
@kindex C-w
@@ -1682,24 +1651,52 @@ If this list is too long to fit on the terminal's status line only the
portion around the current window is displayed.
@end deffn
+@node Hardstatus, , Windows, Window Settings
+@section Hardstatus
+
+@code{Screen} maintains a hardstatus line for every window. If a window
+gets selected, the display's hardstatus will be updated to match
+the window's hardstatus line. If the display has no hardstatus
+the line will be displayed as a standard screen message.
+The hardstatus line can be changed with the ANSI Application
+Program Command (APC): @samp{ESC_<string>ESC\}. As a convenience
+for xterm users the sequence @samp{ESC]0..2;<string>^G} is
+also accepted.
+
+@deffn Command defhstatus
+(none)@*
+The hardstatus line that all new windows will get is set to
+@var{status}.
+This command is useful to make the hardstatus of every window
+display the window number or title or the like. @var{status}
+may contain the same directives as in the window messages, but
+the directive escape character is @samp{^E} (octal 005) instead
+of @samp{%}. This was done to make a misinterpretion of program
+generated hardstatus lines impossible.
+If the parameter @var{status}
+is omitted, the current default string is displayed.
+Per default the hardstatus line of new windows is empty.
+@end deffn
+
@node Virtual Terminal, Copy and Paste, Window Settings, Top
@chapter Virtual Terminal
Each window in a @code{screen} session emulates a VT100 terminal, with
-some extra functions added. The commands described here modify the
-terminal emulation.
+some extra functions added. The VT100 emulator is hardcoded, no other
+terminal types can be emulated.
+The commands described here modify the terminal emulation.
@menu
* Control Sequences:: Details of the internal VT100 emulation.
* Input Translation:: How keystrokes are remapped.
+* Digraph:: Entering digraph sequences.
* Bell:: Getting your attention.
* Clear:: Clear the window display.
-* Height:: Changing the height of your terminal.
* Info:: Terminal emulation statistics.
* Redisplay:: When the display gets confusing.
* Wrap:: Automatic margins.
* Reset:: Recovering from ill-behaved applications.
-* Width:: Changing the width of your terminal.
+* Window Size:: Changing the size of your terminal.
* Character Processing:: Change the effect of special characters.
@end menu
@@ -1721,6 +1718,10 @@ ESC 8 (V) Restore Cursor and Attributes
ESC [s (A) Save Cursor and Attributes
ESC [u (A) Restore Cursor and Attributes
ESC c Reset to Initial State
+ESC g Visual Bell
+ESC Pn p Cursor Visibility (97801)
+ Pn = 6 Invisible
+ 7 Visible
ESC = (V) Application Keypad Mode
ESC > (V) Numeric Keypad Mode
ESC # 8 (V) Fill Screen with E's
@@ -1731,8 +1732,9 @@ ESC k Title Definition String
ESC P (A) Device Control String
Outputs a string directly to the host
terminal without interpretation.
-ESC _ (A) Application Program Command (not used)
-ESC ] (A) Operating System Command (not used)
+ESC _ (A) Application Program Command (Hardstatus)
+ESC ] (A) Operating System Command (Hardstatus, xterm
+ title hack)
Control-N (A) Lock Shift G1 (SO)
Control-O (A) Lock Shift G0 (SI)
ESC n (A) Lock Shift G2
@@ -1770,6 +1772,18 @@ ESC [ Ps ;...; Ps m Select Graphic Rendition
24 (A) Not Underlined
25 (A) Not Blinking
27 (A) Positive Image
+ 30 (A) Foreground Black
+ 31 (A) Foreground Red
+ 32 (A) Foreground Green
+ 33 (A) Foreground Yellow
+ 34 (A) Foreground Blue
+ 35 (A) Foreground Magenta
+ 36 (A) Foreground Cyan
+ 37 (A) Foreground White
+ 39 (A) Foreground Default
+ 40 (A) Background Black
+ ... ...
+ 49 (A) Background Default
ESC [ Pn g Tab Clear
Pn = None or 0 Clear Tab at Current Position
3 Clear All Tabs
@@ -1780,26 +1794,32 @@ ESC [ Pn L (A) Insert Line
ESC [ Pn M (A) Delete Line
ESC [ Pn @@ (A) Insert Character
ESC [ Pn P (A) Delete Character
+ESC [ Pn S Scroll Scrolling Region Up
+ESC [ Pn T Scroll Scrolling Region Down
ESC [ Ps ;...; Ps h Set Mode
ESC [ Ps ;...; Ps l Reset Mode
Ps = 4 (A) Insert Mode
+ 20 (A) @samp{Automatic Linefeed} Mode.
+ 34 Normal Cursor Visibility
?1 (V) Application Cursor Keys
?3 (V) Change Terminal Width to 132 columns
- ?5 (V) Visible Bell (@samp{On} followed by @samp{Off})
+ ?5 (V) Reverse Video
?6 (V) @samp{Origin} Mode
?7 (V) @samp{Wrap} Mode
+ ?25 (V) Visible Cursor
ESC [ 5 i (A) Start relay to printer (ANSI Media Copy)
ESC [ 4 i (A) Stop relay to printer (ANSI Media Copy)
ESC [ 8 ; Ph ; Pw t Resize the window to @samp{Ph} lines and
@samp{Pw} columns (SunView special)
ESC [ c Send VT100 Identification String
+ESC [ x (V) Send Terminal Parameter Report
ESC [ > c Send Secondary Device Attributes String
ESC [ 6 n Send Cursor Position Report
@end example
-@node Input Translation, Bell, Control Sequences, Virtual Terminal
+@node Input Translation, Digraph, Control Sequences, Virtual Terminal
@section Input Translation
@cindex input translation
In order to do a full VT100 emulation @code{screen} has to detect
@@ -1889,7 +1909,25 @@ Keypad enter fe stuff \015
stuff \033OM (A)
@end example
-@node Bell, Clear, Input Translation, Virtual Terminal
+@node Digraph, Bell, Input Translation, Virtual Terminal
+@section Digraph
+
+@kindex C-v
+@deffn Command digraph [preset]
+(none)@*
+This command prompts the user for a digraph sequence. The next
+two characters typed are looked up in a builtin table and the
+resulting character is inserted in the input stream. For example,
+if the user enters @samp{a"}, an a-umlaut will be inserted. If the
+first character entered is a 0 (zero), @code{screen}
+will treat the following charcters (up to three) as an octal
+number instead. The optional argument @var{preset}
+is treated as user input, thus one can create an "umlaut" key.
+For example the command @samp{bindkey ^K digraph '"'} enables the user
+to generate an a-umlaut by typing @samp{CTRL-K a}.
+@end deffn
+
+@node Bell, Clear, Digraph, Virtual Terminal
@section Bell
@deffn Command bell_msg [message]
@@ -1927,7 +1965,7 @@ Per default, @code{vbell} is @samp{off}, thus the audible bell is used.
@deffn Command vbell_msg [message]
(none)@*
-Sets the visual bell message. @var{message} is printed to the status
+Sets the visual bell message. @var{Message} is printed to the status
line if the window receives a bell character (^G), @code{vbell} is
set to @samp{on} and the terminal does not support a visual bell.
The default message is @samp{Wuff, Wuff!!}.
@@ -1940,7 +1978,7 @@ Define a delay in seconds after each display of @code{screen} 's visual
bell message. The default is 1 second.
@end deffn
-@node Clear, Height, Bell, Virtual Terminal
+@node Clear, Info, Bell, Virtual Terminal
@section Clear
@kindex C
@deffn Command clear
@@ -1948,15 +1986,7 @@ bell message. The default is 1 second.
Clears the screen and saves its contents to the scrollback buffer.
@end deffn
-@node Height, Info, Clear, Virtual Terminal
-@section Height
-@deffn Command height @var{[lines]}
-(none)@*
-Set the display height to a specified number of lines. When no
-argument is given it toggles between 24 and 42 lines display.
-@end deffn
-
-@node Info, Redisplay, Height, Virtual Terminal
+@node Info, Redisplay, Clear, Virtual Terminal
@section Info
@kindex i
@kindex C-i
@@ -2026,7 +2056,7 @@ windows is changed. Initially line-wrap is on and can be toggled with the
@code{wrap} command (@kbd{C-a r}) or by means of "C-a : wrap on|off".
@end deffn
-@node Reset, Width, Wrap, Virtual Terminal
+@node Reset, Window Size, Wrap, Virtual Terminal
@section Reset
@kindex Z
@deffn Command reset
@@ -2036,8 +2066,8 @@ settings (like scroll regions or graphics character set) are left over from
an application.
@end deffn
-@node Width, Character Processing, Reset, Virtual Terminal
-@section Width
+@node Window Size, Character Processing, Reset, Virtual Terminal
+@section Window Size
@kindex W
@deffn Command width [num]
(@kbd{C-a W})@*
@@ -2047,7 +2077,13 @@ capable terminal and the termcap entries @samp{Z0} and @samp{Z1}. See
the @code{termcap} command (@pxref{Termcap}), for more information.
@end deffn
-@node Character Processing, ,Width, Virtual Terminal
+@deffn Command height @var{[lines]}
+(none)@*
+Set the display height to a specified number of lines. When no
+argument is given it toggles between 24 and 42 lines display.
+@end deffn
+
+@node Character Processing, ,Window Size, Virtual Terminal
@section Character Processing
@deffn Command c1 [state]
@@ -2083,6 +2119,21 @@ See also @samp{defkanji}, which changes the default setting of a new
window.
@end deffn
+@deffn Command charset set
+(none)@*
+Change the current character set slot designation and charset
+mapping. The first four character of @var{set}
+are treated as charset designators while the fifth and sixth
+character must be in range @samp{0} to @samp{3} and set the GL/GR
+charset mapping. On every position a @samp{.} may be used to indicate
+that the corresponding charset/mapping should not be changed
+(@var{set} is padded to six characters internally by appending
+@samp{.} chars). New windows have @samp{BBBB02} as default
+charset, unless a @samp{kanji} command is active.
+
+The current setting can be viewed with the @xref{Info} command.
+@end deffn
+
@deffn Command defc1 state
(none)@*
Same as the @samp{c1} command except that the default setting for
@@ -2101,6 +2152,12 @@ Same as the @samp{kanji} command except that the default setting for
new windows is changed. Initial setting is @samp{off}, i.e. @samp{jis}.
@end deffn
+@deffn Command defcharset [set]
+Like the @samp{charset} command except that the default setting for
+new windows is changed. Shows current default if called without
+argument.
+@end deffn
+
@node Copy and Paste, Subprocess Execution, Virtual Terminal, Top
@chapter Copy and Paste
@cindex copy and paste
@@ -2319,9 +2376,16 @@ whole scrollback buffer to that file: @*@kbd{C-a [ g SPACE G $ >}.
@kbd{C-g} gives information about the current line and column.
@noindent
+@kbd{x} exchanges the first mark and the current cursor position. You
+can use this to adjust an already placed mark.
+
+@noindent
@kbd{@@} does nothing. Absolutely nothing. Does not even exit copy
mode.
+@noindent
+All keys not described here exit copy mode.
+
@node Paste, Registers, Copy, Copy and Paste
@section Paste
@@ -2504,11 +2568,12 @@ running subprocess in this window.
When a subprocess is running the @code{kill} command will affect it instead of
the window's process.
@*
-Refer to the postscript file @file{doc/fdpat.ps} for illustration of all 21
-possible combinations. Each drawing shows the numbers 210 representing the three
-file descriptors of newcommand. The box marked `W' is usual pty that has
-the old process (shell) on its slave side. The box marked `P' is the
-secondary pty that now has screen at its master side.
+Refer to the postscript file @file{doc/fdpat.ps} for a confusing
+illustration of all 21 possible combinations. Each drawing shows the digits
+2, 1, 0 representing the three file descriptors of newcommand. The box
+marked `W' is usual pty that has the application-process on its slave side.
+The box marked `P' is the secondary pty that now has screen at its master
+side.
@end deffn
@node Using Exec, , Exec, Subprocess Execution
@@ -2558,7 +2623,8 @@ This adds a pager to the window output. The special character @samp{|} is
needed to give the user control over the pager although it gets its input from
the window's process. This works, because @samp{less} listens on stderr
(a behavior that @code{screen} would not expect without the @samp{|})
-when its stdin is not a tty.
+when its stdin is not a tty. @code{Less} versions newer than 177 fail miserably
+here; good old @code{pg} still works.
@item !:sed -n s/.*Error.*/\007/p
Sends window output to both, the user and the sed command. The sed inserts an
@@ -2663,7 +2729,7 @@ window. The keystroke for this command is the second parameter to the
(none)@*
This command has the same effect as typing the screen escape character
(@kbd{C-a}). It is probably only useful for key bindings.
-@xref{Bindkey}
+@xref{Bindkey}.
@end deffn
@node Help, Bindkey, Command Character, Key Binding
@@ -2675,8 +2741,7 @@ Displays a help screen showing you all the key bindings. The first
pages list all the internal commands followed by their bindings.
Subsequent pages will display the custom commands, one command per key.
Press space when you're done reading each page, or return to exit early.
-All other characters are ignored, except for the command character,
-which will exit the help display and begin a command.
+All other characters are ignored.
@xref{Default Key Bindings}.
@end deffn
@@ -2755,8 +2820,7 @@ bindkey -k F1 command
@end example
@noindent
Make the F11 (not F1!) key an alternative screen
-escape (besides @samp{C-a}). Note that @samp{F11 F11} does not work in
-the current release of screen.
+escape (besides @samp{C-a}).
@node Bindkey Control, , Bindkey Examples, Key Binding
@section Bindkey Control
@@ -2892,6 +2956,9 @@ and the one simulated by @code{screen}.
* Termcap Syntax:: The @code{termcap} and @code{terminfo} commands.
* Termcap Examples:: Uses for @code{termcap}.
* Special Capabilities:: Non-standard capabilities used by @code{screen}.
+* Autonuke:: Flush unseen output
+* Obuflimit:: Allow pending output when reading more
+* Character Translation:: Emulating fonts and charsets.
@end menu
@node Window Termcap, Dump Termcap, , Termcap
@@ -3005,15 +3072,26 @@ to run a converter like @code{captoinfo} and then compile the entry with
@section The @code{termcap} command
@deffn Command termcap term terminal-tweaks [window-tweaks]
@deffnx Command terminfo term terminal-tweaks [window-tweaks]
+@deffnx Command termcapinfo term terminal-tweaks [window-tweaks]
(none)@*
Use this command to modify your terminal's termcap entry without going
through all the hassles involved in creating a custom termcap entry.
Plus, you can optionally customize the termcap generated for the
-windows. If your system uses the terminfo database rather than
+windows.
+You have to place these commands in one of the screenrc starup files, as
+they are meaningless once the terminal emulator is booted.
+
+If your system uses the terminfo database rather than
termcap, @code{screen} will understand the @code{terminfo} command which
-has the same effects as the @code{termcap} command. Thus users can write
-one .screenrc file that handles both cases, although terminfo syntax is
-slightly different from termcap syntax.
+has the same effects as the @code{termcap} command. Two separate commands are
+provided, as there are subtle syntactic differences, e.g. when parameter
+interpolation (using @samp{%}) is required. Note that the termcap names of
+the capabilities have to be used with the @code{terminfo} command.
+
+In many cases, where the arguments are valid in both terminfo and termcap
+syntax, you can use the command @code{termcapinfo}, which is just a
+shorthand for a pair of @code{termcap} and @code{terminfo} commands with
+identical arguments.
@end deffn
The first argument specifies which terminal(s) should be affected by
@@ -3087,20 +3165,23 @@ should instead set the @code{$SCREENCAP} variable prior to running
@code{screen} terminal emulation. @xref{Top, , Termcap, termcap, The
Termcap Manual}, for more information on termcap definitions.
-@node Special Capabilities, , Termcap Examples, Termcap
+@node Special Capabilities, Autonuke, Termcap Examples, Termcap
@section Special Terminal Capabilities
@cindex terminal capabilities
@cindex capabilities
The following table describes all terminal capabilities that are
recognized by @code{screen} and are not in the termcap manual
(@pxref{Top, , Termcap, termcap, The Termcap Manual}).
-
+You can place these capabilities in your termcap entries (in
+@file{/etc/termcap}) or use them with the commands @code{termcap},
+@code{terminfo} and @code{termcapinfo} in your @code{screenrc} files. It is
+often not possible to place these capabilities in the terminfo database.
@table @samp
@item LP
(bool)@*
Terminal has VT100 style margins (`magic margins'). Note that
-this capability is obsolete --- @code{screen} now uses @samp{xn}
-instead.
+this capability is obsolete --- @code{screen} now uses the standard
+@samp{xn} instead.
@item Z0
(str)@*
@@ -3115,14 +3196,6 @@ Change width to 80 columns.
Resize display. This capability has the desired width and height as
arguments. SunView(tm) example: @samp{\E[8;%d;%dt}.
-@item B8
-(str)@*
-Tell @code{screen} to look out for characters with 8th bit set. If such
-a character is found @code{screen} processes the specified string
-and than outputs the character with the 8th bit stripped off.
-Note that the string can contain any esc-sequences known to
-@code{screen}, too. (Example: Single Shift G2 = \EN.)
-
@item NF
(bool)@*
Terminal doesn't need flow control. Send ^S and ^Q direct to
@@ -3136,7 +3209,7 @@ Terminal can deal with ISO 2022 font selection sequences.
@item S0
(str)@*
Switch charset @samp{G0} to the specified charset. Default
-is @samp{\E(%d}.
+is @samp{\E(%.}.
@item E0
(str)@*
@@ -3156,12 +3229,145 @@ Switch cursor keys to application mode.
(str)@*
Switch cursor keys to cursor mode.
+@item AN
+(bool)@*
+Enable autonuke for displays of this terminal type.
+(@pxref{Autonuke}).
+
+@item OL
+(num)@*
+Set the output buffer limit. See the @samp{obuflimit} command
+(@pxref{Obuflimit}) for more details.
+
@item KJ
(str)@*
Set the kanji type of the terminal. Valid strings are @samp{jis},
@samp{euc} and @samp{sjis}.
+
+@item AF
+(str)@*
+Change character forground color in an ANSI conform way. This
+capability will almost always be set to @samp{\E[3%dm}
+(@samp{\E[3%p1%dm} on terminfo machines).
+
+@item AB
+(str)@*
+Same as @samp{AF}, but change background color.
+
+@item AX
+(bool)@*
+Does understand ANSI set default fg/bg color (@samp{\E[39m / \E[49m}).
+
+@item XC
+(str)@*
+Describe a translation of characters to strings depending on the
+current font. (@pxref{Character Translation}).
@end table
+@node Autonuke, Obuflimit, Special Capabilities, Termcap
+@section Autonuke
+@deffn Command autonuke @var{state}
+(none)@*
+Sets whether a clear screen sequence should nuke all the output
+that has not been written to the terminal. @xref{Obuflimit}.
+This property is set per display, not per window.
+@end deffn
+
+@deffn Command defautonuke @var{state}
+(none)@*
+Same as the @code{autonuke} command except that the default setting for
+new displays is also changed. Initial setting is @code{off}.
+Note that you can use the special @code{AN} terminal capability if you
+want to have a terminal type dependent setting.
+@end deffn
+
+@node Obuflimit, Character Translation, Autonuke, Termcap
+@section Obuflimit
+@deffn Command obuflimit @var{[limit]}
+(none)@*
+If the output buffer contains more bytes than the specified limit, no
+more data will be read from the windows. The default value is 256. If
+you have a fast display (like @code{xterm}), you can set it to some
+higher value. If no argument is specified, the current setting is displayed.
+This property is set per display, not per window.
+@end deffn
+
+@deffn Command defobuflimit @var{limit}
+(none)@*
+Same as the @code{obuflimit} command except that the default setting for new
+displays is also changed. Initial setting is 256 bytes. Note that you can use
+the special @code{OL} terminal capability if you want to have a terminal
+type dependent limit.
+@end deffn
+
+@node Character Translation, , Obuflimit, Termcap
+@section Character Translation
+@code{Screen} has a powerful mechanism to translate characters to
+arbitrary strings depending on the current font and terminal type.
+Use this feature if you want to work with a common standard character
+set (say ISO8851-latin1) even on terminals that scatter the more
+unusual characters over several national language font pages.
+
+Syntax:
+
+@example
+ XC=@var{<charset-mapping>}@{,,@var{<charset-mapping>}@}
+ @var{<charset-mapping>} := @var{<designator>}@var{<template>}@{,@var{<mapping>}@}
+ @var{<mapping>} := @var{<char-to-be-mapped>}@var{<template-arg>}
+@end example
+
+The things in braces may be repeated any number of times.
+
+A @var{<charset-mapping>} tells screen how to map characters
+in font @var{<designator>} (@samp{B}: Ascii, @samp{A}: UK,
+@samp{K}: german, etc.)
+to strings. Every @var{<mapping>} describes to what string a single
+character will be translated. A template mechanism is used, as
+most of the time the codes have a lot in common (for example
+strings to switch to and from another charset). Each occurence
+of @samp{%} in @var{<template>} gets substituted with the
+@var{template-arg}
+specified together with the character. If your strings are not
+similar at all, then use @samp{%} as a template and place the full
+string in @var{<template-arg>}. A quoting mechanism was added to make
+it possible to use a real @samp{%}. The @samp{\} character quotes the
+special characters @samp{\}, @samp{%}, and @samp{,}.
+
+Here is an example:
+
+@example
+ termcap hp700 'XC=B\E(K%\E(B,\304[,\326\\\\,\334]'
+@end example
+
+This tells @code{screen}, how to translate ISOlatin1 (charset @samp{B})
+upper case umlaut characters on a @code{hp700} terminal that has a
+german charset. @samp{\304} gets translated to
+@samp{\E(K[\E(B} and so on.
+Note that this line gets parsed *three* times before the internal
+lookup table is built, therefore a lot of quoting is needed to
+create a single @samp{\}.
+
+Another extension was added to allow more emulation: If a mapping
+translates the unquoted @samp{%} char, it will be sent to the terminal
+whenever screen switches to the corresponding @var{<designator>}.
+In this
+special case the template is assumed to be just @samp{%} because
+the charset switch sequence and the character mappings normaly
+haven't much in common.
+
+This example shows one use of the extension:
+@example
+ termcap xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334'
+@end example
+
+Here, a part of the german (@samp{K}) charset is emulated on an xterm.
+If screen has to change to the @samp{K} charset, @samp{\E(B} will be
+sent
+to the terminal, i.e. the ASCII charset is used instead. The
+template is just @samp{%}, so the mapping is straightforward:
+@samp{[} to @samp{\304}, @samp{\} to @samp{\326}, and @samp{]} to
+@samp{\334}.
+
@node Message Line, Logging, Termcap, Top
@chapter The Message Line
@cindex message line
@@ -3273,19 +3479,20 @@ directory.
@kindex H
@deffn Command log [state]
(@kbd{C-a H})@*
-Begins/ends logging of the current window to the file
+Begins/ends logging of the current window to the file
@file{screenlog.@var{n}} in the window's default directory, where
-@var{n} is the number of the current window. If no parameter is given,
+@var{n} is the number of the current window.
+This filename can be changed with the @samp{logfile} command.
+If no parameter is given,
the logging state is toggled. The session log is
appended to the previous contents of the file if it already exists. The
current contents and the contents of the scrollback history are not
included in the session log. Default is @samp{off}.
@end deffn
-@deffn Command logdir directory
+@deffn Command logfile filename
(none)@*
-Defines a directory where logfiles will be placed. If unset logfiles
-are written in @code{screen}s current working directory.
+Defines the name the logfiles will get. The default is @samp{screenlog.%n}.
@end deffn
@node Startup, Miscellaneous, Logging, Top
@@ -3346,6 +3553,7 @@ categories.
* Version:: Display the version of @code{screen}.
* Zombie:: Keep dead windows.
* Printcmd:: Set command for VT100 printer port emulation.
+* Sorendition:: Change the text highlighting method.
@end menu
@node At, Break, , Miscellaneous
@@ -3458,9 +3666,8 @@ system). For window-specific information use @code{info} (@pxref{Info}).
@node Version, Zombie, Time, Miscellaneous
@section Version
@kindex v
-@kindex C-v
@deffn Command version
-(@kbd{C-a v}, @kbd{C-a C-v})@*
+(@kbd{C-a v})@*
Display the version and modification date in the message line.
@end deffn
@@ -3484,7 +3691,7 @@ should only be called @code{defzombie}. Until we need this as a per window
setting, the commands @code{zombie} and @code{defzombie} are synonymous.
@end deffn
-@node Printcmd, , Zombie, Miscellaneous
+@node Printcmd, Sorendition, Zombie, Miscellaneous
@section Printcmd
@deffn Command printcmd @var{[cmd]}
(none)@*
@@ -3500,6 +3707,21 @@ Warning: Be careful with this command! If other user have write
access to your terminal, they will be able to fire off print commands.
@end deffn
+@node Sorendition, , Printcmd, Miscellaneous
+@section Sorendition
+@deffn Command sorendition @var{[attr [color]]}
+(none)@*
+Change the way screen does highlighting for text marking and printing
+messages.
+@var{attr} is a hexadecimal number and describes the attributes
+(inverse, underline, ...) the text will get. @var{color}
+is a 2 digit number and changes the
+forground/background of the highlighted text.
+Some knowledge of screen's internal character representation is
+needed to make the characters appear in the desired way. The default
+is currently @samp{10 99} (standout, default colors).
+@end deffn
+
@node Environment, Files, Miscellaneous, Top
@chapter Environment Variables
@cindex environment
@@ -3687,10 +3909,6 @@ are ignored). @samp{xn} is treated as a magic-margin indicator.
But this is the only area where @code{vttest} is allowed to fail.
@item
-@code{screen} does not support color, although this has repeatedly
-been asked for.
-
-@item
It is not possible to change the environment variable @code{$TERMCAP}
when reattaching under a different terminal type.
@@ -3841,4 +4059,3 @@ from the key sequences, since it is the same for all bindings.
@contents
@bye
-
diff --git a/src/etc/etcscreenrc b/src/etc/etcscreenrc
index 433599e..301d6b9 100644
--- a/src/etc/etcscreenrc
+++ b/src/etc/etcscreenrc
@@ -10,14 +10,11 @@
#startup_message off
-#defflow on # will force iScreen to process ^S/^Q
+#defflow on # will force screen to process ^S/^Q
deflogin on
#autodetach off
-# 'vbell on' without the prepended 'set' keyword will change the default for
-# subsequently opened windows. With the 'set' keyword we would change
-# the setting of the currently active window.
vbell on
vbell_msg " Wuff ---- Wuff!! "
@@ -28,7 +25,7 @@ vbell_msg " Wuff ---- Wuff!! "
# G0 we have a SEMI-GRAPHICS-CHARACTER-MODE
# WS this sequence resizes our window.
# cs this sequence changes the scrollregion
-# hs@ we have no hardware statusline. iScreen will only believe that
+# hs@ we have no hardware statusline. screen will only believe that
# there is a hardware status line if hs,ts,fs,ds are all set.
# ts to statusline
# fs from statusline
@@ -39,7 +36,7 @@ vbell_msg " Wuff ---- Wuff!! "
# DL delete multiple lines
# ic insert one char (space)
# IC insert multiple chars
-# xo terminal uses xon/xoff
+# nx terminal uses xon/xoff
termcap facit|vt100|xterm LP:G0
terminfo facit|vt100|xterm LP:G0
@@ -73,28 +70,18 @@ terminfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'
#
# Do not use xterms alternate window buffer.
# This one would not add lines to the scrollback buffer.
-termcap xterm|xterms|xs ti=\E7\E[?47l
-terminfo xterm|xterms|xs ti=\E7\E[?47l
-
-# xs is xterm's two letter name.
-# story ... in earlier versions I used xterms here ... buggy sequent termcap
-# routines allowes 32 :tc=...: references per lifetime.... gave lots of OOPS
-# at the 32. reattach. ... to avoid that, I added the name Xterm as an alias
-# to xterm in our termcap file.
-# why I don't take the entry called xterm? well, I own a verion of xterm that
-# allows window resizing. My private .iscreenrc adds WS to this entry.
-
-termcap xs 'hs:ts=\E]0;:fs=\007:ds=\E]0;Screen\007:cs=\E[%i%d;%dr:LP:G0:im=\E[4h:ei=\E[4l'
-terminfo xs 'hs:ts=\E]0;:fs=\007:ds=\E]0;Screen\007:cs=\E[%i%p1%d;%p2%dr:LP:G0:im=\E[4h:ei=\E[4l'
+#termcap xterm|xterms|xs ti=\E7\E[?47l
+#terminfo xterm|xterms|xs ti=\E7\E[?47l
#make hp700 termcap/info better
termcap hp700 'Z0=\E[?3h:Z1=\E[?3l:hs:ts=\E[62"p\E[0$~\E[2$~\E[1$}:fs=\E[0}\E[61"p:ds=\E[62"p\E[1$~\E[61"p:ic@'
terminfo hp700 'Z0=\E[?3h:Z1=\E[?3l:hs:ts=\E[62"p\E[0$~\E[2$~\E[1$}:fs=\E[0}\E[61"p:ds=\E[62"p\E[1$~\E[61"p:ic@'
#wyse-75-42 must have defflow control (xo = "terminal uses xon/xoff")
+#(nowadays: nx = padding doesn't work, have to use xon/off)
#essential to have it here, as this is a slow terminal.
-termcap wy75-42 xo:Z0=\E[?3h\E[31h:Z1=\E[?3l\E[31h
-terminfo wy75-42 xo:Z0=\E[?3h\E[31h:Z1=\E[?3l\E[31h
+termcap wy75-42 nx:xo:Z0=\E[?3h\E[31h:Z1=\E[?3l\E[31h
+terminfo wy75-42 nx:xo:Z0=\E[?3h\E[31h:Z1=\E[?3l\E[31h
#remove some stupid / dangerous key bindings
bind '^k'
diff --git a/src/etc/screenrc b/src/etc/screenrc
index f0eefbc..d2a8d86 100644
--- a/src/etc/screenrc
+++ b/src/etc/screenrc
@@ -1,7 +1,17 @@
+#
+# Example of a user's .screenrc file
+#
+
+# This is how one can set a reattach password:
#password ODSJQf.4IJN7E # "1234"
+# no annoying audible bell, please
vbell on
+
+# detach on hangup
autodetach on
+
+# don't display the copyright page
startup_message off
# Extend the vt100 desciption with some sequences.
@@ -14,7 +24,7 @@ terminfo vt100* ms:AL=\E[%p1%dL:DL=\E[%p1%dM:UP=\E[%p1%dA:DO=\E[%p1%dB:LE=\E[%p1
termcap xterm hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l
terminfo xterm hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l
-#80/132 column switching must be enabled for Z0/Z1 to work
+#80/132 column switching must be enabled for ^AW to work
#change init sequence to not switch width
termcap xterm Z0=\E[?3h:Z1=\E[?3l:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l
terminfo xterm Z0=\E[?3h:Z1=\E[?3l:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l
@@ -60,16 +70,16 @@ register [ "\033:se noai\015a"
register ] "\033:se ai\015a"
bind ^] paste [.]
-terminfo xterm 'VR=\E[?5h:VN=\E[?5l:k1=\E[11~:k2=\E[12~:k3=\E[13~'
-termcap xterm 'VR=\E[?5h:VN=\E[?5l:k1=\E[11~:k2=\E[12~:k3=\E[13~'
+# tell screen that xterm can switch to dark background and has function
+# keys.
+terminfo xterm 'VR=\E[?5h:VN=\E[?5l:k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~'
+termcap xterm 'VR=\E[?5h:VN=\E[?5l:k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~'
termcap xterm 'kh=\E[1~:kI=\E[2~:kD=\E[3~:kH=\E[4~:kP=\E[5~:kN=\E[6~'
terminfo xterm 'kh=\E[1~:kI=\E[2~:kD=\E[3~:kH=\E[4~:kP=\E[5~:kN=\E[6~'
-# xterm hardstatus: use the window title.
-termcap xterm 'hs:ts=\E]0;:fs=\007:ds=\E]0;Screen\007'
-terminfo xterm 'hs:ts=\E]0;:fs=\007:ds=\E]0;Screen\007'
-
-termcap con80x* "xn:f0=\033Op:f1=\033Oq:f2=\033Or:f3=\033Os:f4=\033Ot:f5=\033Ou:f6=\033Ov:f7=\033Ow:f8=\033Ox:f9=\033Oy:f.=\033On:f,=\033Ol:fe=\033OM:f+=\033Ok:f-=\033Om:f*=\033Oj:f/=\033Oo:fq=\033OX:kN=\033[6~:kP=\033[5~"
+# special xterm hardstatus: use the window title.
+termcap xterm 'hs:ts=\E]2;:fs=\007:ds=\E]0;Screen\007'
+terminfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]0;Screen\007'
# advertise hardstatus support to $TERMCAP
termcap * '' 'hs:ts=\E_:fs=\E\\:ds=\E_\E\\'
@@ -77,3 +87,27 @@ terminfo * '' 'hs:ts=\E_:fs=\E\\:ds=\E_\E\\'
# make the shell in every window a login shell
#shell -$SHELL
+
+# shellaka '> |tcsh'
+# shellaka '$ |sh'
+
+terminfo wy75-42 'G0:S0=\E(K:E0=\E(B:C0=\104\133\126\134\134\135\144\173\166\174\174\175\137\176'
+
+terminfo wy75-42 'hs@'
+
+# our xterm has colors! (rxvt, too)
+termcap xterm 'AF=\E[3%dm:AB=\E[4%dm'
+terminfo xterm 'AF=\E[3%p1%dm:AB=\E[4%p1%dm'
+
+# set every new windows hardstatus line to somenthing descriptive
+defhstatus "Screen: window \5 (\5t)"
+
+defscrollback 100
+
+#terminfo xterm 'vb=\E[?5h$<200/>\E[?5l'
+#termcap xterm 'vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l'
+
+# emulate part of the 'K' charset
+termcap xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334,{\344,|\366,}\374,~\337'
+terminfo xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334,{\344,|\366,}\374,~\337'
+
diff --git a/src/etc/toolcheck b/src/etc/toolcheck
new file mode 100755
index 0000000..7aed171
--- /dev/null
+++ b/src/etc/toolcheck
@@ -0,0 +1,38 @@
+#!/bin/sh
+# toolcheck -- check for tools that have severe bugs. Good that all the buggy
+# tools identify by version numbers. This is the spirit of GNU :-)
+#
+# 24.7.95 jw.
+
+retval=0
+reply="`sh -version 2>&1 < /dev/null`"
+case "$reply" in
+ GNU*1.14.3*)
+ echo "- sh is '$reply'";
+ echo " CAUTION: This shell has a buggy 'trap' command.";
+ echo " The configure script may fail silently.";
+ retval=1;
+ ;;
+ GNU*1.14.2*|GNU*1.14.4*|GNU*1.13.*)
+ echo "- sh is '$reply' - good.";
+ ;;
+ GNU*) echo "- sh is '$reply' - (buggy again shell?).";
+ ;;
+ *) ;;
+esac
+
+reply="`sed --version 2>&1 < /dev/null`"
+case "$reply" in
+ GNU\ sed\ version\ 2.0[34])
+ echo "- sed is '$reply'";
+ echo " CAUTION: This sed cannot configure screen properly."
+ retval=1;
+ ;;
+ GNU\ sed\ version\ 2.05|GNU\ sed\ version\ 2.03\ kevin)
+ echo "- sed is '$reply' - good.";
+ ;;
+ GNU*) echo "- sed is '$reply'.";
+ ;;
+ *) ;;
+esac
+exit $retval
diff --git a/src/extern.h b/src/extern.h
index c439188..f216b20 100644
--- a/src/extern.h
+++ b/src/extern.h
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
* $Id$ FAU
@@ -46,6 +47,7 @@ extern void Panic __P(());
extern void DisplaySleep __P((int));
extern void Finit __P((int));
extern void MakeNewEnv __P((void));
+extern char *MakeWinMsg __P((char *, struct win *, int));
/* ansi.c */
extern void Activate __P((int));
@@ -54,11 +56,9 @@ extern void ResetCharsets __P((struct win *));
extern void WriteString __P((struct win *, char *, int));
extern void NewAutoFlow __P((struct win *, int));
extern void Redisplay __P((int));
-extern void CheckLP __P((int));
-extern void MakeBlankLine __P((char *, int));
extern void SetCurr __P((struct win *));
extern void ChangeAKA __P((struct win *, char *, int));
-extern void AddLineToHist __P((struct win *, char **, char **, char **));
+extern void SetCharsets __P((struct win *, char *));
/* fileio.c */
extern void StartRc __P((char *));
@@ -146,6 +146,9 @@ extern int OpenPTY __P((char **));
/* process.c */
extern void InitKeytab __P((void));
extern void ProcessInput __P((char *, int));
+#ifdef MAPKEYS
+extern void ProcessInput2 __P((char *, int));
+#endif
extern int FindCommnr __P((char *));
extern void DoCommand __P((char **));
extern void KillWindow __P((struct win *));
@@ -167,7 +170,10 @@ extern char *MakeTermcap __P((int));
extern char *gettermcapstring __P((char *));
#ifdef MAPKEYS
extern int remap __P((int, int));
+extern void CheckEscape __P((void));
#endif
+extern int CreateTransTable __P((char *));
+extern void FreeTransTable __P((void));
/* attacher.c */
extern int Attach __P((int));
@@ -196,21 +202,25 @@ extern void ClearDisplay __P((void));
extern void Clear __P((int, int, int, int, int, int, int));
extern void RefreshLine __P((int, int, int, int));
extern void RefreshStatus __P((void));
-extern void DisplayLine __P((char *, char *, char *, char *, char *, char *, int, int, int));
+extern void DisplayLine __P((struct mline *, struct mline *, int, int, int));
+
+extern void CDisplayLine __P((struct mline *, int, int, int, int, int));
extern void FixLP __P((int, int));
extern void GotoPos __P((int, int));
extern int CalcCost __P((char *));
-extern void ScrollH __P((int, int, int, int, char *, char *, char *));
+extern void ScrollH __P((int, int, int, int, struct mline *));
extern void ScrollV __P((int, int, int, int, int));
extern void ChangeScrollRegion __P((int, int));
extern void InsertMode __P((int));
extern void KeypadMode __P((int));
extern void CursorkeysMode __P((int));
extern void ReverseVideo __P((int));
-extern void CursorInvisible __P((int));
+extern void CursorVisibility __P((int));
extern void SetFont __P((int));
extern void SetAttr __P((int));
-extern void SetAttrFont __P((int, int));
+extern void SetColor __P((int));
+extern void SetRendition __P((struct mchar *));
+extern void SetRenditionMline __P((struct mline *, int));
extern void MakeStatus __P((char *));
extern void RemoveStatus __P((void));
extern void SetLastPos __P((int, int));
@@ -230,8 +240,7 @@ extern int badkanji __P((char *, int));
#endif
/* resize.c */
-extern int ChangeScrollback __P((struct win *, int, int));
-extern int ChangeWindowSize __P((struct win *, int, int));
+extern int ChangeWindowSize __P((struct win *, int, int, int));
extern void ChangeScreenSize __P((int, int, int));
extern void CheckScreenSize __P((int));
extern void DoResize __P((int, int));
diff --git a/src/fileio.c b/src/fileio.c
index 9f16be3..b320b94 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -68,7 +69,7 @@ register char *str1, *str2;
len1 = strlen(str1);
if (len1 == 0)
- return(str2);
+ return str2;
add_colon = (str1[len1 - 1] != ':');
if (str2)
{
@@ -206,9 +207,9 @@ char *rcfilename;
DisplaySleep(atoi(args[1]));
}
#ifdef TERMINFO
- else if (strcmp(args[0], "terminfo") == 0)
+ else if (!strcmp(args[0], "termcapinfo") || !strcmp(args[0], "terminfo"))
#else
- else if (strcmp(args[0], "termcap") == 0)
+ else if (!strcmp(args[0], "termcapinfo") || !strcmp(args[0], "termcap"))
#endif
{
if (!display)
@@ -272,9 +273,7 @@ char *rcfilename;
debug("finishrc is going...\n");
while (fgets(buf, sizeof buf, fp) != NULL)
- {
- RcLine(buf);
- }
+ RcLine(buf);
(void) fclose(fp);
Free(rc_name);
rc_name = "";
@@ -293,6 +292,7 @@ char *rcfilename;
* "$:terminfoname:" -> "termcapvalue"
*
* "\101" -> "A"
+ * "^a" -> "\001"
*/
char *
expand_vars(ss)
@@ -304,6 +304,7 @@ char *ss;
register char *s = ss;
register char *v;
char xbuf[11];
+ int i;
while (*s && *s != '\0' && *s != '\n' && esize > 0)
{
@@ -364,6 +365,17 @@ char *ss;
p++;
s = p;
}
+ else if (*s == '^' && !quofl)
+ {
+ s++;
+ i = *s++;
+ if (i == '?')
+ i = '\177';
+ else
+ i &= 0x1f;
+ *e++ = i;
+ esize--;
+ }
else
{
/*
@@ -374,8 +386,6 @@ char *ss;
{
if (s[1] >= '0' && s[1] <= '7')
{
- int i;
-
s++;
i = *s - '0';
s++;
@@ -399,7 +409,9 @@ char *ss;
if (s[1] == '$' ||
(s[1] == '\\' && s[2] == '$') ||
s[1] == '\'' ||
- (s[1] == '\\' && s[2] == '\''))
+ (s[1] == '\\' && s[2] == '\'') ||
+ s[1] == '^' ||
+ (s[1] == '\\' && s[2] == '^'))
s++;
}
}
@@ -488,7 +500,7 @@ int dump;
}
for (i = 0; i < D_height; i++)
{
- p = fore->w_image[i];
+ p = fore->w_mlines[i].image;
for (k = D_width - 1; k >= 0 && p[k] == ' '; k--)
;
for (j = 0; j <= k; j++)
@@ -607,13 +619,10 @@ int *lenp;
void
KillBuffers()
{
- char fn[1024];
- sprintf(fn, "%s", BufferFile);
-
if (UserContext() > 0)
- UserReturn(unlink(SockPath) ? errno : 0);
+ UserReturn(unlink(BufferFile) ? errno : 0);
errno = UserStatus();
- Msg(errno, "%s %sremoved", fn, errno ? "not " : "");
+ Msg(errno, "%s %sremoved", BufferFile, errno ? "not " : "");
}
#endif /* COPY_PASTE */
@@ -642,7 +651,7 @@ char *mode;
return fi;
#else
if (eff_uid == real_uid)
- return(fopen(name, mode));
+ return fopen(name, mode);
if (mode[0] && mode[1] == '+')
flags = O_RDWR;
else
@@ -654,16 +663,16 @@ char *mode;
else if (mode[0] != 'r')
{
errno = EINVAL;
- return(0);
+ return 0;
}
if ((fd = secopen(name, flags, 0666)) < 0)
- return(0);
+ return 0;
if ((fi = fdopen(fd, mode)) == 0)
{
close(fd);
- return(0);
+ return 0;
}
- return(fi);
+ return fi;
#endif
}
@@ -690,7 +699,7 @@ int mode;
return fd;
#else
if (eff_uid == real_uid)
- return(open(name, flags, mode));
+ return open(name, flags, mode);
/* Truncation/creation is done in UserContext */
if ((flags & O_TRUNC) || ((flags & O_CREAT) && access(name, F_OK)))
{
@@ -709,18 +718,18 @@ int mode;
{
if (q > 0)
errno = q;
- return(-1);
+ return -1;
}
}
if (access(name, F_OK))
- return(-1);
+ return -1;
if ((fd = open(name, flags & ~(O_TRUNC | O_CREAT), 0)) < 0)
- return(-1);
+ return -1;
debug("open successful\n");
if (fstat(fd, &stb))
{
close(fd);
- return(-1);
+ return -1;
}
debug("fstat successful\n");
if (stb.st_uid != real_uid)
@@ -742,10 +751,10 @@ int mode;
debug1("secopen: permission denied (%03o)\n", stb.st_mode & 07777);
close(fd);
errno = EACCES;
- return(-1);
+ return -1;
}
}
debug1("secopen ok - returning %d\n", fd);
- return(fd);
+ return fd;
#endif
}
diff --git a/src/help.c b/src/help.c
index 3328cae..168038f 100644
--- a/src/help.c
+++ b/src/help.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -34,6 +35,7 @@ char version[40]; /* initialised by main() */
extern struct display *display;
extern char *noargs[];
+extern struct mchar mchar_null;
void
@@ -250,14 +252,12 @@ helppage()
helpdata = (struct helpdata *)D_lay->l_data;
if (helpdata->grow >= helpdata->maxrow)
- {
- return(-1);
- }
+ return -1;
helpdata->refgrow = helpdata->grow;
helpdata->refcommand_search = helpdata->command_search;
/* Clear the help screen */
- SetAttrFont(0, ASCII);
+ SetRendition(&mchar_null);
ClearDisplay();
sprintf(cbuf,"Screen key bindings, page %d of %d.", helpdata->grow / (D_height-5) + 1, helpdata->numpages);
@@ -325,7 +325,7 @@ helppage()
helpdata->grow < helpdata->maxrow ? "for next page;" : "or");
centerline(cbuf);
SetLastPos(0, D_height-1);
- return(0);
+ return 0;
}
static int
@@ -388,7 +388,9 @@ int key;
{
debug1("help: key found: %c\n", key);
buf += strlen(buf);
- if (key == ' ')
+ if (key < 0)
+ sprintf(buf, "unset");
+ else if (key == ' ')
sprintf(buf, "sp");
else buf[AddXChar(buf, key)] = 0;
}
@@ -465,7 +467,8 @@ GNU General Public License for more details.\n\
\n\
You should have received a copy of the GNU General Public License \
along with this program (see the file COPYING); if not, write to the \
-Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\
+Free Software Foundation, Inc., \
+59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n\
\n\
Send bugreports, fixes, enhancements, t-shirts, money, beer & pizza to \
screen@uni-erlangen.de\n";
@@ -546,7 +549,7 @@ copypage()
struct copydata *copydata;
copydata = (struct copydata *)D_lay->l_data;
- SetAttrFont(0, ASCII);
+ SetRendition(&mchar_null);
ClearDisplay();
x = y = 0;
cps = copydata->cps;
@@ -738,7 +741,7 @@ bindkeypage()
bindkeydata = (struct bindkeydata *)D_lay->l_data;
- SetAttrFont(0, ASCII);
+ SetRendition(&mchar_null);
ClearDisplay();
sprintf(tbuf, "%s key bindings, page %d of %d.", bindkeydata->title, bindkeydata->page, bindkeydata->pages);
diff --git a/src/image.h b/src/image.h
new file mode 100644
index 0000000..9a658a3
--- /dev/null
+++ b/src/image.h
@@ -0,0 +1,106 @@
+/* Copyright (c) 1993
+ * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
+ * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
+ * Copyright (c) 1987 Oliver Laumann
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program (see the file COPYING); if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *
+ ****************************************************************
+ * $Id$ FAU
+ */
+
+
+#undef IFCOLOR
+
+#ifdef COLOR
+# define IFCOLOR(x) x
+#else
+# define IFCOLOR(x)
+#endif
+
+
+struct mchar {
+ char image;
+ char attr;
+ char font;
+IFCOLOR(char color;)
+};
+
+struct mline {
+ char *image;
+ char *attr;
+ char *font;
+IFCOLOR(char *color;)
+};
+
+
+
+#define save_mline(ml, n) do { \
+ bcopy((ml)->image, mline_old.image, (n)); \
+ bcopy((ml)->attr, mline_old.attr, (n)); \
+ bcopy((ml)->font, mline_old.font, (n)); \
+IFCOLOR(bcopy((ml)->color, mline_old.color, (n)); )\
+} while (0)
+
+#define bcopy_mline(ml, xf, xt, n) do { \
+ bcopy((ml)->image + (xf), (ml)->image + (xt), (n)); \
+ bcopy((ml)->attr + (xf), (ml)->attr + (xt), (n)); \
+ bcopy((ml)->font + (xf), (ml)->font + (xt), (n)); \
+IFCOLOR(bcopy((ml)->color + (xf), (ml)->color + (xt), (n)); )\
+} while (0)
+
+#define clear_mline(ml, x, n) do { \
+ bclear((ml)->image + (x), (n)); \
+ if ((ml)->attr != null) bzero((ml)->attr + (x), (n)); \
+ if ((ml)->font != null) bzero((ml)->font + (x), (n)); \
+IFCOLOR(if ((ml)->color!= null) bzero((ml)->color + (x), (n)); )\
+} while (0)
+
+#define cmp_mline(ml1, ml2, x) ( \
+ (ml1)->image[x] == (ml2)->image[x] \
+ && (ml1)->attr[x] == (ml2)->attr[x] \
+ && (ml1)->font[x] == (ml2)->font[x] \
+IFCOLOR(&& (ml1)->color[x] == (ml2)->color[x] )\
+)
+
+#define cmp_mchar(mc1, mc2) ( \
+ (mc1)->image == (mc2)->image \
+ && (mc1)->attr == (mc2)->attr \
+ && (mc1)->font == (mc2)->font \
+IFCOLOR(&& (mc1)->color == (mc2)->color )\
+)
+
+#define cmp_mchar_mline(mc, ml, x) ( \
+ (mc)->image == (ml)->image[x] \
+ && (mc)->attr == (ml)->attr[x] \
+ && (mc)->font == (ml)->font[x] \
+IFCOLOR(&& (mc)->color == (ml)->color[x] )\
+)
+
+#define copy_mchar2mline(mc, ml, x) do { \
+ (ml)->image[x] = (mc)->image; \
+ (ml)->attr[x] = (mc)->attr; \
+ (ml)->font[x] = (mc)->font; \
+IFCOLOR((ml)->color[x] = (mc)->color; )\
+} while (0)
+
+#define copy_mline2mchar(mc, ml, x) do { \
+ (mc)->image = (ml)->image[x]; \
+ (mc)->attr = (ml)->attr[x]; \
+ (mc)->font = (ml)->font[x]; \
+IFCOLOR((mc)->color = (ml)->color[x]; )\
+} while (0)
+
diff --git a/src/input.c b/src/input.c
index c5dab8c..70c2500 100644
--- a/src/input.c
+++ b/src/input.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -34,6 +35,7 @@ static void InpRedisplayLine __P((int, int, int, int));
static void InpSetCursor __P((void));
extern struct display *display;
+extern struct mchar mchar_blank, mchar_so;
struct inpdata
{
@@ -166,7 +168,14 @@ int *plen;
{
ch = *pbuf++;
len--;
- if (inpdata->inpmode & INP_RAW)
+ if (inpdata->inpmode & INP_EVERY)
+ {
+ inpdata->inpbuf[inpdata->inplen] = ch;
+ inpdata->inpbuf[inpdata->inplen + 1] = ch; /* gross */
+ (*inpdata->inpfinfunc)(inpdata->inpbuf, inpdata->inplen);
+ ch = inpdata->inpbuf[inpdata->inplen];
+ }
+ else if (inpdata->inpmode & INP_RAW)
{
(*inpdata->inpfinfunc)(&ch, 1); /* raw */
if (ch)
@@ -178,7 +187,7 @@ int *plen;
if (!(inpdata->inpmode & INP_NOECHO))
{
GotoPos(x, STATLINE);
- SetAttrFont(A_SO, ASCII);
+ SetRendition(&mchar_so);
PUTCHAR(ch);
x++;
}
@@ -190,7 +199,7 @@ int *plen;
{
x--;
GotoPos(x, STATLINE);
- SetAttrFont(0, ASCII);
+ SetRendition(&mchar_blank);
PUTCHAR(' ');
GotoPos(x, STATLINE);
}
@@ -247,7 +256,7 @@ int y, xs, xe, isblank;
r = inpdata->inpstringlen;
if (v > 0 && q < r)
{
- SetAttrFont(A_SO, ASCII);
+ SetRendition(&mchar_so);
l = v;
if (l > r-q)
l = r-q;
@@ -259,7 +268,7 @@ int y, xs, xe, isblank;
r += inpdata->inplen;
if (!(inpdata->inpmode & INP_NOECHO) && v > 0 && q < r)
{
- SetAttrFont(A_SO, ASCII);
+ SetRendition(&mchar_so);
l = v;
if (l > r-q)
l = r-q;
@@ -271,7 +280,7 @@ int y, xs, xe, isblank;
r = D_width;
if (!isblank && v > 0 && q < r)
{
- SetAttrFont(0, ASCII);
+ SetRendition(&mchar_blank);
l = v;
if (l > r-q)
l = r-q;
diff --git a/src/loadav.c b/src/loadav.c
index 6b29f0f..3af86f4 100644
--- a/src/loadav.c
+++ b/src/loadav.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -27,7 +28,17 @@ RCS_ID("$Id$ FAU")
#include <fcntl.h>
#ifdef ultrix
# include <sys/fixpoint.h>
-#endif /* ultrix */
+#endif
+
+/* mach stuff included here to prevent index macro conflict */
+#ifdef NeXT
+# include <sys/version.h>
+# if KERNEL_MAJOR_VERSION > 2
+# include <mach/mach.h>
+# else
+# include <mach.h>
+# endif
+#endif
#include "config.h"
#include "screen.h"
@@ -114,8 +125,6 @@ GetLoadav()
#if defined(NeXT) && !defined(LOADAV_DONE)
#define LOADAV_DONE
-#include <mach/mach.h>
-
static processor_set_t default_set;
void
@@ -172,6 +181,10 @@ extern int nlist __P((char *, struct nlist *));
static struct nlist nl[2];
static int kmemf;
+#ifdef _IBMR2
+# define nlist(u,l) knlist(l,1,sizeof(*l))
+#endif
+
void
InitLoadav()
{
@@ -189,11 +202,7 @@ InitLoadav()
# endif
debug2("Searching in %s for %s\n", LOADAV_UNIX, nl[0].n_name);
nlist(LOADAV_UNIX, nl);
-# ifndef _IBMR2
if (nl[0].n_value == 0)
-# else
- if (nl[0].n_value == 0 || lseek(kmemf, (off_t) nl[0].n_value, 0) == (off_t)-1 || read(kmemf, (char *)&nl[0].n_value, sizeof(nl[0].n_value)) != sizeof(nl[0].n_value))
-# endif
{
close(kmemf);
return;
diff --git a/src/mark.c b/src/mark.c
index b3ea3b8..76f56b2 100644
--- a/src/mark.c
+++ b/src/mark.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -50,6 +51,8 @@ static void MarkSetCursor __P((void));
extern struct win *fore;
extern struct display *display;
extern char *null, *blank;
+extern struct mline mline_blank, mline_null;
+extern struct mchar mchar_so;
#ifdef NETHACK
extern nethackflag;
@@ -104,12 +107,12 @@ int y;
register int x;
register char *i;
- for (x = markdata->left_mar, i = iWIN(y) + x; x < D_width - 1; x++)
+ for (x = markdata->left_mar, i = WIN(y)->image + x; x < D_width - 1; x++)
if (*i++ != ' ')
break;
if (x == D_width - 1)
x = markdata->left_mar;
- return(x);
+ return x;
}
static int
@@ -119,12 +122,12 @@ int y;
register int x;
register char *i;
- for (x = markdata->right_mar, i = iWIN(y) + x; x >= 0; x--)
+ for (x = markdata->right_mar, i = WIN(y)->image + x; x >= 0; x--)
if (*i-- != ' ')
break;
if (x < 0)
x = markdata->left_mar;
- return(x);
+ return x;
}
@@ -146,18 +149,20 @@ int *xp, *yp, flags, num;
{
int xx = D_width, yy = fore->w_histheight + D_height;
register int sx, oq, q, x, y;
+ struct mline *ml;
x = *xp;
y = *yp;
sx = (flags & NW_BACK) ? -1 : 1;
if ((flags & NW_ENDOFWORD) && (flags & NW_MUSTMOVE))
x += sx;
+ ml = WIN(y);
for (oq = -1; ; x += sx, oq = q)
{
if (x >= xx || x < 0)
q = 0;
else
- q = is_letter(iWIN(y)[x]);
+ q = is_letter(ml->image[x]);
if (oq >= 0 && oq != q)
{
if (oq == 0 || !(flags & NW_ENDOFWORD))
@@ -177,12 +182,14 @@ int *xp, *yp, flags, num;
x = -1;
if (++y >= yy)
return;
+ ml = WIN(y);
}
else if (x < 0)
{
x = xx;
if (--y < 0)
return;
+ ml = WIN(y);
}
}
}
@@ -204,6 +211,7 @@ char *pt;
int i, j, from, to, ry, c, cf, font;
int l = 0;
char *im, *fo;
+ struct mline *ml;
markdata->second = 0;
if (y2 < y1 || ((y2 == y1) && (x2 < x1)))
@@ -227,10 +235,11 @@ char *pt;
{
if (redisplay != 2 && pt == 0 && ry > yend)
break;
+ ml = WIN(i);
from = (i == y1) ? x1 : 0;
if (from < markdata->left_mar)
from = markdata->left_mar;
- for (to = D_width, im = iWIN(i) + to; to >= 0; to--)
+ for (to = D_width, im = ml->image + to; to >= 0; to--)
if (*im-- != ' ')
break;
if (i == y2 && x2 < to)
@@ -243,11 +252,11 @@ char *pt;
continue;
j = from;
#ifdef KANJI
- if (badkanji(fWIN(i), j))
+ if (badkanji(ml->font, j))
j--;
#endif
font = ASCII;
- for (im = iWIN(i)+j, fo = fWIN(i)+j; j <= to; j++)
+ for (im = ml->image + j, fo = ml->font + j; j <= to; j++)
{
cf = *fo++;
c = *im++;
@@ -342,7 +351,7 @@ char *pt;
}
l += 3;
}
- if (i != y2 && (to != D_width - 1 || iWIN(i)[to + 1] == ' '))
+ if (i != y2 && (to != D_width - 1 || ml->image[to + 1] == ' '))
{
/*
* this code defines, what glues lines together
@@ -396,19 +405,22 @@ GetHistory() /* return value 1 if u_copybuffer changed */
{
int i = 0, q = 0, xx, yy, x, y;
char *linep;
+ struct mline *ml;
x = fore->w_x;
if (x >= D_width)
x = D_width - 1;
y = fore->w_y + fore->w_histheight;
debug2("cursor is at x=%d, y=%d\n", x, y);
- for (xx = x - 1, linep = iWIN(y) + xx; xx >= 0; xx--)
+ ml = WIN(y);
+ for (xx = x - 1, linep = ml->image + xx; xx >= 0; xx--)
if ((q = *linep--) != ' ' )
break;
debug3("%c at (%d,%d)\n", q, xx, y);
for (yy = y - 1; yy >= 0; yy--)
{
- linep = iWIN(yy);
+ ml = WIN(yy);
+ linep = ml->image;
if (xx < 0 || eq(linep[xx], q))
{ /* line is matching... */
for (i = D_width - 1, linep += i; i >= x; i--)
@@ -542,6 +554,15 @@ int *inlenp;
cy = markdata->cy;
switch (od)
{
+ case 'x':
+ if (!markdata->second)
+ break;
+ markdata->cx = markdata->x1;
+ markdata->cy = markdata->y1;
+ markdata->x1 = cx;
+ markdata->y1 = cy;
+ revto(markdata->cx, markdata->cy);
+ break;
case '\014': /* CTRL-L Redisplay */
Redisplay(0);
GotoPos(cx, W2D(cy));
@@ -847,9 +868,7 @@ int *inlenp;
y2 = cy;
newcopylen = rem(markdata->x1, markdata->y1, x2, y2, 2, (char *)0, 0); /* count */
if (D_user->u_copybuffer != NULL && !append_mode)
- {
- UserFreeCopyBuffer(D_user);
- }
+ UserFreeCopyBuffer(D_user);
if (newcopylen > 0)
{
/* the +3 below is for : cr + lf + \0 */
@@ -949,8 +968,12 @@ int tx, ty, line;
int x, y, t, revst, reven, qq, ff, tt, st, en, ce = 0;
int ystart = 0, yend = D_height-1;
int i, ry;
- char *wi, *wa, *wf;
+ char *wi;
+ struct mline *ml;
+ struct mchar mchar_marked;
+ mchar_marked = mchar_so;
+
if (tx < 0)
tx = 0;
else if (tx > D_width - 1)
@@ -1022,32 +1045,29 @@ int tx, ty, line;
st = y * D_width;
ry = ystart;
}
- wi = iWIN(y);
- wa = aWIN(y);
- wf = fWIN(y);
+ ml = WIN(y);
for (t = st; t <= en; t++, x++)
{
if (x >= D_width)
{
x = 0;
y++, ry++;
- wi = iWIN(y);
- wa = aWIN(y);
- wf = fWIN(y);
+ ml = WIN(y);
}
if (ry > yend)
break;
if (t == st || x == 0)
{
- for (ce = D_width; ce >= 0; ce--)
- if (wi[ce] != ' ')
+ wi = ml->image + D_width;
+ for (ce = D_width; ce >= 0; ce--, wi--)
+ if (*wi != ' ')
break;
}
if (x <= ce && x >= markdata->left_mar && x <= markdata->right_mar
&& (D_CLP || x < D_width-1 || ry < D_bot))
{
#ifdef KANJI
- if (badkanji(wf, x))
+ if (badkanji(ml->font, x))
{
t--;
x--;
@@ -1055,18 +1075,22 @@ int tx, ty, line;
#endif
GotoPos(x, W2D(y));
#ifdef KANJI
- if (t >= revst - (wf[x] == KANJI) && t <= reven)
+ if (t >= revst - (ml->font[x] == KANJI) && t <= reven)
#else
if (t >= revst && t <= reven)
#endif
- SetAttrFont(A_SO, pastefont ? wf[x] : ASCII);
+ {
+ if (pastefont)
+ mchar_marked.font = ml->font[x];
+ SetRendition(&mchar_marked);
+ }
else
- SetAttrFont(wa[x], wf[x]);
- PUTCHARLP(wi[x]);
+ SetRenditionMline(ml, x);
+ PUTCHARLP(ml->image[x]);
#ifdef KANJI
- if (wf[x] == KANJI)
+ if (ml->font[x] == KANJI)
{
- PUTCHARLP(wi[++x]);
+ PUTCHARLP(ml->image[++x]);
t++;
}
#endif
@@ -1108,9 +1132,11 @@ int y; /* NOTE: y is in DISPLAY coords system! */
int xs, xe;
int isblank;
{
- int x, i, rm;
+ int wy, x, i, rm;
int sta, sto, cp; /* NOTE: these 3 are in WINDOW coords system */
- char *wi, *wa, *wf, *oldi;
+ char *wi;
+ struct mline *oml, *ml;
+ struct mchar mchar_marked;
if (y < 0) /* No special full page handling */
return;
@@ -1118,16 +1144,19 @@ int isblank;
markdata = (struct markdata *)D_lay->l_data;
fore = D_fore;
- wi = iWIN(D2W(y));
- wa = aWIN(D2W(y));
- wf = fWIN(D2W(y));
- oldi = isblank ? blank : null;
-
+ mchar_marked = mchar_so;
+
+
+ oml = isblank ? &mline_blank : &mline_null;
+ wy = D2W(y);
+ ml = WIN(wy);
+
if (markdata->second == 0)
{
- DisplayLine(oldi, null, null, wi, wa, wf, y, xs, xe);
+ DisplayLine(oml, ml, y, xs, xe);
return;
}
+
sta = markdata->y1 * D_width + markdata->x1;
sto = markdata->cy * D_width + markdata->cx;
@@ -1135,11 +1164,11 @@ int isblank;
{
i=sta; sta=sto; sto=i;
}
- cp = D2W(y) * D_width + xs;
+ cp = wy * D_width + xs;
rm = markdata->right_mar;
- for (x = D_width; x >= 0; x--)
- if (wi[x] != ' ')
+ for (x = D_width, wi = ml->image + D_width; x >= 0; x--, wi--)
+ if (*wi != ' ')
break;
if (x < rm)
rm = x;
@@ -1148,28 +1177,30 @@ int isblank;
if (cp >= sta && x >= markdata->left_mar)
break;
#ifdef KANJI
- if (badkanji(wf, x))
+ if (badkanji(ml->font, x))
x--;
#endif
if (x > xs)
- DisplayLine(oldi, null, null, wi, wa, wf, y, xs, x-1);
+ DisplayLine(oml, ml, y, xs, x - 1);
for (; x <= xe; x++, cp++)
{
if (cp > sto || x > rm || (!D_CLP && x >= D_width-1 && y == D_bot))
break;
+ if (pastefont)
+ mchar_marked.font = ml->font[x];
GotoPos(x, y);
- SetAttrFont(A_SO, pastefont ? wf[x] : ASCII);
- PUTCHARLP(wi[x]);
+ SetRendition(&mchar_marked);
+ PUTCHARLP(ml->image[x]);
#ifdef KANJI
- if (wf[x] == KANJI)
+ if (ml->font[x] == KANJI)
{
- PUTCHARLP(wi[++x]);
+ PUTCHARLP(ml->image[++x]);
cp++;
}
#endif
}
if (x <= xe)
- DisplayLine(oldi, null, null, wi, wa, wf, y, x, xe);
+ DisplayLine(oml, ml, y, x, xe);
}
@@ -1181,22 +1212,25 @@ MarkRewrite(ry, xs, xe, doit)
int ry, xs, xe, doit;
{
int dx, x, y, st, en, t, rm;
- char *a, *f, *i;
+ char *i;
+ struct mline *ml;
+ struct mchar mchar_marked;
+
+ mchar_marked = mchar_so;
markdata = (struct markdata *)D_lay->l_data;
fore = D_fore;
y = D2W(ry);
+ ml = WIN(y);
dx = xe - xs;
if (doit)
{
- i = iWIN(y) + xs;
+ i = ml->image + xs;
while (dx--)
PUTCHARLP(*i++);
- return(0);
+ return 0;
}
- a = aWIN(y) + xs,
- f = fWIN(y) + xs;
if (markdata->second == 0)
st = en = -1;
else
@@ -1209,7 +1243,7 @@ int ry, xs, xe, doit;
}
}
t = y * D_width + xs;
- for (rm=D_width, i=iWIN(y) + D_width; rm>=0; rm--)
+ for (rm = D_width, i = ml->image + D_width; rm >= 0; rm--)
if (*i-- != ' ')
break;
if (rm > markdata->right_mar)
@@ -1219,15 +1253,17 @@ int ry, xs, xe, doit;
{
if (t >= st && t <= en && x >= markdata->left_mar && x <= rm)
{
- if (D_attr != A_SO || (D_font != pastefont ? *f : ASCII))
+ if (pastefont)
+ mchar_marked.font = ml->font[x];
+ if (!cmp_mchar(&D_rend, &mchar_marked))
return EXPENSIVE;
}
else
{
- if (D_attr != *a || D_font != *f)
+ if (!cmp_mchar_mline(&D_rend, ml, x))
return EXPENSIVE;
}
- a++, f++, t++, x++;
+ x++;
}
return xe - xs;
}
diff --git a/src/mark.h b/src/mark.h
index 2743527..5bc19ec 100644
--- a/src/mark.h
+++ b/src/mark.h
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
* $Id$ FAU
diff --git a/src/misc.c b/src/misc.c
index 2029ab1..6ab06ed 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -34,10 +35,11 @@ RCS_ID("$Id$ FAU")
# include <sys/resource.h>
#endif
-extern char *blank;
extern struct display *display;
extern int eff_uid, real_uid;
extern int eff_gid, real_gid;
+extern struct mline mline_old;
+extern char *null, *blank;
char *
SaveStr(str)
@@ -62,7 +64,7 @@ int err;
static char er[20];
if (err > 0 && err < sys_nerr)
- return(sys_errlist[err]);
+ return sys_errlist[err];
sprintf(er, "Error %d", err);
return er;
}
@@ -112,6 +114,15 @@ char *nam;
#else /* apollo */
if (nam == NULL)
return NULL;
+# ifdef SVR4
+ /* unixware has /dev/pts012 as synonym for /dev/pts/12 */
+ if (!strncmp(nam, "/dev/pts", 8) && nam[8] >= '0' && nam[8] <= '9')
+ {
+ static char b[13];
+ sprintf(b, "pts/%d", atoi(nam + 8));
+ return b;
+ }
+# endif /* SVR4 */
if (strncmp(nam, "/dev/", 5) == 0)
return nam + 5;
#endif /* apollo */
@@ -154,7 +165,7 @@ void (*func) __P(SIGPROTOARG);
sv.sv_flags = SV_BSDSIG;
if (sigvector(sig, &sv, &osv) < 0)
return (void (*)__P(SIGPROTOARG))(BADSIG);
- return (osv.sv_handler);
+ return osv.sv_handler;
}
# endif /* hpux */
#endif /* POSIX */
@@ -266,7 +277,6 @@ int except;
{
int f;
#ifdef SVR4
- int getrlimit __P((int, struct rlimit *));
struct rlimit rl;
if ((getrlimit(RLIMIT_NOFILE, &rl) == 0) && rl.rlim_max != RLIM_INFINITY)
@@ -367,7 +377,7 @@ UserStatus()
(void) signal(SIGCHLD, Usersigcld);
if (i == -1)
return -1;
- return (WEXITSTATUS(wstat));
+ return WEXITSTATUS(wstat);
#else
return UserSTAT;
#endif
@@ -428,3 +438,31 @@ int len;
*p = 0;
return p - buf;
}
+
+
+#ifdef TERMINFO
+/*
+ * This is a replacement for the buggy _delay function from the termcap
+ * emulation of libcurses, which ignores ospeed.
+ */
+int
+_delay(delay, outc)
+register int delay;
+int (*outc)();
+{
+ int pad;
+ extern short ospeed;
+ static short osp2pad[] = {
+ 0,2000,1333,909,743,666,500,333,166,83,55,41,20,10,5,2,1,1
+ };
+
+ if (ospeed <= 0 || ospeed >= sizeof(osp2pad)/sizeof(*osp2pad))
+ return 0;
+ pad =osp2pad[ospeed];
+ delay = (delay + pad / 2) / pad;
+ while (delay-- > 0)
+ (*outc)(0);
+ return 0;
+}
+#endif
+
diff --git a/src/os.h b/src/os.h
index 56f8f97..4e7292b 100644
--- a/src/os.h
+++ b/src/os.h
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
* $Id$ FAU
@@ -307,6 +308,21 @@ extern int errno;
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#endif
+/*
+ * SunOS 4.1.3: `man 2V open' has only one line that mentions O_NOBLOCK:
+ *
+ * O_NONBLOCK Same as O_NDELAY above.
+ *
+ * on the very same SunOS 4.1.3, I traced the open system call and found
+ * that an open("/dev/ttyy08", O_RDWR|O_NONBLOCK|O_NOCTTY) was blocked,
+ * whereas open("/dev/ttyy08", O_RDWR|O_NDELAY |O_NOCTTY) went through.
+ *
+ * For this simple reason I now favour O_NDELAY. jw. 4.5.95
+ */
+#if defined(sun) && !defined(SVR4)
+# undef O_NONBLOCK
+#endif
+
#if !defined(O_NONBLOCK) && defined(O_NDELAY)
# define O_NONBLOCK O_NDELAY
#endif
diff --git a/src/osdef.h.in b/src/osdef.h.in
index 02af070..16b9b1a 100644
--- a/src/osdef.h.in
+++ b/src/osdef.h.in
@@ -100,7 +100,6 @@ extern int tcsetpgrp __P((int, int));
#endif
extern int ioctl __P((int, int, char *));
-extern int getpgrp __P((int));
extern int kill __P((int, int));
extern int getpid __P((void));
@@ -170,3 +169,14 @@ struct ttyent;
extern void setttyent __P((void));
extern struct ttyent *getttyent __P((void));
# endif
+
+#ifdef SVR4
+struct rlimit;
+extern int getrlimit __P((int, struct rlimit *));
+#endif
+
+struct stat;
+extern int stat __P((char *, struct stat *));
+extern int lstat __P((char *, struct stat *));
+extern int fstat __P((int, struct stat *));
+
diff --git a/src/osdef.sh b/src/osdef.sh
index a857649..3ecc4d7 100644
--- a/src/osdef.sh
+++ b/src/osdef.sh
@@ -29,6 +29,9 @@ cat << EOF > osdef0.c
#if defined(UTMPOK) && defined (GETTTYENT) && !defined(GETUTENT)
#include <ttyent.h>
#endif
+#ifdef SVR4
+# include <sys/resource.h>
+#endif
EOF
cat << EOF > osdef2.sed
1i\\
diff --git a/src/overlay.h b/src/overlay.h
index e6eb865..3b5fe9b 100644
--- a/src/overlay.h
+++ b/src/overlay.h
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
* $Id$ FAU
diff --git a/src/patchlevel.h b/src/patchlevel.h
index 80537ff..95a3795 100644
--- a/src/patchlevel.h
+++ b/src/patchlevel.h
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
* $Id$ FAU
@@ -188,11 +189,36 @@
* Paste bug fixed (only worked with KANJI).
* Check bcopy before memcpy/memmove.
* FindSocket code much fixed & improved.
+ * 31.08.95 -- 3.06.03 Color support, digraph command, code
+ * cleanup (struct mchar/mline added).
+ * 13.09.95 -- 3.06.04 SetRendition display check. Solaris unblock
+ * SIGHUP. w_curchar->w_rend, lintified.
+ * Shadow-password code moved and rewritten
+ * (includes sun C2).
+ * 26.09.95 -- 3.06.05 resize code completely rewritten.
+ * Very visible cursor added. vbell sequence
+ * \Eb added. _delay for terminfo libs added
+ * to make the padding work for the first time.
+ * New ProcessInput() makes "command command"
+ * work. '[def]escape ""' clears escape chars.
+ * Changed logdir command to logfile. It now uses
+ * MakeWinMsg() to create the filename.
+ * Updated the manuals.
+ * 28.10.95 -- 3.06.06 Added new 'XC' capability to provide
+ * a method for character translation.
+ * 17.11.95 -- 3.07.00 Added CheckEscape() function.
+ * acl -> acls because of hpux10 nameclash
+ * /stand/vmunix added to kernel list (hpux10)
+ * stripdev changed to translate
+ * /dev/pts<n> to /dev/pts/<n> (unixware)
+ * -lgen added to GETUTENT configure test.
+ * 20.11.95 -- 3.07.01 corrected vbell null ptr reference
+ * -- DISTRIBUTED
*/
#define ORIGIN "FAU"
#define REV 3
-#define VERS 6
-#define PATCHLEVEL 2
-#define DATE "4-Apr-95"
-#define STATE ""
+#define VERS 7
+#define PATCHLEVEL 1
+#define DATE "20-Nov-95"
+#define STATE ""
diff --git a/src/process.c b/src/process.c
index d4cebc0..8916ca5 100644
--- a/src/process.c
+++ b/src/process.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -49,7 +50,7 @@ extern struct comm comms[];
extern char *rc_name;
extern char *RcFileName, *home;
extern char *BellString, *ActivityString, *ShellProg, *ShellArgs[];
-extern char *hardcopydir, *screenlogdir;
+extern char *hardcopydir, *screenlogfile;
extern char *VisualBellString;
extern int VBellWait, MsgWait, MsgMinWait, SilenceWait;
extern char SockPath[], *SockName;
@@ -82,6 +83,7 @@ extern char *kmapdef[];
extern char *kmapadef[];
extern char *kmapmdef[];
#endif
+extern struct mchar mchar_so;
static int CheckArgNum __P((int, char **));
@@ -102,7 +104,7 @@ static int ParseOnOff __P((struct action *, int *));
static int ParseSaveStr __P((struct action *act, char **));
static int ParseNum __P((struct action *act, int *));
static int ParseWinNum __P((struct action *act, int *));
-static int ParseOct __P((struct action *act, int *));
+static int ParseBase __P((struct action *act, char *, int *, int, char *));
static char *ParseChar __P((char *, char *));
static int IsNum __P((char *, int));
static void InputColon __P((void));
@@ -123,6 +125,7 @@ static void pass2 __P((char *, int));
#ifdef POW_DETACH
static void pow_detach_fn __P((char *, int));
#endif
+static void digraph_fn __P((char *, int));
@@ -175,6 +178,116 @@ int kmap_extras_fl[KMAP_EXT];
#endif
+
+static const unsigned char digraphs[][3] = {
+ {'~', '!', 161}, /* ¡ */
+ {'!', '!', 161}, /* ¡ */
+ {'c', '|', 162}, /* ¢ */
+ {'$', '$', 163}, /* £ */
+ {'o', 'x', 164}, /* ¤ */
+ {'Y', '-', 165}, /* ¥ */
+ {'|', '|', 166}, /* ¦ */
+ {'p', 'a', 167}, /* § */
+ {'"', '"', 168}, /* ¨ */
+ {'c', 'O', 169}, /* © */
+ {'a', '-', 170}, /* ª */
+ {'<', '<', 171}, /* « */
+ {'-', ',', 172}, /* ¬ */
+ {'-', '-', 173}, /* ­ */
+ {'r', 'O', 174}, /* ® */
+ {'-', '=', 175}, /* ¯ */
+ {'~', 'o', 176}, /* ° */
+ {'+', '-', 177}, /* ± */
+ {'2', '2', 178}, /* ² */
+ {'3', '3', 179}, /* ³ */
+ {'\'', '\'', 180}, /* ´ */
+ {'j', 'u', 181}, /* µ */
+ {'p', 'p', 182}, /* ¶ */
+ {'~', '.', 183}, /* · */
+ {',', ',', 184}, /* ¸ */
+ {'1', '1', 185}, /* ¹ */
+ {'o', '-', 186}, /* º */
+ {'>', '>', 187}, /* » */
+ {'1', '4', 188}, /* ¼ */
+ {'1', '2', 189}, /* ½ */
+ {'3', '4', 190}, /* ¾ */
+ {'~', '?', 191}, /* ¿ */
+ {'?', '?', 191}, /* ¿ */
+ {'A', '`', 192}, /* À */
+ {'A', '\'', 193}, /* Á */
+ {'A', '^', 194}, /* Â */
+ {'A', '~', 195}, /* Ã */
+ {'A', '"', 196}, /* Ä */
+ {'A', '@', 197}, /* Å */
+ {'A', 'E', 198}, /* Æ */
+ {'C', ',', 199}, /* Ç */
+ {'E', '`', 200}, /* È */
+ {'E', '\'', 201}, /* É */
+ {'E', '^', 202}, /* Ê */
+ {'E', '"', 203}, /* Ë */
+ {'I', '`', 204}, /* Ì */
+ {'I', '\'', 205}, /* Í */
+ {'I', '^', 206}, /* Î */
+ {'I', '"', 207}, /* Ï */
+ {'D', '-', 208}, /* Ð */
+ {'N', '~', 209}, /* Ñ */
+ {'O', '`', 210}, /* Ò */
+ {'O', '\'', 211}, /* Ó */
+ {'O', '^', 212}, /* Ô */
+ {'O', '~', 213}, /* Õ */
+ {'O', '"', 214}, /* Ö */
+ {'/', '\\', 215}, /* × */
+ {'O', '/', 216}, /* Ø */
+ {'U', '`', 217}, /* Ù */
+ {'U', '\'', 218}, /* Ú */
+ {'U', '^', 219}, /* Û */
+ {'U', '"', 220}, /* Ü */
+ {'Y', '\'', 221}, /* Ý */
+ {'I', 'p', 222}, /* Þ */
+ {'s', 's', 223}, /* ß */
+ {'s', '"', 223}, /* ß */
+ {'a', '`', 224}, /* à */
+ {'a', '\'', 225}, /* á */
+ {'a', '^', 226}, /* â */
+ {'a', '~', 227}, /* ã */
+ {'a', '"', 228}, /* ä */
+ {'a', '@', 229}, /* å */
+ {'a', 'e', 230}, /* æ */
+ {'c', ',', 231}, /* ç */
+ {'e', '`', 232}, /* è */
+ {'e', '\'', 233}, /* é */
+ {'e', '^', 234}, /* ê */
+ {'e', '"', 235}, /* ë */
+ {'i', '`', 236}, /* ì */
+ {'i', '\'', 237}, /* í */
+ {'i', '^', 238}, /* î */
+ {'i', '"', 239}, /* ï */
+ {'d', '-', 240}, /* ð */
+ {'n', '~', 241}, /* ñ */
+ {'o', '`', 242}, /* ò */
+ {'o', '\'', 243}, /* ó */
+ {'o', '^', 244}, /* ô */
+ {'o', '~', 245}, /* õ */
+ {'o', '"', 246}, /* ö */
+ {':', '-', 247}, /* ÷ */
+ {'o', '/', 248}, /* ø */
+ {'u', '`', 249}, /* ù */
+ {'u', '\'', 250}, /* ú */
+ {'u', '^', 251}, /* û */
+ {'u', '"', 252}, /* ü */
+ {'y', '\'', 253}, /* ý */
+ {'i', 'p', 254}, /* þ */
+ {'y', '"', 255}, /* y", make poor lint happy*/
+ {'"', '[', 196}, /* Ä */
+ {'"', '\\', 214}, /* Ö */
+ {'"', ']', 220}, /* Ü */
+ {'"', '{', 228}, /* ä */
+ {'"', '|', 246}, /* ö */
+ {'"', '}', 252}, /* ü */
+ {'"', '~', 223} /* ß */
+};
+
+
char *noargs[1];
void
@@ -252,7 +365,8 @@ InitKeytab()
ktab['k'].nr = ktab[Ctrl('k')].nr = RC_KILL;
ktab['l'].nr = ktab[Ctrl('l')].nr = RC_REDISPLAY;
ktab['w'].nr = ktab[Ctrl('w')].nr = RC_WINDOWS;
- ktab['v'].nr = ktab[Ctrl('v')].nr = RC_VERSION;
+ ktab['v'].nr = RC_VERSION;
+ ktab[Ctrl('v')].nr = RC_DIGRAPH;
ktab['q'].nr = ktab[Ctrl('q')].nr = RC_XON;
ktab['s'].nr = ktab[Ctrl('s')].nr = RC_XOFF;
ktab['t'].nr = ktab[Ctrl('t')].nr = RC_TIME;
@@ -311,8 +425,10 @@ InitKeytab()
ktab['b'].nr = ktab[Ctrl('b')].nr = RC_BREAK;
ktab['B'].nr = RC_POW_BREAK;
ktab['_'].nr = RC_SILENCE;
- ktab[(int)(unsigned char)DefaultEsc].nr = RC_OTHER;
- ktab[(int)(unsigned char)DefaultMetaEsc].nr = RC_META;
+ if (DefaultEsc >= 0)
+ ktab[DefaultEsc].nr = RC_OTHER;
+ if (DefaultMetaEsc >= 0)
+ ktab[DefaultMetaEsc].nr = RC_META;
}
static void
@@ -332,40 +448,13 @@ struct action *act;
act->args = noargs;
}
-#if 0
-void
-ProcessInput(ibuf, ilen)
-char *ibuf;
-int ilen;
-{
- char *s;
- int slen;
- while (display)
- {
- fore = D_fore;
- slen = ilen;
- s = ibuf;
- while (ilen > 0)
- {
- if (*s++ == D_user->u_Esc)
- break;
- ilen--;
- }
- slen -= ilen;
- while (slen)
- Process(&ibuf, &slen);
- if (--ilen == 0)
- D_ESCseen = 1;
- if (ilen <= 0)
- return;
- DoAction(&ktab[(int)(unsigned char)*s], (int)(unsigned char)*s);
- ibuf = s + 1;
- ilen--;
- }
-}
-#endif
+#ifdef MAPKEYS
+/*
+ * This ProcessInput just does the keybindings and passes
+ * everything on to ProcessInput2
+ */
void
ProcessInput(ibuf, ilen)
@@ -374,29 +463,16 @@ int ilen;
{
int ch, slen;
char *s;
-#ifdef MAPKEYS
struct action *act;
int i, l;
-#endif
if (display == 0 || ilen == 0)
return;
slen = ilen;
s = ibuf;
- while (D_ESCseen)
- {
- D_ESCseen = 0;
- fore = D_fore;
- DoAction(&ktab[(int)(unsigned char)*s], (int)(unsigned char)*s);
- ibuf = ++s;
- slen = --ilen;
- if (display == 0 || ilen == 0)
- return;
- }
while(ilen-- > 0)
{
ch = *(unsigned char *)s++;
-#ifdef MAPKEYS
if (D_dontmap)
D_dontmap = 0;
else if (D_nseqs)
@@ -413,8 +489,8 @@ int ilen;
if (D_seql)
{
D_seqp -= D_seql;
- while (D_seql)
- Process(&D_seqp, &D_seql);
+ ProcessInput2(D_seqp, D_seql);
+ D_seql = 0;
}
D_seqp = D_kmaps[0].seq;
D_mapdefault = 0;
@@ -422,9 +498,9 @@ int ilen;
}
if (D_seql++ == 0)
{
+ /* Finish old stuff */
slen -= ilen + 1;
- while (slen)
- Process(&ibuf, &slen);
+ ProcessInput2(ibuf, slen);
D_seqruns = 0;
}
ibuf = s;
@@ -460,51 +536,80 @@ int ilen;
else
{
D_seqp -= D_seql;
- while (D_seql)
- Process(&D_seqp, &D_seql);
+ ProcessInput2(D_seqp, D_seql);
}
if (display == 0)
return;
D_seql = 0;
D_seqp = D_kmaps[0].seq;
- if (D_ESCseen)
- {
- slen++;
- ch = D_user->u_Esc;
- }
}
break;
}
+ }
+ ProcessInput2(ibuf, slen);
+}
+
+#else
+# define ProcessInput2 ProcessInput
#endif
- if (ch == D_user->u_Esc)
+
+
+/*
+ * Here the screen escape commands are handled, the remaining
+ * chars are passed to the layer's input handler.
+ */
+
+void
+ProcessInput2(ibuf, ilen)
+char *ibuf;
+int ilen;
+{
+ char *s;
+ int ch, slen;
+
+ while (display)
+ {
+ fore = D_fore;
+ slen = ilen;
+ s = ibuf;
+ if (!D_ESCseen)
{
- slen -= ilen + 1;
- while (slen)
- Process(&ibuf, &slen);
- do
+ while (ilen > 0)
{
- if (ilen-- == 0)
- {
- D_ESCseen = 1;
- return;
- }
- D_ESCseen = 0;
- fore = D_fore;
- ch = (int)(unsigned char)*s++;
- DoAction(&ktab[ch], ch);
- if (display == 0 || ilen == 0)
- return;
+ if ((unsigned char)*s++ == D_user->u_Esc)
+ break;
+ ilen--;
}
- while (D_ESCseen);
- ibuf = s;
- slen = ilen;
+ slen -= ilen;
+ while (slen)
+ Process(&ibuf, &slen);
+ if (--ilen == 0)
+ D_ESCseen = 1;
}
+ if (ilen <= 0)
+ return;
+ D_ESCseen = 0;
+ ch = (unsigned char)*s;
+
+ /*
+ * As users have different esc characters, but a common ktab[],
+ * we fold back the users esc and meta-esc key to the Default keys
+ * that can be looked up in the ktab[]. grmbl. jw.
+ * FIXME: make ktab[] a per user thing.
+ */
+ if (ch == D_user->u_Esc)
+ ch = DefaultEsc;
+ else if (ch == D_user->u_MetaEsc)
+ ch = DefaultMetaEsc;
+
+ if (ch >= 0)
+ DoAction(&ktab[ch], ch);
+ ibuf = s + 1;
+ ilen--;
}
- while (slen)
- Process(&ibuf, &slen);
}
-
+
int
FindCommnr(str)
char *str;
@@ -1025,12 +1130,15 @@ int key;
D_ESCseen = 1;
break;
}
+ D_ESCseen = 0;
/* FALLTHROUGH */
case RC_OTHER:
if (MoreWindows())
SwitchWindow(D_other ? D_other->w_number : NextWindow());
break;
case RC_META:
+ if (D_user->u_Esc < 0)
+ break;
ch = D_user->u_Esc;
s = &ch;
n = 1;
@@ -1177,9 +1285,7 @@ int key;
break;
case RC_DEFWRITELOCK:
if (args[0][0] == 'a')
- {
- nwin_default.wlock = WLOCK_AUTO;
- }
+ nwin_default.wlock = WLOCK_AUTO;
else
{
if (ParseOnOff(act, &n))
@@ -1447,22 +1553,25 @@ int key;
KillBuffers();
break;
#endif /* COPY_PASTE */
- case RC_DEFESCAPE:
- if (ParseEscape(NULL, *args))
- Msg(0, "%s: two characters required after defescape.", rc_name);
- break;
case RC_ESCAPE:
- ClearAction(&ktab[(int)(unsigned char)D_user->u_Esc]);
- ClearAction(&ktab[(int)(unsigned char)D_user->u_MetaEsc]);
- if (ParseEscape(D_user, *args))
+ if (ParseEscape(display ? D_user : users, *args))
{
Msg(0, "%s: two characters required after escape.", rc_name);
break;
}
- ClearAction(&ktab[(int)(unsigned char)D_user->u_Esc]);
- ClearAction(&ktab[(int)(unsigned char)D_user->u_MetaEsc]);
- ktab[(int)(unsigned char)D_user->u_Esc].nr = RC_OTHER;
- ktab[(int)(unsigned char)D_user->u_MetaEsc].nr = RC_META;
+ /* Change defescape if only one user. This is because we only
+ * have one ktab.
+ */
+ if (users->u_next)
+ break;
+ /* FALLTHROUGH */
+ case RC_DEFESCAPE:
+ if (ParseEscape((struct user *)0, *args))
+ {
+ Msg(0, "%s: two characters required after defescape.", rc_name);
+ break;
+ }
+ CheckEscape();
break;
case RC_CHDIR:
s = *args ? *args : home;
@@ -1476,8 +1585,11 @@ int key;
case RC_HARDCOPYDIR:
(void)ParseSaveStr(act, &hardcopydir);
break;
- case RC_LOGDIR:
- (void)ParseSaveStr(act, &screenlogdir);
+ case RC_LOGFILE:
+ if (*args)
+ if (ParseSaveStr(act, &screenlogfile) || !msgok)
+ break;
+ Msg(0, "logfile is '%s'", screenlogfile);
break;
case RC_SHELLTITLE:
case RC_SHELLAKA:
@@ -1486,6 +1598,7 @@ int key;
case RC_SLEEP:
case RC_TERMCAP:
case RC_TERMINFO:
+ case RC_TERMCAPINFO:
break; /* Already handled */
case RC_TERM:
s = NULL;
@@ -1692,6 +1805,13 @@ int key;
#ifdef MULTIUSER
AclWinSwap(old, n);
#endif
+ /* yucc */
+ if (fore->w_hstatus)
+ {
+ display = fore->w_display;
+ if (display)
+ RefreshStatus();
+ }
}
break;
case RC_SILENCE:
@@ -1742,7 +1862,7 @@ int key;
break;
case RC_SCROLLBACK:
(void)ParseNum(act, &n);
- ChangeScrollback(fore, n, D_width);
+ ChangeWindowSize(fore, fore->w_width, fore->w_height, n);
if (msgok)
Msg(0, "scrollback set to %d", fore->w_histheight);
break;
@@ -1878,7 +1998,7 @@ int key;
debug1(" new vbellstr '%s'\n", VisualBellString);
break;
case RC_DEFMODE:
- if (ParseOct(act, &n))
+ if (ParseBase(act, *args, &n, 8, "oct"))
break;
if (n < 0 || n > 0777)
{
@@ -2106,7 +2226,7 @@ int key;
;
*s ? (*s++ = '\0') : (*s = '\0');
u = FindUserPtr(args[0]);
- UserAdd(args[0], NULL, u);
+ UserAdd(args[0], (char *)0, u);
if (args[1] && args[2])
AclSetPerm(*u, args[1], args[2]);
else
@@ -2116,7 +2236,7 @@ int key;
}
case RC_ACLDEL:
{
- if (UserDel(args[0], NULL))
+ if (UserDel(args[0], (struct user **)0))
break;
if (msgok)
Msg(0, "%s removed from acl database", args[0]);
@@ -2208,6 +2328,98 @@ int key;
else
Msg(0, "using termcap entries for printing");
break;
+ case RC_DIGRAPH:
+ Input("Enter digraph: ", 10, digraph_fn, INP_EVERY);
+ if (*args && **args)
+ {
+ s = *args;
+ n = strlen(s);
+ Process(&s, &n);
+ }
+ break;
+ case RC_DEFHSTATUS:
+ if (*args == 0)
+ {
+ char buf[256];
+ *buf = 0;
+ if (nwin_default.hstatus)
+ AddXChars(buf, sizeof(buf), nwin_default.hstatus);
+ Msg(0, "default hstatus is '%s'", buf);
+ break;
+ }
+ (void)ParseSaveStr(act, &nwin_default.hstatus);
+ if (*nwin_default.hstatus == 0)
+ {
+ free(nwin_default.hstatus);
+ nwin_default.hstatus = 0;
+ }
+ break;
+ case RC_DEFCHARSET:
+ case RC_CHARSET:
+ if (*args == 0)
+ {
+ char buf[256];
+ *buf = 0;
+ if (nwin_default.charset)
+ AddXChars(buf, sizeof(buf), nwin_default.charset);
+ Msg(0, "default charset is '%s'", buf);
+ break;
+ }
+ n = strlen(*args);
+ if (n == 0 || n > 6)
+ {
+ Msg(0, "%s: %s: string has illegal size.", rc_name, comms[nr].name);
+ break;
+ }
+ if (n > 4 && (
+ ((args[0][4] < '0' || args[0][4] > '3') && args[0][4] != '.') ||
+ ((args[0][5] < '0' || args[0][5] > '3') && args[0][5] && args[0][5] != '.')))
+ {
+ Msg(0, "%s: %s: illegal mapping number.", rc_name, comms[nr].name);
+ break;
+ }
+ if (nr == RC_CHARSET)
+ {
+ SetCharsets(fore, *args);
+ break;
+ }
+ if (nwin_default.charset)
+ free(nwin_default.charset);
+ nwin_default.charset = SaveStr(*args);
+ break;
+ case RC_SORENDITION:
+ i = mchar_so.attr;
+ if (*args && **args)
+ {
+ if (ParseBase(act, *args, &i, 16, "hex"))
+ break;
+ if (i < 0 || i >= (1 << NATTR))
+ {
+ Msg(0, "sorendition: bad standout attributes");
+ break;
+ }
+ }
+#ifdef COLOR
+ n = mchar_so.color;
+ if (*args && args[1])
+ {
+ if (ParseBase(act, args[1], &n, 16, "hex"))
+ break;
+ if (n < 0 || n > 0x99 || (n & 15) > 9)
+ {
+ Msg(0, "sorendition: bad standout color");
+ break;
+ }
+ n = 0x99 - n;
+ }
+ mchar_so.attr = i;
+ mchar_so.color = n;
+ Msg(0, "Standout attributes 0x%02x color 0x%02x", (unsigned char)mchar_so.attr, 0x99 - (unsigned char)mchar_so.color);
+#else
+ mchar_so.attr = i;
+ Msg(0, "Standout attributes 0x%02x", (unsigned char)mchar_so.attr);
+#endif
+ break;
default:
break;
}
@@ -2240,9 +2452,7 @@ char **args;
if ((pp = ap = (char **) malloc((unsigned) (argc + 1) * sizeof(char **))) == 0)
Panic(0, strnomem);
while (argc--)
- {
- *pp++ = SaveStr(*args++);
- }
+ *pp++ = SaveStr(*args++);
*pp = 0;
return ap;
}
@@ -2333,9 +2543,51 @@ ParseEscape(u, p)
struct user *u;
char *p;
{
- if ((p = ParseChar(p, u ? &u->u_Esc : &DefaultEsc)) == NULL ||
- (p = ParseChar(p, u ? &u->u_MetaEsc : &DefaultMetaEsc)) == NULL || *p)
- return -1;
+ unsigned char buf[2];
+ int e, me;
+
+#ifdef MAPKEYS
+ if (*p == 0)
+ e = me = -1;
+ else
+#endif
+ {
+ if ((p = ParseChar(p, (char *)buf)) == NULL ||
+ (p = ParseChar(p, (char *)buf+1)) == NULL || *p)
+ return -1;
+ e = buf[0];
+ me = buf[1];
+ }
+ if (u)
+ {
+ u->u_Esc = e;
+ u->u_MetaEsc = me;
+ }
+ else
+ {
+ if (users)
+ {
+ if (DefaultEsc >= 0)
+ ClearAction(&ktab[DefaultEsc]);
+ if (DefaultMetaEsc >= 0)
+ ClearAction(&ktab[DefaultMetaEsc]);
+ }
+ DefaultEsc = e;
+ DefaultMetaEsc = me;
+ if (users)
+ {
+ if (DefaultEsc >= 0)
+ {
+ ClearAction(&ktab[DefaultEsc]);
+ ktab[DefaultEsc].nr = RC_OTHER;
+ }
+ if (DefaultMetaEsc >= 0)
+ {
+ ClearAction(&ktab[DefaultMetaEsc]);
+ ktab[DefaultMetaEsc].nr = RC_META;
+ }
+ }
+ }
return 0;
}
@@ -2433,9 +2685,12 @@ char *s;
struct win *p;
for (p = windows; p; p = p->w_next)
+ if (!strcmp(p->w_title, s))
+ return p;
+ for (p = windows; p; p = p->w_next)
if (!strncmp(p->w_title, s, strlen(s)))
return p;
- return NULL;
+ return 0;
}
static int
@@ -2501,34 +2756,38 @@ int *var;
return 0;
}
+
static int
-ParseOct(act, var)
+ParseBase(act, p, var, base, bname)
struct action *act;
+char *p;
int *var;
+int base;
+char *bname;
{
- char *p, **args = act->args;
- int i = 0;
+ int i = 0;
+ int c;
- p = *args;
- if (p == 0 || *p == 0 || args[1])
+ if (*p == 0)
{
- Msg(0, "%s: %s: invalid argument. Give one octal argument.",
- rc_name, comms[act->nr].name);
+ Msg(0, "%s: %s: empty argument.", rc_name, comms[act->nr].name);
return -1;
}
- while (*p)
+ while ((c = *p++))
{
- if (*p >= '0' && *p <= '7')
- i = 8 * i + (*p - '0');
- else
+ if (c >= 'a' && c <= 'z')
+ c -= 'a' - 'A';
+ if (c >= 'A' && c <= 'Z')
+ c -= 'A' - ('0' + 10);
+ c -= '0';
+ if (c < 0 || c >= base)
{
- Msg(0, "%s: %s: invalid argument. Give octal argument.",
- rc_name, comms[act->nr].name);
+ Msg(0, "%s: %s: argument is not %s.", rc_name, comms[act->nr].name, bname);
return -1;
}
- p++;
+ i = base * i + c;
}
- debug1("ParseOct got %d\n", i);
+ debug1("ParseBase got %d\n", i);
*var = i;
return 0;
}
@@ -2819,10 +3078,8 @@ int on;
Msg(0, "You are %s logging.", on ? "already" : "not");
return;
}
- if (screenlogdir)
- sprintf(buf, "%s/screenlog.%d", screenlogdir, fore->w_number);
- else
- sprintf(buf, "screenlog.%d", fore->w_number);
+ strncpy(buf, MakeWinMsg(screenlogfile, fore, '%'), 1023);
+ buf[1023] = 0;
if (fore->w_logfp != NULL)
{
#ifdef NETHACK
@@ -2982,7 +3239,7 @@ ShowInfo()
(wp->w_logfp != NULL) ? '+' : '-',
(wp->w_monitor != MON_OFF) ? '+' : '-',
wp->w_norefresh ? '-' : '+');
- if (D_CG0)
+ if (D_CC0 || (D_CS0 && *D_CS0))
{
p = buf + strlen(buf);
if (wp->w_gr)
@@ -3340,9 +3597,7 @@ int len;
if (!fore)
return; /* Input() should not call us w/o fore, but you never know... */
if (*buf == '.')
- {
- Msg(0, "ins_reg_fn: Warning: pasting real register '.'!");
- }
+ Msg(0, "ins_reg_fn: Warning: pasting real register '.'!");
if (len)
{
*buf = 0;
@@ -3456,3 +3711,62 @@ int len;
}
#endif /* PASSWORD */
+static void
+digraph_fn(buf, len)
+char *buf;
+int len;
+{
+ int ch, i, x;
+
+ ch = buf[len];
+ if (ch)
+ {
+ if (ch < ' ' || ch == '\177')
+ return;
+ if (len && *buf == '0')
+ {
+ if (ch < '0' || ch > '7')
+ {
+ buf[len] = '\001'; /* ignore */
+ return;
+ }
+ if (len == 3)
+ buf[len] = '\n';
+ return;
+ }
+ if (len == 1)
+ buf[len] = '\n';
+ return;
+ }
+ buf[len] = buf[len + 1]; /* gross */
+ len++;
+ if (len < 2)
+ return;
+ if (buf[0] == '0')
+ {
+ x = 0;
+ for (i = 1; i < len; i++)
+ {
+ if (buf[i] < '0' || buf[i] > '7')
+ break;
+ x = x * 8 | (buf[i] - '0');
+ }
+ }
+ else
+ {
+ for (i = 0; i < sizeof(digraphs)/sizeof(*digraphs); i++)
+ if ((digraphs[i][0] == (unsigned char)buf[0] && digraphs[i][1] == (unsigned char)buf[1]) ||
+ (digraphs[i][0] == (unsigned char)buf[1] && digraphs[i][1] == (unsigned char)buf[0]))
+ break;
+ if (i == sizeof(digraphs)/sizeof(*digraphs))
+ {
+ Msg(0, "Unknown digraph");
+ return;
+ }
+ x = digraphs[i][2];
+ }
+ i = 1;
+ *buf = x;
+ while(i)
+ Process(&buf, &i);
+}
diff --git a/src/pty.c b/src/pty.c
index f763ac2..c279786 100644
--- a/src/pty.c
+++ b/src/pty.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -78,6 +79,14 @@ static char TtyProto[] = "/dev/ttyXY";
static void initpty __P((int));
+/*
+ * Open all ptys with O_NOCTTY, just to be on the safe side
+ * (RISCos mips breaks otherwise)
+ */
+#ifndef O_NOCTTY
+# define O_NOCTTY 0
+#endif
+
/***************************************************************/
static void
@@ -176,7 +185,7 @@ char **ttyn;
struct stat buf;
strcpy(PtyName, "/dev/ptc");
- if ((f = open(PtyName, O_RDWR | O_NONBLOCK)) < 0)
+ if ((f = open(PtyName, O_RDWR | O_NOCTTY | O_NONBLOCK)) < 0)
return -1;
if (fstat(f, &buf) < 0)
{
@@ -203,7 +212,8 @@ char **ttyn;
int unlockpt __P((int)), grantpt __P((int));
sigret_t (*sigcld)__P(SIGPROTOARG);
- if ((f = open("/dev/ptmx", O_RDWR)) == -1)
+ strcpy(PtyName, "/dev/ptmx");
+ if ((f = open(PtyName, O_RDWR | O_NOCTTY)) == -1)
return -1;
/*
@@ -242,7 +252,7 @@ char **ttyn;
/* a dumb looking loop replaced by mycrofts code: */
strcpy (PtyName, "/dev/ptc");
- if ((f = open (PtyName, O_RDWR)) < 0)
+ if ((f = open (PtyName, O_RDWR | O_NOCTTY)) < 0)
return -1;
strncpy(TtyName, ttyname(f), sizeof(TtyName));
if (eff_uid && access(TtyName, R_OK | W_OK))
@@ -287,7 +297,7 @@ char **ttyn;
for (d = PTYRANGE1; (p[1] = *d) != '\0'; d++)
{
debug1("OpenPTY tries '%s'\n", PtyName);
- if ((f = open(PtyName, O_RDWR)) == -1)
+ if ((f = open(PtyName, O_RDWR | O_NOCTTY)) == -1)
continue;
q[0] = *l;
q[1] = *d;
diff --git a/src/putenv.c b/src/putenv.c
index 12210fb..4756459 100644
--- a/src/putenv.c
+++ b/src/putenv.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -182,7 +183,7 @@ newenv()
{
elem = malloc(strlen(environ[i]) + 1);
if (elem == 0)
- return (-1);
+ return -1;
env[i] = elem;
strcpy(elem, environ[i]);
}
diff --git a/src/rcs.h b/src/rcs.h
index ccf1704..53e2c54 100644
--- a/src/rcs.h
+++ b/src/rcs.h
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
* $Id$ FAU
diff --git a/src/resize.c b/src/resize.c
index 72723a7..a756521 100644
--- a/src/resize.c
+++ b/src/resize.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -40,17 +41,13 @@ RCS_ID("$Id$ FAU")
#include "extern.h"
static void CheckMaxSize __P((int));
-static int ResizeScreenArray __P((struct win *, char ***, int, int, int));
-static void FreeArray __P((char ***, int));
-#ifdef COPY_PASTE
-static int ResizeHistArray __P((struct win *, char ***, int, int, int));
-static void FreeScrollback __P((struct win *));
-#endif
+static void FreeMline __P((struct mline *));
+static int AllocMline __P((struct mline *ml, int));
+static void MakeBlankLine __P((char *, int));
-extern int maxwidth;
extern struct display *display, *displays;
-extern char *blank, *null, *OldImage, *OldAttr;
-extern char *OldFont;
+extern char *blank, *null;
+extern struct mline mline_blank, mline_null, mline_old;
extern struct win *windows;
extern int Z0width, Z1width;
@@ -62,6 +59,15 @@ extern int nethackflag;
struct winsize glwz;
#endif
+static struct mline mline_zero = {
+ (char *)0,
+ (char *)0,
+ (char *)0
+#ifdef COLOR
+ ,(char *)0
+#endif
+};
+
/*
* ChangeFlag: 0: try to modify no window
* 1: modify fore (and try to modify no D_other) + redisplay
@@ -113,7 +119,7 @@ int change_flag;
debug("Trying to adapt all windows (-A)\n");
for (p = windows; p; p = p->w_next)
if (p->w_display == 0 || p->w_display == display)
- ChangeWindowSize(p, wi, he);
+ ChangeWindowSize(p, wi, he, p->w_histheight);
}
if (D_width == wi && D_height == he)
{
@@ -184,7 +190,7 @@ int change_fore;
else
wwi = Z1width;
}
- ChangeWindowSize(p, wwi, he);
+ ChangeWindowSize(p, wwi, he, p->w_histheight);
}
}
}
@@ -213,212 +219,80 @@ int wi, he;
}
}
-#ifdef COPY_PASTE
-
-int
-ChangeScrollback(p, histheight, histwidth)
-struct win *p;
-int histheight, histwidth;
-{
- if (histheight > MAXHISTHEIGHT)
- histheight = MAXHISTHEIGHT;
- debug2("ChangeScrollback(..., %d, %d)\n", histheight, histwidth);
- debug2(" was %d, %d\n", p->w_histheight, p->w_width);
-
- if (histheight == 0)
- {
- FreeScrollback(p);
- return 0;
- }
-
- if (ResizeHistArray(p, &p->w_ihist, histwidth, histheight, 1)
- || ResizeHistArray(p, &p->w_ahist, histwidth, histheight, 0)
- || ResizeHistArray(p, &p->w_fhist, histwidth, histheight, 0))
- {
- debug(" failed, removing all histbuf\n");
- FreeScrollback(p);
- Msg(0, strnomem);
- return -1;
- }
- if (p->w_histheight != histheight)
- p->w_histidx = 0;
- p->w_histheight = histheight;
-
- return 0;
-}
static void
-FreeScrollback(p)
-struct win *p;
+FreeMline(ml)
+struct mline *ml;
{
- FreeArray(&p->w_ihist, p->w_histheight);
- FreeArray(&p->w_ahist, p->w_histheight);
- FreeArray(&p->w_fhist, p->w_histheight);
- p->w_histheight = 0;
+ if (ml->image)
+ free(ml->image);
+ if (ml->attr && ml->attr != null)
+ free(ml->attr);
+ if (ml->font && ml->font != null)
+ free(ml->font);
+#ifdef COLOR
+ if (ml->color && ml->color != null)
+ free(ml->color);
+#endif
+ *ml = mline_zero;
}
static int
-ResizeHistArray(p, arr, wi, hi, fillblank)
-struct win *p;
-char ***arr;
-int wi, hi, fillblank;
+AllocMline(ml, w)
+struct mline *ml;
+int w;
{
- char **narr, **np, **onp, **onpe;
- int t, x, first;
-
- if (p->w_width == wi && p->w_histheight == hi)
- return(0);
- if (p->w_histheight != hi)
- {
- if ((narr = (char **)calloc(sizeof(char *), hi)) == NULL)
- {
- FreeArray(arr, p->w_histheight);
- return(-1);
- }
- np = narr;
- onp = (*arr) + p->w_histidx;
- onpe = (*arr) + p->w_histheight;
- first = p->w_histheight - hi;
- if (first < 0)
- np -= first;
- for(t = 0; t < p->w_histheight; t++)
- {
- ASSERT(*onp);
- if (t - first >= 0 && t - first < hi)
- *np++ = *onp;
- else if (*onp != null)
- free(*onp);
- if (++onp == onpe)
- onp = *arr;
- }
- if (*arr)
- free((char *)*arr);
- }
- else
- narr = *arr;
-
- for (t=0, np=narr; t < hi; t++, np++)
- {
- if ((!fillblank && *np == 0) || *np == null)
- {
- *np = null;
- continue;
- }
- x = p->w_width;
- if (*np == 0)
- {
- *np = (char *)malloc(wi + 1);
- x = 0;
- }
- else if (p->w_width != wi)
- {
- *np = (char *)xrealloc(*np, wi + 1);
- }
- if (*np == 0)
- {
- FreeArray(&narr, hi);
- return -1;
- }
- if (x > wi)
- x = wi;
- if (fillblank)
- bclear(*np + x, wi + 1 - x);
- else
- bzero(*np + x, wi + 1 - x);
- }
- *arr = narr;
+ ml->image = malloc(w);
+ ml->attr = null;
+ ml->font = null;
+#ifdef COLOR
+ ml->color = null;
+#endif
+ if (ml->image == 0)
+ return -1;
return 0;
}
-#endif /* COPY_PASTE */
-
+
static int
-ResizeScreenArray(p, arr, wi, hi, fillblank)
-struct win *p;
-char ***arr;
-int wi, hi, fillblank;
+BcopyMline(mlf, xf, mlt, xt, l, w)
+struct mline *mlf, *mlt;
+int xf, xt, l, w;
{
- int minr;
- char **cp;
-
- if (p->w_width == wi && p->w_height == hi)
- return(0);
+ int r = 0;
- if (hi > p->w_height)
- minr = p->w_height;
- else
- minr = hi;
-
- if (p->w_height > hi)
+ bcopy(mlf->image + xf, mlt->image + xt, l);
+ if (mlf->attr != null && mlt->attr == null)
{
- for (cp = *arr; cp < *arr + (p->w_height - hi); cp++)
- if (*cp != null)
- free(*cp);
- bcopy((char *)(*arr + (p->w_height - hi)), (char *)(*arr),
- hi * sizeof(char *));
+ if ((mlt->attr = malloc(w)) == 0)
+ mlt->attr = null, r = -1;
+ bzero(mlt->attr, w);
}
- if (*arr && p->w_width != wi)
- for (cp = *arr; cp < *arr + minr; cp++)
- {
- int x = p->w_width;
-
- if (*cp == null)
- continue;
- if ((*cp = (char *)xrealloc(*cp, (unsigned) wi + 1)) == 0)
- {
- FreeArray(arr, p->w_height);
- return(-1);
- }
- if (x > wi)
- x = wi;
- if (fillblank)
- bclear(*cp + x, wi + 1 - x);
- else
- bzero(*cp + x, wi + 1 - x);
- }
- if (*arr)
- *arr = (char **) xrealloc((char *) *arr, (unsigned) hi * sizeof(char *));
- else
- *arr = (char **) malloc((unsigned) hi * sizeof(char *));
- if (*arr == NULL)
- return -1;
- for (cp = *arr + p->w_height; cp < *arr + hi; cp++)
+ if (mlt->attr != null)
+ bcopy(mlf->attr + xf, mlt->attr + xt, l);
+ if (mlf->font != null && mlt->font == null)
{
- if (!fillblank)
- {
- *cp = null;
- continue;
- }
- if ((*cp = malloc((unsigned) wi + 1)) == 0)
- {
- while (--cp >= *arr)
- free(*cp);
- free((char *)*arr);
- *arr = NULL;
- return -1;
- }
- bclear(*cp, wi + 1);
+ if ((mlt->font = malloc(w)) == 0)
+ mlt->font = null, r = -1;
+ bzero(mlt->font, w);
}
- return 0;
+ if (mlt->font != null)
+ bcopy(mlf->font + xf, mlt->font + xt, l);
+#ifdef COLOR
+ if (mlf->color != null && mlt->color == null)
+ {
+ if ((mlt->color = malloc(w)) == 0)
+ mlt->color = null, r = -1;
+ bzero(mlt->color, w);
+ }
+ if (mlt->color != null)
+ bcopy(mlf->color + xf, mlt->color + xt, l);
+#endif
+ return r;
}
-static void
-FreeArray(arr, hi)
-char ***arr;
-int hi;
-{
- register char **p;
- register int t;
-
- if (*arr == 0)
- return;
- for (t = hi, p = *arr; t--; p++)
- if (*p && *p != null)
- free(*p);
- free((char *)*arr);
- *arr = 0;
-}
+static int maxwidth;
static void
CheckMaxSize(wi)
@@ -427,6 +301,7 @@ int wi;
char *oldnull = null;
struct win *p;
int i;
+ struct mline *ml;
wi = ((wi + 1) + 255) & ~255;
if (wi <= maxwidth)
@@ -436,186 +311,440 @@ int wi;
if (blank == 0)
blank = malloc((unsigned) maxwidth);
else
- blank = xrealloc(blank, (unsigned) maxwidth);
+ blank = xrealloc(blank, maxwidth);
if (null == 0)
null = malloc((unsigned) maxwidth);
else
- null = xrealloc(null, (unsigned) maxwidth);
- if (OldImage == 0)
- OldImage = malloc((unsigned) maxwidth);
+ null = xrealloc(null, maxwidth);
+ if (mline_old.image == 0)
+ mline_old.image = malloc((unsigned) maxwidth);
else
- OldImage = xrealloc(OldImage, (unsigned) maxwidth);
- if (OldAttr == 0)
- OldAttr = malloc((unsigned) maxwidth);
+ mline_old.image = xrealloc(mline_old.image, maxwidth);
+ if (mline_old.attr == 0)
+ mline_old.attr = malloc((unsigned) maxwidth);
else
- OldAttr = xrealloc(OldAttr, (unsigned) maxwidth);
- if (OldFont == 0)
- OldFont = malloc((unsigned) maxwidth);
+ mline_old.attr = xrealloc(mline_old.attr, maxwidth);
+ if (mline_old.font == 0)
+ mline_old.font = malloc((unsigned) maxwidth);
else
- OldFont = xrealloc(OldFont, (unsigned) maxwidth);
- if (!(blank && null && OldImage && OldAttr && OldFont))
+ mline_old.font = xrealloc(mline_old.font, maxwidth);
+#ifdef COLOR
+ if (mline_old.color == 0)
+ mline_old.color = malloc((unsigned) maxwidth);
+ else
+ mline_old.color = xrealloc(mline_old.color, maxwidth);
+ if (!(blank && null && mline_old.image && mline_old.attr
+ && mline_old.font && mline_old.color))
{
Panic(0, "Out of memory -> Game over!!");
/*NOTREACHED*/
}
+#else
+ if (!(blank && null && mline_old.image && mline_old.attr
+ && mline_old.font))
+ {
+ Panic(0, "Out of memory -> Game over!!");
+ /*NOTREACHED*/
+ }
+#endif
MakeBlankLine(blank, maxwidth);
bzero(null, maxwidth);
+ mline_blank.image = blank;
+ mline_blank.attr = null;
+ mline_blank.font = null;
+ mline_null.image = null;
+ mline_null.attr = null;
+ mline_null.font = null;
+#ifdef COLOR
+ mline_blank.color = null;
+ mline_null.color = null;
+#endif
+
/* We have to run through all windows to substitute
* the null references.
*/
for (p = windows; p; p = p->w_next)
{
- for (i = 0; i < p->w_height; i++)
+ ml = p->w_mlines;
+ for (i = 0; i < p->w_height; i++, ml++)
{
- if (p->w_attr[i] == oldnull)
- p->w_attr[i] = null;
- if (p->w_font[i] == oldnull)
- p->w_font[i] = null;
+ if (ml->attr == oldnull)
+ ml->attr = null;
+ if (ml->font == oldnull)
+ ml->font = null;
+#ifdef COLOR
+ if (ml->color== oldnull)
+ ml->color= null;
+#endif
}
#ifdef COPY_PASTE
- for (i = 0; i < p->w_histheight; i++)
+ ml = p->w_hlines;
+ for (i = 0; i < p->w_histheight; i++, ml++)
{
- if (p->w_ahist[i] == oldnull)
- p->w_ahist[i] = null;
- if (p->w_fhist[i] == oldnull)
- p->w_fhist[i] = null;
+ if (ml->attr == oldnull)
+ ml->attr = null;
+ if (ml->font == oldnull)
+ ml->font = null;
+# ifdef COLOR
+ if (ml->color== oldnull)
+ ml->color= null;
+# endif
}
#endif
}
}
+char *
+xrealloc(mem, len)
+char *mem;
+int len;
+{
+ register char *nmem;
+
+ if ((nmem = realloc(mem, len)))
+ return nmem;
+ free(mem);
+ return (char *)0;
+}
+
+static void
+MakeBlankLine(p, n)
+register char *p;
+register int n;
+{
+ while (n--)
+ *p++ = ' ';
+}
+
+
+
+
+#ifdef COPY_PASTE
+
+#define OLDWIN(y) ((y < p->w_histheight) \
+ ? &p->w_hlines[(p->w_histidx + y) % p->w_histheight] \
+ : &p->w_mlines[y - p->w_histheight])
+
+#define NEWWIN(y) ((y < hi) ? &nhlines[y] : &nmlines[y - hi])
+
+#else
+
+#define OLDWIN(y) (&p->w_mlines[y])
+#define NEWWIN(y) (&nmlines[y])
+
+#endif
+
+
int
-ChangeWindowSize(p, wi, he)
+ChangeWindowSize(p, wi, he, hi)
struct win *p;
-int wi, he;
+int wi, he, hi;
{
- int t, scr;
-
- CheckMaxSize(wi);
-
- if (wi == p->w_width && he == p->w_height)
+ struct mline *mlf = 0, *mlt = 0, *ml, *nmlines, *nhlines;
+ int fy, ty, l, lx, lf, lt, yy, oty, addone;
+ int ncx, ncy, naka, t;
+
+ if (wi == 0)
+ he = hi = 0;
+
+ if (p->w_width == wi && p->w_height == he && p->w_histheight == hi)
{
debug("ChangeWindowSize: No change.\n");
return 0;
}
- debug2("ChangeWindowSize from (%d,%d) to ", p->w_width, p->w_height);
- debug2("(%d,%d)\n", wi, he);
- if (p->w_lay != &p->w_winlay)
+ CheckMaxSize(wi);
+
+ /* just in case ... */
+ if (wi && (p->w_width != wi || p->w_height != he) && p->w_lay != &p->w_winlay)
{
- debug("ChangeWindowSize: No resize because of overlay.\n");
+ debug("ChangeWindowSize: No resize because of overlay?\n");
return -1;
}
- if (wi == 0 && he == 0)
+
+ debug("ChangeWindowSize");
+ debug3(" from (%d,%d)+%d", p->w_width, p->w_height, p->w_histheight);
+ debug3(" to(%d,%d)+%d\n", wi, he, hi);
+
+ fy = p->w_histheight + p->w_height - 1;
+ ty = hi + he - 1;
+
+ nmlines = nhlines = 0;
+ ncx = 0;
+ ncy = 0;
+ naka = 0;
+
+ if (wi)
{
- FreeArray(&p->w_image, p->w_height);
- FreeArray(&p->w_attr, p->w_height);
- FreeArray(&p->w_font, p->w_height);
- if (p->w_tabs)
- free(p->w_tabs);
- p->w_tabs = NULL;
- p->w_width = 0;
- p->w_height = 0;
+ if (wi != p->w_width || he != p->w_height)
+ {
+ if ((nmlines = (struct mline *)calloc(he, sizeof(struct mline))) == 0)
+ {
+ KillWindow(p);
+ Msg(0, strnomem);
+ return -1;
+ }
+ }
+ else
+ {
+ debug1("image stays the same: %d lines\n", he);
+ nmlines = p->w_mlines;
+ fy -= he;
+ ty -= he;
+ ncx = p->w_x;
+ ncy = p->w_y;
+ naka = p->w_autoaka;
+ }
+ }
#ifdef COPY_PASTE
- FreeScrollback(p);
+ if (hi)
+ {
+ if ((nhlines = (struct mline *)calloc(hi, sizeof(struct mline))) == 0)
+ {
+ Msg(0, "No memory for history buffer - turned off");
+ hi = 0;
+ ty = he - 1;
+ }
+ }
#endif
- return 0;
+
+ /* special case: cursor is at magic margin position */
+ addone = 0;
+ if (p->w_width && p->w_x == p->w_width)
+ {
+ debug2("Special addone case: %d %d\n", p->w_x, p->w_y);
+ addone = 1;
+ p->w_x--;
}
- /* when window gets smaller, scr is the no. of lines we scroll up */
- scr = p->w_height - he;
- if (scr < 0)
- scr = 0;
-#ifdef COPY_PASTE
- for (t = 0; t < scr; t++)
- AddLineToHist(p, p->w_image+t, p->w_attr+t, p->w_font+t);
-#endif
- if (ResizeScreenArray(p, &p->w_image, wi, he, 1)
- || ResizeScreenArray(p, &p->w_attr, wi, he, 0)
- || ResizeScreenArray(p, &p->w_font, wi, he, 0))
+ debug2("fy %d ty %d\n", fy, ty);
+ if (fy >= 0)
+ mlf = OLDWIN(fy);
+ if (ty >= 0)
+ mlt = NEWWIN(ty);
+
+ while (fy >= 0 && ty >= 0)
{
-nomem: KillWindow(p);
- Msg(0, "Out of memory -> Window destroyed !!");
- return -1;
+ if (p->w_width == wi)
+ {
+ /* here is a simple shortcut: just copy over */
+ *mlt = *mlf;
+ *mlf = mline_zero;
+ if (fy == p->w_y + p->w_histheight)
+ {
+ ncx = p->w_x + addone;
+ ncy = ty - hi >= 0 ? ty - hi : 0;
+ }
+ if (p->w_autoaka > 0 && fy == p->w_autoaka - 1 + p->w_histheight)
+ naka = ty - hi >= 0 ? 1 + ty - hi : 0;
+ if (--fy >= 0)
+ mlf = OLDWIN(fy);
+ if (--ty >= 0)
+ mlt = NEWWIN(ty);
+ continue;
+ }
+
+ /* calculate lenght */
+ for (l = p->w_width - 1; l > 0; l--)
+ if (mlf->image[l] != ' ' || mlf->attr[l])
+ break;
+ if (fy == p->w_y + p->w_histheight && l < p->w_x)
+ l = p->w_x; /* cursor is non blank */
+ l++;
+ lf = l;
+
+ /* add wrapped lines to length */
+ for (yy = fy - 1; yy >= 0; yy--)
+ {
+ ml = OLDWIN(yy);
+ if (ml->image[p->w_width] == ' ')
+ break;
+ l += p->w_width;
+ }
+
+ /* rewrap lines */
+ lt = (l - 1) % wi + 1; /* lf is set above */
+ oty = ty;
+ while (l > 0 && fy >= 0 && ty >= 0)
+ {
+ lx = lt > lf ? lf : lt;
+ if (mlt->image == 0)
+ {
+ if (AllocMline(mlt, wi + 1))
+ goto nomem;
+ MakeBlankLine(mlt->image + lt, wi - lt);
+ mlt->image[wi] = ((oty == ty) ? ' ' : 0);
+ }
+ if (BcopyMline(mlf, lf - lx, mlt, lt - lx, lx, wi + 1))
+ goto nomem;
+
+ /* did we copy the cursor ? */
+ if (fy == p->w_y + p->w_histheight && lf - lx <= p->w_x && lf > p->w_x)
+ {
+ ncx = p->w_x + lt - lf + addone;
+ ncy = ty - hi >= 0 ? ty - hi : 0;
+ }
+ /* did we copy autoaka line ? */
+ if (p->w_autoaka > 0 && fy == p->w_autoaka - 1 + p->w_histheight && lf - lx <= 0)
+ naka = ty - hi >= 0 ? 1 + ty - hi : 0;
+
+ lf -= lx;
+ lt -= lx;
+ l -= lx;
+ if (lf == 0)
+ {
+ FreeMline(mlf);
+ lf = p->w_width;
+ if (--fy >= 0)
+ mlf = OLDWIN(fy);
+ }
+ if (lt == 0)
+ {
+ lt = wi;
+ if (--ty >= 0)
+ mlt = NEWWIN(ty);
+ }
+ }
+ ASSERT(l != 0 || fy == yy);
}
- /* this won't change the D_height of the scrollback history buffer, but
- * it will check the D_width of the lines.
- */
+ while (fy >= 0)
+ {
+ FreeMline(mlf);
+ if (--fy >= 0)
+ mlf = OLDWIN(fy);
+ }
+ while (ty >= 0)
+ {
+ if (AllocMline(mlt, wi + 1))
+ goto nomem;
+ MakeBlankLine(mlt->image, wi + 1);
+ if (--ty >= 0)
+ mlt = NEWWIN(ty);
+ }
+
+#ifdef DEBUG
+ if (nmlines != p->w_mlines)
+ for (fy = 0; fy < p->w_height + p->w_histheight; fy++)
+ {
+ ml = OLDWIN(fy);
+ ASSERT(ml->image == 0);
+ }
+#endif
+
+ if (p->w_mlines && p->w_mlines != nmlines)
+ free((char *)p->w_mlines);
+ p->w_mlines = nmlines;
#ifdef COPY_PASTE
- ChangeScrollback(p, p->w_histheight, wi);
+ if (p->w_hlines && p->w_hlines != nhlines)
+ free((char *)p->w_hlines);
+ p->w_hlines = nhlines;
#endif
+ nmlines = nhlines = 0;
- if (p->w_tabs == 0)
+ /* change tabs */
+ if (p->w_width != wi)
{
- /* tabs get D_width+1 because 0 <= x <= wi */
- if ((p->w_tabs = malloc((unsigned) wi + 1)) == 0)
- goto nomem;
- t = 8;
- }
- else
- {
- if ((p->w_tabs = xrealloc(p->w_tabs, (unsigned) wi + 1)) == 0)
- goto nomem;
- t = p->w_width;
+ if (wi)
+ {
+ if (p->w_tabs == 0)
+ {
+ /* tabs get wi+1 because 0 <= x <= wi */
+ p->w_tabs = malloc((unsigned) wi + 1);
+ t = 8;
+ }
+ else
+ {
+ p->w_tabs = xrealloc(p->w_tabs, wi + 1);
+ t = p->w_width;
+ }
+ if (p->w_tabs == 0)
+ {
+ nomem:
+ if (nmlines)
+ {
+ for (ty = he + hi - 1; ty >= 0; ty--)
+ {
+ mlt = NEWWIN(ty);
+ FreeMline(mlt);
+ }
+ if (nmlines && p->w_mlines != nmlines)
+ free((char *)nmlines);
+#ifdef COPY_PASTE
+ if (nhlines && p->w_hlines != nhlines)
+ free((char *)nhlines);
+#endif
+ }
+ KillWindow(p);
+ Msg(0, strnomem);
+ return -1;
+ }
+ for (t = (t + 7) & 8; t < wi; t += 8)
+ p->w_tabs[t] = 1;
+ }
+ else
+ {
+ if (p->w_tabs)
+ free(p->w_tabs);
+ p->w_tabs = 0;
+ }
}
- for (t = (t + 7) & 8; t < wi; t += 8)
- p->w_tabs[t] = 1;
- p->w_height = he;
- p->w_width = wi;
- if (p->w_x >= wi)
- p->w_x = wi - 1;
- if ((p->w_y -= scr) < 0)
- p->w_y = 0;
- if (p->w_Saved_x >= wi)
- p->w_Saved_x = wi - 1;
- if ((p->w_Saved_y -= scr) < 0)
+
+ /* Change w_Saved_y - this is only an estimate... */
+ p->w_Saved_y += ncy - p->w_y;
+
+ p->w_x = ncx;
+ p->w_y = ncy;
+ if (p->w_autoaka > 0)
+ p->w_autoaka = naka;
+
+ /* do sanity checks */
+ if (p->w_x > wi)
+ p->w_x = wi;
+ if (p->w_y >= he)
+ p->w_y = he - 1;
+ if (p->w_Saved_x > wi)
+ p->w_Saved_x = wi;
+ if (p->w_Saved_y < 0)
p->w_Saved_y = 0;
- if (p->w_autoaka > 0)
- if ((p->w_autoaka -= scr) < 1)
- p->w_autoaka = 1;
+ if (p->w_Saved_y >= he)
+ p->w_Saved_y = he - 1;
+
+ /* reset scrolling region */
p->w_top = 0;
p->w_bot = he - 1;
+
+ /* signal new size to window */
#ifdef TIOCSWINSZ
- if (p->w_ptyfd >= 0 && p->w_pid)
+ if (wi && (p->w_width != wi || p->w_height != he) && p->w_ptyfd >= 0 && p->w_pid)
{
glwz.ws_col = wi;
glwz.ws_row = he;
debug("Setting pty winsize.\n");
if (ioctl(p->w_ptyfd, TIOCSWINSZ, (char *)&glwz))
debug2("SetPtySize: errno %d (fd:%d)\n", errno, p->w_ptyfd);
-# if defined(STUPIDTIOCSWINSZ) && defined(SIGWINCH)
-# ifdef POSIX
- pgrp = tcgetpgrp(p->w_ptyfd);
-# else /* POSIX */
- if (ioctl(p->w_ptyfd, TIOCGPGRP, (char *)&pgrp))
- pgrp = 0;
-# endif /* POSIX */
- if (pgrp)
- {
- debug1("Sending SIGWINCH to pgrp %d.\n", pgrp);
- if (killpg(pgrp, SIGWINCH))
- debug1("killpg: errno %d\n", errno);
- }
- else
- debug1("Could not get pgrp: errno %d\n", errno);
-# endif /* STUPIDTIOCSWINSZ */
}
#endif /* TIOCSWINSZ */
- return 0;
-}
-
-char *
-xrealloc(mem, len)
-char *mem;
-int len;
-{
- register char *nmem;
+ /* store new size */
+ p->w_width = wi;
+ p->w_height = he;
+#ifdef COPY_PASTE
+ p->w_histidx = 0;
+ p->w_histheight = hi;
+#endif
- if ((nmem = realloc(mem, len)))
- return(nmem);
- free(mem);
- return((char *)0);
+#ifdef DEBUG
+ /* Test if everything was ok */
+ for (fy = 0; fy < p->w_height + p->w_histheight; fy++)
+ {
+ ml = OLDWIN(fy);
+ ASSERT(ml->image);
+ for (l = 0; l < p->w_width; l++)
+ ASSERT((unsigned char)ml->image[l] >= ' ');
+ }
+#endif
+ return 0;
}
+
diff --git a/src/screen.c b/src/screen.c
index 577b4bd..ba17173 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -70,6 +71,15 @@ RCS_ID("$Id$ FAU")
#include "patchlevel.h"
+/*
+ * At the moment we only need the real password if the
+ * builtin lock is used. Therefore disable SHADOWPW if
+ * we do not really need it (kind of security thing).
+ */
+#ifndef LOCK
+# undef SHADOWPW
+#endif
+
#include <pwd.h>
#ifdef SHADOWPW
# include <shadow.h>
@@ -107,7 +117,6 @@ char *ShellArgs[2];
extern struct NewWindow nwin_undef, nwin_default, nwin_options;
-static char *MakeWinMsg __P((char *, int));
static void SigChldHandler __P((void));
static sigret_t SigChld __P(SIGPROTOARG);
static sigret_t SigInt __P(SIGPROTOARG);
@@ -117,10 +126,6 @@ static void DoWait __P((void));
static void WindowDied __P((struct win *));
-#ifdef PASSWORD
-extern char Password[];
-#endif
-
int nversion; /* numerical version, used for secondary DA */
/* the attacher */
@@ -140,7 +145,7 @@ char *RcFileName = NULL;
extern char Esc;
char *home;
-char *screenlogdir = NULL;
+char *screenlogfile;
char *hardcopydir = NULL;
char *BellString;
char *VisualBellString;
@@ -344,6 +349,14 @@ char **av;
#if (defined(AUX) || defined(_AUX_SOURCE)) && defined(POSIX)
setcompat(COMPAT_POSIX|COMPAT_BSDPROT); /* turn on seteuid support */
#endif
+#if defined(sun) && defined(SVR4)
+ {
+ /* Solaris' login blocks SIGHUP! This is _very bad_ */
+ sigset_t sset;
+ sigemptyset(&sset);
+ sigprocmask(SIG_SETMASK, &sset, 0);
+ }
+#endif
/*
* First, close all unused descriptors
@@ -418,6 +431,7 @@ char **av;
BellString = SaveStr("Bell in window %");
VisualBellString = SaveStr(" Wuff, Wuff!! ");
ActivityString = SaveStr("Activity in window %");
+ screenlogfile = SaveStr("screenlog.%n");
#ifdef COPY_PASTE
BufferFile = SaveStr(DEFAULT_BUFFERFILE);
#endif
@@ -486,7 +500,7 @@ char **av;
exit_with_usage(myname);
ap = *++av;
}
- if (ParseEscape(NULL, ap))
+ if (ParseEscape((struct user *)0, ap))
Panic(0, "Two characters are required with -e option.");
break;
case 'f':
@@ -772,6 +786,45 @@ char **av;
}
LoginName = ppp->pw_name;
}
+ /* Do password sanity check..., allow ##user for SUN_C2 security */
+#ifdef SHADOWPW
+pw_try_again:
+#endif
+ n = 0;
+ if (ppp->pw_passwd[0] == '#' && ppp->pw_passwd[1] == '#' &&
+ strcmp(ppp->pw_passwd + 2, ppp->pw_name) == 0)
+ n = 13;
+ for (; n < 13; n++)
+ {
+ char c = ppp->pw_passwd[n];
+ if (!(c == '.' || c == '/' ||
+ (c >= '0' && c <= '9') ||
+ (c >= 'a' && c <= 'z') ||
+ (c >= 'A' && c <= 'Z')))
+ break;
+ }
+#ifdef SHADOWPW
+ /* try to determine real password */
+ {
+ static struct spwd *sss;
+ if (n < 13 && sss == 0)
+ {
+ sss = getspnam(ppp->pw_name);
+ if (sss)
+ {
+ ppp->pw_passwd = SaveStr(sss->sp_pwdp);
+ endspent(); /* this should delete all buffers ... */
+ goto pw_try_again;
+ }
+ endspent(); /* this should delete all buffers ... */
+ }
+ }
+#endif
+ if (n < 13)
+ ppp->pw_passwd = 0;
+ if (ppp->pw_passwd && strlen(ppp->pw_passwd) > 13)
+ ppp->pw_passwd[13] = 0; /* beware of linux's long passwords */
+
home = getenv("HOME");
#if !defined(SOCKDIR) && defined(MULTIUSER)
if (multi && !multiattach)
@@ -786,9 +839,6 @@ char **av;
Panic(0, "LoginName too long - sorry.");
if (strlen(home) > MAXPATHLEN - 25)
Panic(0, "$HOME too long - sorry.");
-#ifdef PASSWORD
- strcpy(Password, ppp->pw_passwd);
-#endif
if (!detached && !lsflag)
{
@@ -910,28 +960,23 @@ char **av;
}
if (stat(SockPath, &st) == -1)
+ Panic(errno, "Cannot access %s", SockPath);
+ if (!S_ISDIR(st.st_mode))
+ Panic(0, "%s is not a directory.", SockPath);
+#ifdef MULTIUSER
+ if (multi)
{
- Panic(errno, "Cannot access %s", SockPath);
+ if (st.st_uid != multi_uid)
+ Panic(0, "%s is not the owner of %s.", multi, SockPath);
}
else
- {
- if (!S_ISDIR(st.st_mode))
- Panic(0, "%s is not a directory.", SockPath);
-#ifdef MULTIUSER
- if (multi)
- {
- if (st.st_uid != multi_uid)
- Panic(0, "%s is not the owner of %s.", multi, SockPath);
- }
- else
#endif
- {
- if (st.st_uid != real_uid)
- Panic(0, "You are not the owner of %s.", SockPath);
- }
- if ((st.st_mode & 0777) != 0700)
- Panic(0, "Directory %s must have mode 700.", SockPath);
+ {
+ if (st.st_uid != real_uid)
+ Panic(0, "You are not the owner of %s.", SockPath);
}
+ if ((st.st_mode & 0777) != 0700)
+ Panic(0, "Directory %s must have mode 700.", SockPath);
SockName = SockPath + strlen(SockPath) + 1;
*SockName = 0;
(void) umask(oumask);
@@ -980,9 +1025,6 @@ char **av;
if (rflag || xflag)
{
debug("screen -r: - is there anybody out there?\n");
-#ifdef SHADOWPW
- setspent(); /* open shadow file while we are still root */
-#endif /* SHADOWPW */
if (Attach(MSG_ATTACH))
{
Attacher();
@@ -1043,9 +1085,6 @@ char **av;
socknamebuf[NAME_MAX] = 0;
#endif
sprintf(SockPath + strlen(SockPath), "/%s", socknamebuf);
-#ifdef SHADOWPW
- setspent(); /* open shadow file while we are still root */
-#endif /* SHADOWPW */
setuid(real_uid);
setgid(real_gid);
eff_uid = real_uid;
@@ -1096,6 +1135,13 @@ char **av;
freopen("/dev/null", "w", stderr);
debug("-- screen.back debug started\n");
+ /*
+ * This guarantees that the session owner is listed, even when we
+ * start detached. From now on we should not refer to 'LoginName'
+ * any more, use users->u_name instead.
+ */
+ if (UserAdd(LoginName, (char *)0, (struct user **)0) < 0)
+ Panic(0, "Could not create user info");
if (!detached)
{
#ifdef FORKDEBUG
@@ -1161,9 +1207,8 @@ char **av;
#endif
}
else
- {
- MakeTermcap(1);
- }
+ MakeTermcap(1);
+
#ifdef LOADAV
InitLoadav();
#endif /* LOADAV */
@@ -1203,13 +1248,13 @@ char **av;
debug("We open one default window, as screenrc did not specify one.\n");
if (MakeWindow(&nwin) == -1)
{
- AddStr("Sorry, could not find a PTY.");
- sleep(2);
+ Msg(0, "Sorry, could not find a PTY.");
+ sleep(5);
Finit(0);
/* NOTREACHED */
}
}
- if (default_startup)
+ if (display && default_startup)
display_copyright();
signal(SIGCHLD, SigChld);
signal(SIGINT, SigInt);
@@ -1309,7 +1354,7 @@ char **av;
*/
#ifdef DEBUG
if (tv.tv_sec)
- debug1("select timeout %d seconds\n", tv.tv_sec);
+ debug1("select timeout %d seconds\n", (int)tv.tv_sec);
#endif
mkfdsets(&r, &w);
if (GotSigChld && !tv.tv_sec)
@@ -1362,9 +1407,9 @@ char **av;
debug1("Flushing map sequence (%d runs)\n", D_seqruns);
fore = D_fore;
D_seqp -= D_seql;
- while (D_seql)
- Process(&D_seqp, &D_seql);
+ ProcessInput2(D_seqp, D_seql);
D_seqp = D_kmaps[0].seq;
+ D_seql = 0;
}
}
#endif
@@ -1728,7 +1773,7 @@ char **av;
{
p->w_bell = BELL_MSG;
for (display = displays; display; display = display->d_next)
- Msg(0, MakeWinMsg(BellString, p->w_number));
+ Msg(0, "%s", MakeWinMsg(BellString, p, '%'));
if (p->w_monitor == MON_FOUND)
p->w_monitor = MON_DONE;
}
@@ -1750,7 +1795,7 @@ char **av;
{
p->w_monitor = MON_MSG;
for (display = displays; display; display = display->d_next)
- Msg(0, MakeWinMsg(ActivityString, p->w_number));
+ Msg(0, "%s", MakeWinMsg(ActivityString, p, '%'));
}
}
#if defined(DEBUG) && !defined(SELECT_BROKEN)
@@ -1848,7 +1893,7 @@ SigHup SIGDEFARG
/*
* the backend's Interrupt handler
- * we cannot D_insert the intrc directly, as we never know
+ * we cannot insert the intrc directly, as we never know
* if fore is valid.
*/
static sigret_t
@@ -1901,6 +1946,7 @@ CoreDump SIGDEFARG
Kill(disp->d_userpid, SIG_BYE);
}
#if defined(SHADOWPW) && !defined(DEBUG) && !defined(DUMPSHADOW)
+ Kill(getpid(), SIGKILL);
eexit(11);
#else /* SHADOWPW && !DEBUG */
abort();
@@ -2001,6 +2047,11 @@ DoWait()
static sigret_t
FinitHandler SIGDEFARG
{
+#ifdef SIGHASARG
+ debug1("FinitHandler called, sig %d.\n", sigsig);
+#else
+ debug("FinitHandler called.\n");
+#endif
Finit(1);
SIGRETURN;
}
@@ -2187,7 +2238,6 @@ int mode;
SetTTY(D_userfd, &D_OldMode);
fcntl(D_userfd, F_SETFL, 0);
}
- freetty();
pid = D_userpid;
debug2("display: %#x displays: %#x\n", (unsigned int)display, (unsigned int)displays);
FreeDisplay();
@@ -2383,46 +2433,137 @@ unsigned long p1, p2, p3, p4, p5, p6;
/*
* '^' is allowed as an escape mechanism for control characters. jw.
+ *
+ * Added time insertion using ideas/code from /\ndy Jones
+ * (andy@lingua.cltr.uq.OZ.AU) - thanks a lot!
+ *
*/
-static char *
-MakeWinMsg(s, n)
+
+static const char days[] = "SunMonTueWedThuFriSat";
+static const char months[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
+
+char *
+MakeWinMsg(s, win, esc)
register char *s;
-int n;
+struct win *win;
+int esc;
{
static char buf[MAXSTR];
register char *p = buf;
register int ctrl;
+ time_t now;
+ struct tm *tm;
+ int l;
+ tm = 0;
ctrl = 0;
- for (; *s && p < buf + MAXSTR - 1; s++, p++)
- if (ctrl)
- {
- ctrl = 0;
- if (*s == '^' || *s < 64)
- *p = *s;
- else
- *p = *s - 64;
- }
- else
- {
- switch (*s)
- {
- case '%':
- sprintf(p, "%d", n);
- p += strlen(p) - 1;
- break;
- case '~':
- *p = BELL;
- break;
- case '^':
- ctrl = 1;
- *p-- = '^';
- break;
- default:
- *p = *s;
+ for (; *s && (l = buf + MAXSTR - 1 - p) > 0; s++, p++, l--)
+ {
+ *p = *s;
+ if (ctrl)
+ {
+ ctrl = 0;
+ if (*s != '^' && *s >= 64)
+ *p &= 0x1f;
+ continue;
+ }
+ if (*s != esc)
+ {
+ if (esc == '%')
+ {
+ switch (*s)
+ {
+ case '~':
+ *p = BELL;
+ break;
+ case '^':
+ ctrl = 1;
+ *p-- = '^';
+ break;
+ default:
+ break;
+ }
+ }
+ continue;
+ }
+ if (s[1] == esc) /* double escape ? */
+ {
+ s++;
+ continue;
+ }
+ switch (s[1])
+ {
+ case 'd': case 'D': case 'm': case 'M': case 'y': case 'Y':
+ case 'a': case 'A': case 's': case 'w': case 'W':
+ s++;
+ if (l < 4)
break;
- }
- }
+ if (tm == 0)
+ {
+ (void)time(&now);
+ tm = localtime(&now);
+ }
+ switch (*s)
+ {
+ case 'd':
+ sprintf(p, "%02d", tm->tm_mday % 100);
+ break;
+ case 'D':
+ sprintf(p, "%3.3s", days + 3 * tm->tm_wday);
+ break;
+ case 'm':
+ sprintf(p, "%02d", tm->tm_mon + 1);
+ break;
+ case 'M':
+ sprintf(p, "%3.3s", months + 3 * tm->tm_mon);
+ break;
+ case 'y':
+ sprintf(p, "%02d", tm->tm_year % 100);
+ break;
+ case 'Y':
+ sprintf(p, "%04d", tm->tm_year + 1900);
+ break;
+ case 'a':
+ sprintf(p, tm->tm_hour >= 12 ? "pm" : "am");
+ break;
+ case 'A':
+ sprintf(p, tm->tm_hour >= 12 ? "PM" : "AM");
+ break;
+ case 's':
+ sprintf(p, "%02d", tm->tm_sec);
+ break;
+ case 'w':
+ sprintf(p, "%2d:%02d", tm->tm_hour, tm->tm_min);
+ break;
+ case 'W':
+ sprintf(p, "%2d:%02d", (tm->tm_hour + 11) % 12 + 1, tm->tm_min);
+ break;
+ default:
+ break;
+ }
+ p += strlen(p) - 1;
+ break;
+ case 't':
+ if (strlen(win->w_title) < l)
+ {
+ strcpy(p, win->w_title);
+ p += strlen(p) - 1;
+ }
+ /* FALLTHROUGH */
+ s++;
+ break;
+ case 'n':
+ s++;
+ /* FALLTHROUGH */
+ default:
+ if (l > 10)
+ {
+ sprintf(p, "%d", win->w_number);
+ p += strlen(p) - 1;
+ }
+ break;
+ }
+ }
*p = '\0';
return buf;
}
@@ -2452,3 +2593,4 @@ int n;
}
debug1("DisplaySleep(%d) ending\n", n);
}
+
diff --git a/src/screen.h b/src/screen.h
index 017af90..d00edea 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
* $Id$ FAU
@@ -37,7 +38,7 @@
#include "osdef.h"
#include "ansi.h"
-#include "acl.h"
+#include "acls.h"
#include "comm.h"
#include "overlay.h"
#include "term.h"
@@ -119,13 +120,14 @@ struct mode
int m_ldisc;
int m_lmode;
# endif /* TERMIO */
-#if defined(KANJI) && defined(TIOCKSET)
+#if defined(KANJI) && defined(TIOCKSET) && defined(KM_ASCII) && defined(KM_SYSSJIS)
struct jtchars m_jtchars;
int m_knjmode;
# endif
#endif /* POSIX */
};
+#include "image.h"
#include "display.h"
#include "window.h"
@@ -228,6 +230,7 @@ extern char strnomem[];
#define INP_COOKED 0
#define INP_NOECHO 1
#define INP_RAW 2
+#define INP_EVERY 4
#ifdef MULTIUSER
diff --git a/src/search.c b/src/search.c
index 25610ed..c5fa127 100644
--- a/src/search.c
+++ b/src/search.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -52,9 +53,9 @@ int dir;
{
markdata = (struct markdata *)D_lay->l_data;
if (markdata->isdir > 0)
- searchend(0, 0);
+ searchend((char *)0, 0);
else if (markdata->isdir < 0)
- backsearchend(0, 0);
+ backsearchend((char *)0, 0);
else
Msg(0, "No previous pattern");
}
@@ -126,9 +127,11 @@ char *pattern;
int y, sx, ex;
{
char *ip, *ipe, *cp, *pp;
+ struct mline *ml;
- ip = iWIN(y) + sx;
- ipe = iWIN(y) + D_width;
+ ml = WIN(y);
+ ip = ml->image + sx;
+ ipe = ml->image + D_width;
for (;sx <= ex; sx++)
{
cp = ip++;
@@ -189,7 +192,7 @@ int l, p, end, dir;
s = str;
for (i = 0;;)
{
- c = iWIN(q / w)[q % w];
+ c = (WIN(q / w))->image[q % w];
if (i == 0)
p += tab[(int)(unsigned char) c];
if (c != *s)
@@ -263,7 +266,7 @@ int n;
markdata->isstr[markdata->isstrl++] = *p;
markdata->isistr[markdata->isistrl++] = *p;
markdata->isstr[markdata->isstrl] = 0;
- debug2("New char: %c - left %d\n", *p, sizeof(markdata->isistr) - markdata->isistrl);
+ debug2("New char: %c - left %d\n", *p, (int)sizeof(markdata->isistr) - markdata->isistrl);
}
if (*p && *p != '\b')
pos = is_bm(markdata->isstr, markdata->isstrl, pos, D_width * (fore->w_histheight + D_height), markdata->isdir);
@@ -276,9 +279,7 @@ int n;
RefreshLine(STATLINE, 0, D_width - 1, 0);
revto(x, y);
if (W2D(markdata->cy) == STATLINE)
- {
- revto_line(markdata->cx, markdata->cy, STATLINE > 0 ? STATLINE - 1 : 1);
- }
+ revto_line(markdata->cx, markdata->cy, STATLINE > 0 ? STATLINE - 1 : 1);
);
}
if (*p)
@@ -327,9 +328,7 @@ int dir;
markdata->isstartpos = markdata->cx + markdata->cy * D_width;
markdata->isistrl = markdata->isstrl = 0;
if (W2D(markdata->cy) == STATLINE)
- {
- revto_line(markdata->cx, markdata->cy, STATLINE > 0 ? STATLINE - 1 : 1);
- }
+ revto_line(markdata->cx, markdata->cy, STATLINE > 0 ? STATLINE - 1 : 1);
Input(isprompts[dir + 1], sizeof(markdata->isstr) - 1, is_process, INP_RAW);
GotoPos(markdata->cx, W2D(markdata->cy));
}
diff --git a/src/socket.c b/src/socket.c
index 4c38fab..8277654 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -872,7 +873,7 @@ ReceiveMsg()
if (left > 0)
{
if (left != sizeof(m))
- Msg(0, "Message %d of %d bytes too small", left, sizeof(m));
+ Msg(0, "Message %d of %d bytes too small", left, (int)sizeof(m));
else
debug("No data on socket.\n");
return;
diff --git a/src/tek.patch b/src/tek.patch
index 1c66e37..10e0868 100644
--- a/src/tek.patch
+++ b/src/tek.patch
@@ -7,10 +7,10 @@ Zhang (zhang@gmsds.ms.ornl.gov) and to screen@uni-erlangen.de
=====================================================================
-*** ansi.h.orig Sun Nov 6 23:55:35 1994
---- ansi.h Mon Dec 19 22:14:04 1994
+*** ./ansi.h.orig Fri Jan 2 19:12:05 1970
+--- ./ansi.h Wed Nov 15 19:25:11 1995
***************
-*** 55,61 ****
+*** 56,62 ****
PRIN, /* Printer mode */
PRINESC, /* ESC seen in printer mode */
PRINCSI, /* CSI seen in printer mode */
@@ -18,22 +18,22 @@ Zhang (zhang@gmsds.ms.ornl.gov) and to screen@uni-erlangen.de
};
enum string_t
---- 55,64 ----
+--- 56,65 ----
PRIN, /* Printer mode */
PRINESC, /* ESC seen in printer mode */
PRINCSI, /* CSI seen in printer mode */
! PRIN4, /* CSI 4 seen in printer mode */
-! TEK, /* Tektronics mode */
-! TEKESC, /* Tektronics escape */
-! TEKEND /* Tektronics ending sequence */
+! TEK, /* Tektronix mode */
+! TEKESC, /* Tektronix escape */
+! TEKEND /* Tektronix ending sequence */
};
enum string_t
-*** ansi.c.orig Wed Dec 14 00:52:26 1994
---- ansi.c Mon Dec 19 22:39:16 1994
+*** ./ansi.c.orig Sun Oct 29 16:01:26 1995
+--- ./ansi.c Wed Nov 15 19:25:11 1995
***************
-*** 698,703 ****
---- 698,708 ----
+*** 805,810 ****
+--- 805,815 ----
case 'k':
StartString(AKA);
break;
@@ -44,10 +44,10 @@ Zhang (zhang@gmsds.ms.ornl.gov) and to screen@uni-erlangen.de
+ break;
default:
if (Special(c))
- break;
+ {
***************
-*** 758,763 ****
---- 763,789 ----
+*** 868,873 ****
+--- 873,899 ----
goto tryagain;
}
}
diff --git a/src/term.c b/src/term.c
index 2fa166d..03b40b4 100644
--- a/src/term.c
+++ b/src/term.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -110,6 +111,13 @@ struct term term[T_N] =
{ "sg", T_NUM },
{ "ug", T_NUM },
+/* color */
+ { "AF", T_STR },
+ { "AB", T_STR },
+ { "Sf", T_STR },
+ { "Sb", T_STR },
+ { "AX", T_FLG },
+
/* keypad/cursorkeys */
{ "ks", T_STR },
{ "ke", T_STR },
@@ -129,6 +137,7 @@ struct term term[T_N] =
/* cursor visibility */
{ "vi", T_STR },
+ { "vs", T_STR },
{ "ve", T_STR },
/* margin handling */
@@ -155,7 +164,8 @@ struct term term[T_N] =
{ "as", T_STR },
{ "ae", T_STR },
{ "ac", T_STR },
- { "B8", T_STR },
+ { "eA", T_STR },
+ { "XC", T_STR },
/* keycaps */
/* define T_CAPS */
diff --git a/src/term.h.dist b/src/term.h.dist
index 710b155..d1fe1e7 100644
--- a/src/term.h.dist
+++ b/src/term.h.dist
@@ -138,84 +138,98 @@ union tcu
#define D_SG (D_tcs[57].num)
#define d_UG d_tcs[58].num
#define D_UG (D_tcs[58].num)
-#define d_KS d_tcs[59].str
-#define D_KS (D_tcs[59].str)
-#define d_KE d_tcs[60].str
-#define D_KE (D_tcs[60].str)
-#define d_CCS d_tcs[61].str
-#define D_CCS (D_tcs[61].str)
-#define d_CCE d_tcs[62].str
-#define D_CCE (D_tcs[62].str)
-#define d_PO d_tcs[63].str
-#define D_PO (D_tcs[63].str)
-#define d_PF d_tcs[64].str
-#define D_PF (D_tcs[64].str)
-#define d_HS d_tcs[65].flg
-#define D_HS (D_tcs[65].flg)
-#define d_WS d_tcs[66].num
-#define D_WS (D_tcs[66].num)
-#define d_TS d_tcs[67].str
-#define D_TS (D_tcs[67].str)
-#define d_FS d_tcs[68].str
-#define D_FS (D_tcs[68].str)
-#define d_DS d_tcs[69].str
-#define D_DS (D_tcs[69].str)
-#define d_VI d_tcs[70].str
-#define D_VI (D_tcs[70].str)
-#define d_VE d_tcs[71].str
-#define D_VE (D_tcs[71].str)
-#define d_AM d_tcs[72].flg
-#define D_AM (D_tcs[72].flg)
-#define d_XV d_tcs[73].flg
-#define D_XV (D_tcs[73].flg)
-#define d_XN d_tcs[74].flg
-#define D_XN (D_tcs[74].flg)
-#define d_COP d_tcs[75].flg
-#define D_COP (D_tcs[75].flg)
-#define d_CLP d_tcs[76].flg
-#define D_CLP (D_tcs[76].flg)
-#define d_CNF d_tcs[77].flg
-#define D_CNF (D_tcs[77].flg)
-#define d_NX d_tcs[78].flg
-#define D_NX (D_tcs[78].flg)
-#define d_CAN d_tcs[79].flg
-#define D_CAN (D_tcs[79].flg)
-#define d_COL d_tcs[80].num
-#define D_COL (D_tcs[80].num)
-#define d_CKJ d_tcs[81].str
-#define D_CKJ (D_tcs[81].str)
-#define d_CVR d_tcs[82].str
-#define D_CVR (D_tcs[82].str)
-#define d_CVN d_tcs[83].str
-#define D_CVN (D_tcs[83].str)
-#define d_CG0 d_tcs[84].flg
-#define D_CG0 (D_tcs[84].flg)
-#define d_CS0 d_tcs[85].str
-#define D_CS0 (D_tcs[85].str)
-#define d_CE0 d_tcs[86].str
-#define D_CE0 (D_tcs[86].str)
-#define d_CC0 d_tcs[87].str
-#define D_CC0 (D_tcs[87].str)
-#define d_AS d_tcs[88].str
-#define D_AS (D_tcs[88].str)
-#define d_AE d_tcs[89].str
-#define D_AE (D_tcs[89].str)
-#define d_AC d_tcs[90].str
-#define D_AC (D_tcs[90].str)
-#define d_CB8 d_tcs[91].str
-#define D_CB8 (D_tcs[91].str)
-#define T_CAPS 92
-#define T_CURSOR 131
-#define T_KEYPAD 135
-#define T_OCAPS 153
-#define T_ECAPS 166
-#define T_N 166
+#define d_CAF d_tcs[59].str
+#define D_CAF (D_tcs[59].str)
+#define d_CAB d_tcs[60].str
+#define D_CAB (D_tcs[60].str)
+#define d_CSF d_tcs[61].str
+#define D_CSF (D_tcs[61].str)
+#define d_CSB d_tcs[62].str
+#define D_CSB (D_tcs[62].str)
+#define d_CAX d_tcs[63].flg
+#define D_CAX (D_tcs[63].flg)
+#define d_KS d_tcs[64].str
+#define D_KS (D_tcs[64].str)
+#define d_KE d_tcs[65].str
+#define D_KE (D_tcs[65].str)
+#define d_CCS d_tcs[66].str
+#define D_CCS (D_tcs[66].str)
+#define d_CCE d_tcs[67].str
+#define D_CCE (D_tcs[67].str)
+#define d_PO d_tcs[68].str
+#define D_PO (D_tcs[68].str)
+#define d_PF d_tcs[69].str
+#define D_PF (D_tcs[69].str)
+#define d_HS d_tcs[70].flg
+#define D_HS (D_tcs[70].flg)
+#define d_WS d_tcs[71].num
+#define D_WS (D_tcs[71].num)
+#define d_TS d_tcs[72].str
+#define D_TS (D_tcs[72].str)
+#define d_FS d_tcs[73].str
+#define D_FS (D_tcs[73].str)
+#define d_DS d_tcs[74].str
+#define D_DS (D_tcs[74].str)
+#define d_VI d_tcs[75].str
+#define D_VI (D_tcs[75].str)
+#define d_VS d_tcs[76].str
+#define D_VS (D_tcs[76].str)
+#define d_VE d_tcs[77].str
+#define D_VE (D_tcs[77].str)
+#define d_AM d_tcs[78].flg
+#define D_AM (D_tcs[78].flg)
+#define d_XV d_tcs[79].flg
+#define D_XV (D_tcs[79].flg)
+#define d_XN d_tcs[80].flg
+#define D_XN (D_tcs[80].flg)
+#define d_COP d_tcs[81].flg
+#define D_COP (D_tcs[81].flg)
+#define d_CLP d_tcs[82].flg
+#define D_CLP (D_tcs[82].flg)
+#define d_CNF d_tcs[83].flg
+#define D_CNF (D_tcs[83].flg)
+#define d_NX d_tcs[84].flg
+#define D_NX (D_tcs[84].flg)
+#define d_CAN d_tcs[85].flg
+#define D_CAN (D_tcs[85].flg)
+#define d_COL d_tcs[86].num
+#define D_COL (D_tcs[86].num)
+#define d_CKJ d_tcs[87].str
+#define D_CKJ (D_tcs[87].str)
+#define d_CVR d_tcs[88].str
+#define D_CVR (D_tcs[88].str)
+#define d_CVN d_tcs[89].str
+#define D_CVN (D_tcs[89].str)
+#define d_CG0 d_tcs[90].flg
+#define D_CG0 (D_tcs[90].flg)
+#define d_CS0 d_tcs[91].str
+#define D_CS0 (D_tcs[91].str)
+#define d_CE0 d_tcs[92].str
+#define D_CE0 (D_tcs[92].str)
+#define d_CC0 d_tcs[93].str
+#define D_CC0 (D_tcs[93].str)
+#define d_AS d_tcs[94].str
+#define D_AS (D_tcs[94].str)
+#define d_AE d_tcs[95].str
+#define D_AE (D_tcs[95].str)
+#define d_AC d_tcs[96].str
+#define D_AC (D_tcs[96].str)
+#define d_EA d_tcs[97].str
+#define D_EA (D_tcs[97].str)
+#define d_CXC d_tcs[98].str
+#define D_CXC (D_tcs[98].str)
+#define T_CAPS 99
+#define T_CURSOR 138
+#define T_KEYPAD 142
+#define T_OCAPS 160
+#define T_ECAPS 173
+#define T_N 173
#ifdef MAPKEYS
-# define KMAPDEFSTART 92
+# define KMAPDEFSTART 99
# define NKMAPDEF 61
-# define KMAPADEFSTART 131
+# define KMAPADEFSTART 138
# define NKMAPADEF 22
-# define KMAPMDEFSTART 106
+# define KMAPMDEFSTART 113
# define NKMAPMDEF 29
#endif
diff --git a/src/termcap.c b/src/termcap.c
index b7d4042..efcecb2 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -28,11 +29,12 @@ RCS_ID("$Id$ FAU")
#include "screen.h"
#include "extern.h"
-extern struct display *display;
+extern struct display *display, *displays;
static void AddCap __P((char *));
static void MakeString __P((char *, char *, int, char *));
static char *findcap __P((char *, char **, int));
+static int copyarg __P((char **, char *));
static char *e_tgetstr __P((char *, char **));
static int e_tgetflag __P((char *));
static int e_tgetnum __P((char *));
@@ -40,7 +42,7 @@ static int e_tgetnum __P((char *));
static int addmapseq __P((char *, int));
static int remmapseq __P((char *));
#ifdef DEBUG
-static void dumpmap __P((void));
+static void dumpmap __P((void));
#endif
#endif
@@ -55,6 +57,7 @@ extern struct action mmtab[];
extern struct action dmtab[];
extern char *kmap_extras[];
extern int kmap_extras_fl[];
+extern int DefaultEsc;
#endif
char Termcap[TERMCAP_BUFSIZE + 8]; /* new termcap +8:"TERMCAP=" */
@@ -104,7 +107,11 @@ int he;
debug1("InitTermcap: looking for tgetent('%s')\n", D_termname);
if (*D_termname == 0 || tgetent(tbuf, D_termname) != 1)
{
+#ifdef TERMINFO
+ Msg(0, "Cannot find terminfo entry for '%s'.", D_termname);
+#else
Msg(0, "Cannot find termcap entry for '%s'.", D_termname);
+#endif
return -1;
}
debug1("got it:\n%s\n",tbuf);
@@ -114,8 +121,14 @@ int he;
if (extra_outcap)
debug1("Extra outcap: %s\n", extra_outcap);
#endif
- tp = D_tentry;
+ if ((D_tentry = (char *)malloc(TERMCAP_BUFSIZE + (extra_incap ? strlen(extra_incap) + 1 : 0))) == 0)
+ {
+ Msg(0, strnomem);
+ return -1;
+ }
+
+ tp = D_tentry;
for (i = 0; i < T_N; i++)
{
switch(term[i].type)
@@ -174,8 +187,8 @@ int he;
nwin_default.flowflag = D_CNF ? FLOW_NOW * 0 :
D_NX ? FLOW_NOW * 1 :
FLOW_AUTOFLAG;
- D_CLP |= assume_LP || !D_AM || D_XV || D_XN ||
- (!extra_incap && !strncmp(D_termname, "vt", 2));
+ D_CLP |= (assume_LP || !D_AM || D_XV || D_XN ||
+ (!extra_incap && !strncmp(D_termname, "vt", 2)));
if (!D_BL)
D_BL = "\007";
if (!D_BC)
@@ -271,6 +284,12 @@ int he;
t = D_attrtyp[i];
}
}
+ if (D_CAF == 0 && D_CAB == 0)
+ {
+ /* hmm, where's the difference? */
+ D_CAF = D_CSF;
+ D_CAB = D_CSB;
+ }
if (!D_DO)
D_DO = D_NL;
@@ -288,7 +307,7 @@ int he;
if (D_CVN == 0)
D_CVR = 0;
if (D_VE == 0)
- D_VI = 0;
+ D_VI = D_VS = 0;
if (D_CCE == 0)
D_CCS = 0;
if (D_CG0)
@@ -305,7 +324,6 @@ int he;
}
else if (D_AC || (D_AS && D_AE)) /* some kind of graphics */
{
- D_CG0 = 1;
D_CS0 = (D_AS && D_AE) ? D_AS : "";
D_CE0 = (D_AS && D_AE) ? D_AE : "";
D_CC0 = D_AC;
@@ -334,6 +352,10 @@ int he;
D_PO = 0;
debug2("terminal size is %d, %d (says TERMCAP)\n", D_CO, D_LI);
+ if (D_CXC)
+ if (CreateTransTable(D_CXC))
+ return -1;
+
/* Termcap fields Z0 & Z1 contain width-changing sequences. */
if (D_CZ1 == 0)
D_CZ0 = 0;
@@ -393,6 +415,9 @@ int he;
D_tcinited = 1;
MakeTermcap(0);
+#ifdef MAPKEYS
+ CheckEscape();
+#endif
return 0;
}
@@ -435,7 +460,7 @@ int map;
a1 = 0;
if (a2 && a2->nr == RC_STUFF && strcmp(a2->args[0], s) == 0)
a2 = 0;
- domap |= a1 || a2;
+ domap |= (a1 || a2);
if (tab == umtab)
tab = dmtab;
else if (tab == dmtab)
@@ -455,6 +480,42 @@ int map;
return remmapseq(s);
}
+void
+CheckEscape()
+{
+ struct display *odisplay;
+ int i, nr;
+
+ if (DefaultEsc >= 0)
+ return;
+
+ odisplay = display;
+ for (display = displays; display; display = display->d_next)
+ {
+ for (i = 0; i < D_nseqs; i++)
+ {
+ nr = D_kmaps[i].nr & ~KMAP_NOTIMEOUT;
+ if (umtab[nr].nr == RC_COMMAND)
+ break;
+ if (umtab[nr].nr == RC_ILLEGAL && dmtab[nr].nr == RC_COMMAND)
+ break;
+ }
+ if (i >= D_nseqs)
+ break;
+ }
+ if (display == 0)
+ {
+ display = odisplay;
+ return;
+ }
+ ParseEscape((struct user *)0, "^aa");
+ if (odisplay->d_user->u_Esc <= 0)
+ odisplay->d_user->u_Esc = DefaultEsc;
+ display = 0;
+ Msg(0, "Warning: escape char set back to ^A");
+ display = odisplay;
+}
+
static int
addmapseq(seq, nr)
char *seq;
@@ -650,6 +711,20 @@ int aflag;
sprintf(p, "vt100");
}
while (0); /* Goto free programming... */
+
+ /* check for compatibility problems, displays == 0 after fork */
+ {
+ char *tgetstr(), xbuf[TERMCAP_BUFSIZE], *xbp = xbuf;
+ if (tgetstr("im", &xbp) && tgetstr("ic", &xbp) && displays)
+ {
+#ifdef TERMINFO
+ Msg(0, "Warning: smir and ich1 set in %s terminfo entry", p);
+#else
+ Msg(0, "Warning: im and ic set in %s termcap entry", p);
+#endif
+ }
+ }
+
tcLineLen = 100; /* Force NL */
sprintf(Termcap,
"TERMCAP=SC|%s|VT 100/ANSI X3.64 virtual terminal", Term + 5);
@@ -712,6 +787,9 @@ int aflag;
AddCap("ks=\\E[?1h\\E=:");
AddCap("ke=\\E[?1l\\E>:");
#endif
+ AddCap("vi=\\E[?25l:");
+ AddCap("ve=\\E[34h\\E[?25h:");
+ AddCap("vs=\\E[34l:");
if (display)
{
if (D_US)
@@ -734,8 +812,10 @@ int aflag;
AddCap("mr=\\E[7m:");
if (D_MB || D_MD || D_MH || D_MR)
AddCap("me=\\E[m:ms:");
+ if (D_CAF || D_CAB)
+ AddCap("Co#8:pa#64:AF=\\E[3%dm:AB=\\E[4%dm:op=\\E[39;49m:AX:");
if (D_VB)
- AddCap("vb=\\E[?5h\\E[?5l:");
+ AddCap("vb=\\Eg:");
#ifndef MAPKEYS
if (D_KS)
{
@@ -749,8 +829,9 @@ int aflag;
}
#endif
if (D_CG0)
+ AddCap("G0:");
+ if (D_CC0 || (D_CS0 && *D_CS0))
{
- AddCap("G0:");
AddCap("as=\\E(0:");
AddCap("ae=\\E(B:");
/* avoid `` because some shells dump core... */
@@ -875,6 +956,148 @@ char *s;
}
+#undef QUOTES
+#define QUOTES(p) \
+ (*p == '\\' && (p[1] == '\\' || p[1] == ',' || p[1] == '%'))
+
+int
+CreateTransTable(s)
+char *s;
+{
+ int curchar;
+ char *templ, *arg;
+ int templlen;
+ int templnsub;
+ char *p, *sx;
+ char **ctable;
+ int l, c;
+
+ if ((D_xtable = (char ***)malloc(256 * sizeof(char **))) == 0)
+ {
+ Msg(0, strnomem);
+ return -1;
+ }
+ bzero((char *)D_xtable, 256 * sizeof(char **));
+
+ while (*s)
+ {
+ if (QUOTES(s))
+ s++;
+ curchar = (unsigned char)*s++;
+ if (curchar == 'B')
+ curchar = 0; /* ASCII */
+ templ = s;
+ templlen = 0;
+ templnsub = 0;
+ if (D_xtable[curchar] == 0)
+ {
+ if ((D_xtable[curchar] = (char **)malloc(257 * sizeof(char *))) == 0)
+ {
+ Msg(0, strnomem);
+ FreeTransTable();
+ return -1;
+ }
+ bzero((char *)D_xtable[curchar], 257 * sizeof(char *));
+ }
+ ctable = D_xtable[curchar];
+ for(; *s && *s != ','; s++)
+ {
+ if (QUOTES(s))
+ s++;
+ else if (*s == '%')
+ {
+ templnsub++;
+ continue;
+ }
+ templlen++;
+ }
+ if (*s++ == 0)
+ break;
+ while (*s && *s != ',')
+ {
+ c = (unsigned char)*s++;
+ if (QUOTES((s - 1)))
+ c = (unsigned char)*s++;
+ else if (c == '%')
+ c = 256;
+ if (ctable[c])
+ free(ctable[c]);
+ arg = s;
+ l = copyarg(&s, (char *)0);
+ if (c != 256)
+ l = l * templnsub + templlen;
+ if ((ctable[c] = (char *)malloc(l + 1)) == 0)
+ {
+ Msg(0, strnomem);
+ FreeTransTable();
+ return -1;
+ }
+ sx = ctable[c];
+ for (p = ((c == 256) ? "%" : templ); *p && *p != ','; p++)
+ {
+ if (QUOTES(p))
+ p++;
+ else if (*p == '%')
+ {
+ s = arg;
+ sx += copyarg(&s, sx);
+ continue;
+ }
+ *sx++ = *p;
+ }
+ *sx = 0;
+ ASSERT(ctable[c] + l == sx);
+ debug3("XC: %c %c->%s\n", curchar, c, ctable[c]);
+ }
+ if (*s == ',')
+ s++;
+ }
+ return 0;
+}
+
+void
+FreeTransTable()
+{
+ char ***p, **q;
+ int i, j;
+
+ if ((p = D_xtable) == 0)
+ return;
+ for (i = 0; i < 256; i++, p++)
+ {
+ if (*p == 0)
+ continue;
+ q = *p;
+ for (j = 0; j < 257; j++, q++)
+ if (*q)
+ free(*q);
+ free((char *)*p);
+ }
+ free((char *)D_xtable);
+}
+
+static int
+copyarg(pp, s)
+char **pp, *s;
+{
+ int l;
+ char *p;
+
+ for (l = 0, p = *pp; *p && *p != ','; p++)
+ {
+ if (QUOTES(p))
+ p++;
+ if (s)
+ *s++ = *p;
+ l++;
+ }
+ if (*p == ',')
+ p++;
+ *pp = p;
+ return l;
+}
+
+
/*
**
** Termcap routines that use our extra_incap
@@ -900,7 +1123,7 @@ int n;
int num = 0, capl;
if (!extra_incap)
- return (0);
+ return 0;
tep = *tepp;
capl = strlen(cap);
cp = 0;
@@ -994,10 +1217,10 @@ int n;
*cp++ = 0;
*tepp = cp;
debug2("'%s' found in extra_incap -> %s\n", cap, tep);
- return(tep);
+ return tep;
}
}
- return(0);
+ return 0;
}
static char *
@@ -1007,8 +1230,8 @@ char **tepp;
{
char *tep, *tgetstr();
if ((tep = findcap(cap, tepp, 0)))
- return((*tep == '@') ? 0 : tep);
- return (tgetstr(cap, tepp));
+ return (*tep == '@') ? 0 : tep;
+ return tgetstr(cap, tepp);
}
static int
@@ -1019,8 +1242,8 @@ char *cap;
char *tep;
bufp = buf;
if ((tep = findcap(cap, &bufp, 2)))
- return((*tep == '@') ? 0 : 1);
- return (tgetflag(cap));
+ return (*tep == '@') ? 0 : 1;
+ return tgetflag(cap);
}
static int
@@ -1036,13 +1259,14 @@ char *cap;
{
c = *tep;
if (c == '@')
- return(-1);
+ return -1;
if (c == '0')
base = 8;
res = 0;
while ((c = *tep++) >= '0' && c <= '9')
res = res * base + (c - '0');
- return(res);
+ return res;
}
- return (tgetnum(cap));
+ return tgetnum(cap);
}
+
diff --git a/src/terminfo/README b/src/terminfo/README
index 5f69269..ccbf488 100644
--- a/src/terminfo/README
+++ b/src/terminfo/README
@@ -14,5 +14,6 @@ checktc.c Termcap/info test program. Checks margin
test.txt Test file for alternate charset.
-tetris.c The popular game.
+tetris.c The popular game, by John Tromp. This is one of
+ the winners of the 1989 IOCCC contest.
diff --git a/src/terminfo/screencap b/src/terminfo/screencap
index 2db7d21..90e6e93 100644
--- a/src/terminfo/screencap
+++ b/src/terminfo/screencap
@@ -8,12 +8,14 @@ SC|screen|VT 100/ANSI X3.64 virtual terminal:\
:mb=\E[5m:md=\E[1m:mr=\E[7m:me=\E[m:sr=\EM:al=\E[L:\
:AL=\E[%dL:dl=\E[M:DL=\E[%dM:cs=\E[%i%d;%dr:dc=\E[P:\
:DC=\E[%dP:im=\E[4h:ei=\E[4l:IC=\E[%d@:\
- :ks=\E[?1h\E=:ke=\E[?1l\E>:\
- :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\
- :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\
+ :ks=\E[?1h\E=:ke=\E[?1l\E>:vb=\Eg:\
+ :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\
+ :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\
:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:\
:kh=\E[1~:kI=\E[2~:kD=\E[3~:kH=\E[4~:kP=\E[5~:kN=\E[6~:\
- :as=^N:ae=^O:\
+ :eA=\E(B\E)0:as=^N:ae=^O:\
+ :vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l:\
+ :Co#8:pa#64:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:AX:\
:ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++,,hhII00:
SW|screen-w|VT 100/ANSI X3.64 virtual terminal with 132 cols:\
:co#132:tc=screen:
diff --git a/src/terminfo/screeninfo.src b/src/terminfo/screeninfo.src
index 62db2af..e409b20 100644
--- a/src/terminfo/screeninfo.src
+++ b/src/terminfo/screeninfo.src
@@ -1,12 +1,13 @@
screen|VT 100/ANSI X3.64 virtual terminal,
am, km, mir, msgr, xenl,
- cols#80, it#8, lines#24,
+ cols#80, it#8, lines#24, colors#8, pairs#64,
bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z,
clear=\E[H\E[J, cr=\r, csr=\E[%i%p1%d;%p2%dr,
cub=\E[%p1%dD, cub1=\b, cud=\E[%p1%dB, cud1=\n,
cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
cuu=\E[%p1%dA, cuu1=\EM, dch=\E[%p1%dP, dch1=\E[P,
- dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H,
+ dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K,
+ enacs=\E(B\E)0, home=\E[H,
ht=\t, hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L,
ind=\n, is2=\E)0, kbs=\b, kcub1=\EOD, kcud1=\EOB,
kcuf1=\EOC, kcuu1=\EOA, kdch1=\E[3~, kf1=\EOP,
@@ -17,17 +18,20 @@ screen|VT 100/ANSI X3.64 virtual terminal,
rc=\E8, rev=\E[7m, ri=\EM, rmir=\E[4l, rmkx=\E[?1l\E>,
rmso=\E[23m, rmul=\E[24m, rs2=\Ec, sc=\E7, sgr0=\E[m,
smir=\E[4h, smkx=\E[?1h\E=, smso=\E[3m, smul=\E[4m,
- tbc=\E[3g, smacs=^N, rmacs=^O,
+ tbc=\E[3g, smacs=^N, rmacs=^O, flash=\Eg,
+ civis=\E[?25l, cnorm=\E[34h\E[?25h, cvvis=\E[34l,
+ op=\E[39;49m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++\054\054hhII00,
screen-w|VT 100/ANSI X3.64 virtual terminal with 132 cols,
am, km, mir, msgr, xenl,
- cols#132, it#8, lines#24,
+ cols#132, it#8, lines#24, colors#8, pairs#64,
bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z,
clear=\E[H\E[J, cr=\r, csr=\E[%i%p1%d;%p2%dr,
cub=\E[%p1%dD, cub1=\b, cud=\E[%p1%dB, cud1=\n,
cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
cuu=\E[%p1%dA, cuu1=\EM, dch=\E[%p1%dP, dch1=\E[P,
- dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H,
+ dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K,
+ enacs=\E(B\E)0, home=\E[H,
ht=\t, hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L,
ind=\n, is2=\E)0, kbs=\b, kcub1=\EOD, kcud1=\EOB,
kcuf1=\EOC, kcuu1=\EOA, kdch1=\E[3~, kf1=\EOP,
@@ -38,5 +42,7 @@ screen-w|VT 100/ANSI X3.64 virtual terminal with 132 cols,
rc=\E8, rev=\E[7m, ri=\EM, rmir=\E[4l, rmkx=\E[?1l\E>,
rmso=\E[23m, rmul=\E[24m, rs2=\Ec, sc=\E7, sgr0=\E[m,
smir=\E[4h, smkx=\E[?1h\E=, smso=\E[3m, smul=\E[4m,
- tbc=\E[3g, smacs=^N, rmacs=^O,
+ tbc=\E[3g, smacs=^N, rmacs=^O, flash=\Eg,
+ civis=\E[?25l, cnorm=\E[34h\E[?25h, cvvis=\E[34l,
+ op=\E[39;49m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++\054\054hhII00,
diff --git a/src/tty.c.dist b/src/tty.c.dist
index 2e80b7a..b7f5f88 100644
--- a/src/tty.c.dist
+++ b/src/tty.c.dist
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -462,7 +463,7 @@ int ttyflag;
# endif /* TERMIO */
#endif /* POSIX */
-#if defined(KANJI) && defined(TIOCKSET)
+#if defined(KANJI) && defined(TIOCKSET) && defined(KM_ASCII) && defined(KM_SYSSJIS)
m->m_jtchars.t_ascii = 'J';
m->m_jtchars.t_kanji = 'B';
m->m_knjmode = KM_ASCII | KM_SYSSJIS;
@@ -500,7 +501,7 @@ struct mode *mp;
ioctl(fd, TIOCSLTC, (char *)&mp->m_ltchars); /* moved here for apollo. jw */
# endif
#endif
-#if defined(KANJI) && defined(TIOCKSET)
+#if defined(KANJI) && defined(TIOCKSET) && defined(KM_ASCII) && defined(KM_SYSSJIS)
ioctl(fd, TIOCKSETC, &mp->m_jtchars);
ioctl(fd, TIOCKSET, &mp->m_knjmode);
#endif
@@ -544,7 +545,7 @@ struct mode *mp;
ioctl(fd, TIOCGETD, (char *)&mp->m_ldisc);
# endif
#endif
-#if defined(KANJI) && defined(TIOCKSET)
+#if defined(KANJI) && defined(TIOCKSET) && defined(KM_ASCII) && defined(KM_SYSSJIS)
ioctl(fd, TIOCKGETC, &mp->m_jtchars);
ioctl(fd, TIOCKGET, &mp->m_knjmode);
#endif
@@ -791,7 +792,7 @@ int fd;
/* The next lines should be obsolete. Can anybody check if they
* are really needed on the BSD platforms?
*/
-# if defined(__osf__) || (BSD >= 199103)
+# if defined(__osf__) || (BSD >= 199103) || defined(ISC)
setsid(); /* should be already done */
# ifdef TIOCSCTTY
ioctl(fd, TIOCSCTTY, (char *)0);
@@ -971,10 +972,10 @@ struct mode *m;
#ifdef POSIX
debug("struct termios tio:\n");
- debug1("c_iflag = %#x\n", m->tio.c_iflag);
- debug1("c_oflag = %#x\n", m->tio.c_oflag);
- debug1("c_cflag = %#x\n", m->tio.c_cflag);
- debug1("c_lflag = %#x\n", m->tio.c_lflag);
+ debug1("c_iflag = %#x\n", (unsigned int)m->tio.c_iflag);
+ debug1("c_oflag = %#x\n", (unsigned int)m->tio.c_oflag);
+ debug1("c_cflag = %#x\n", (unsigned int)m->tio.c_cflag);
+ debug1("c_lflag = %#x\n", (unsigned int)m->tio.c_lflag);
for (i = 0; i < sizeof(m->tio.c_cc)/sizeof(*m->tio.c_cc); i++)
{
debug2("c_cc[%d] = %#x\n", i, m->tio.c_cc[i]);
diff --git a/src/tty.sh b/src/tty.sh
index f5db2fe..b00dc3f 100644
--- a/src/tty.sh
+++ b/src/tty.sh
@@ -32,7 +32,8 @@ exit 0
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -339,7 +340,7 @@ IF{LCRTBS} | LCRTBS
# endif /* TERMIO */
#endif /* POSIX */
-#if defined(KANJI) && defined(TIOCKSET)
+#if defined(KANJI) && defined(TIOCKSET) && defined(KM_ASCII) && defined(KM_SYSSJIS)
m->m_jtchars.t_ascii = 'J';
m->m_jtchars.t_kanji = 'B';
m->m_knjmode = KM_ASCII | KM_SYSSJIS;
@@ -377,7 +378,7 @@ struct mode *mp;
ioctl(fd, TIOCSLTC, (char *)&mp->m_ltchars); /* moved here for apollo. jw */
# endif
#endif
-#if defined(KANJI) && defined(TIOCKSET)
+#if defined(KANJI) && defined(TIOCKSET) && defined(KM_ASCII) && defined(KM_SYSSJIS)
ioctl(fd, TIOCKSETC, &mp->m_jtchars);
ioctl(fd, TIOCKSET, &mp->m_knjmode);
#endif
@@ -421,7 +422,7 @@ struct mode *mp;
ioctl(fd, TIOCGETD, (char *)&mp->m_ldisc);
# endif
#endif
-#if defined(KANJI) && defined(TIOCKSET)
+#if defined(KANJI) && defined(TIOCKSET) && defined(KM_ASCII) && defined(KM_SYSSJIS)
ioctl(fd, TIOCKGETC, &mp->m_jtchars);
ioctl(fd, TIOCKGET, &mp->m_knjmode);
#endif
@@ -628,7 +629,7 @@ int fd;
/* The next lines should be obsolete. Can anybody check if they
* are really needed on the BSD platforms?
*/
-# if defined(__osf__) || (BSD >= 199103)
+# if defined(__osf__) || (BSD >= 199103) || defined(ISC)
setsid(); /* should be already done */
# ifdef TIOCSCTTY
ioctl(fd, TIOCSCTTY, (char *)0);
@@ -808,10 +809,10 @@ struct mode *m;
#ifdef POSIX
debug("struct termios tio:\n");
- debug1("c_iflag = %#x\n", m->tio.c_iflag);
- debug1("c_oflag = %#x\n", m->tio.c_oflag);
- debug1("c_cflag = %#x\n", m->tio.c_cflag);
- debug1("c_lflag = %#x\n", m->tio.c_lflag);
+ debug1("c_iflag = %#x\n", (unsigned int)m->tio.c_iflag);
+ debug1("c_oflag = %#x\n", (unsigned int)m->tio.c_oflag);
+ debug1("c_cflag = %#x\n", (unsigned int)m->tio.c_cflag);
+ debug1("c_lflag = %#x\n", (unsigned int)m->tio.c_lflag);
for (i = 0; i < sizeof(m->tio.c_cc)/sizeof(*m->tio.c_cc); i++)
{
debug2("c_cc[%d] = %#x\n", i, m->tio.c_cc[i]);
diff --git a/src/utmp.c b/src/utmp.c
index 2c97446..916dc35 100644
--- a/src/utmp.c
+++ b/src/utmp.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -757,7 +758,7 @@ getttyent()
* getlogin() replacement (for SVR4 machines)
*/
-# if defined(BUGGYGETLOGIN)
+# if defined(BUGGYGETLOGIN) && defined(UTMP_FILE)
char *
getlogin()
{
diff --git a/src/window.c b/src/window.c
index 907614d..703b281 100644
--- a/src/window.c
+++ b/src/window.c
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
*/
@@ -73,13 +74,14 @@ static char DefaultPath[] = ":/usr/ucb:/bin:/usr/bin";
struct NewWindow nwin_undef =
{
-1, (char *)0, (char **)0, (char *)0, (char *)0, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1
+ -1, -1, -1, -1, -1, -1, -1, -1, (char *)0, (char *)0
};
struct NewWindow nwin_default =
{
- 0, 0, ShellArgs, 0, screenterm, 0, 1*FLOW_NOW,
- LOGINDEFAULT, DEFAULTHISTHEIGHT, MON_OFF, WLOCK_AUTO, 1, 1, 0, 0
+ 0, (char *)0, ShellArgs, (char *)0, screenterm, 0, 1*FLOW_NOW,
+ LOGINDEFAULT, DEFAULTHISTHEIGHT, MON_OFF, WLOCK_AUTO,
+ 1, 1, 0, 0, (char *)0, (char *)0
};
struct NewWindow nwin_options;
@@ -105,6 +107,8 @@ struct NewWindow *def, *new, *res;
#ifdef KANJI
res->kanji = new->kanji != nwin_undef.kanji ? new->kanji : def->kanji;
#endif
+ res->hstatus = new->hstatus != nwin_undef.hstatus ? new->hstatus : def->hstatus;
+ res->charset = new->charset != nwin_undef.charset ? new->charset : def->charset;
}
int
@@ -170,18 +174,9 @@ struct NewWindow *newwin;
p->w_cmdargs[i] = SaveStr(nwin.args[i]);
p->w_cmdargs[i] = 0;
- if (!(p->w_dlist = (struct displaylist *)malloc(sizeof(struct displaylist))))
- {
- free((char *)p);
- close(f);
- Msg(0, strnomem);
- return -1;
- }
- p->w_dlist->next = NULL;
#ifdef MULTIUSER
if (NewWindowAcl(p))
{
- free((char *)p->w_dlist);
free((char *)p);
close(f);
Msg(0, strnomem);
@@ -216,22 +211,26 @@ struct NewWindow *newwin;
}
else
p->w_title = p->w_akachange = p->w_akabuf;
+ if (nwin.hstatus)
+ p->w_hstatus = SaveStr(nwin.hstatus);
p->w_monitor = nwin.monitor;
p->w_norefresh = 0;
strncpy(p->w_tty, TtyName, MAXSTR - 1);
- if (ChangeWindowSize(p, display ? D_defwidth : 80, display ? D_defheight : 24))
+#ifndef COPY_PASTE
+ nwin.histheight = 0;
+#endif
+ if (ChangeWindowSize(p, display ? D_defwidth : 80, display ? D_defheight : 24, nwin.histheight))
{
FreeWindow(p);
return -1;
}
-#ifdef COPY_PASTE
- ChangeScrollback(p, nwin.histheight, p->w_width);
-#endif
#ifdef KANJI
p->w_kanji = nwin.kanji;
#endif
ResetWindow(p); /* sets w_wrap, w_c1, w_gr */
+ if (nwin.charset)
+ SetCharsets(p, nwin.charset);
if (ttyflag == TTY_FLAG_PLAIN)
{
@@ -344,6 +343,7 @@ FreeWindow(wp)
struct win *wp;
{
struct display *d;
+ int i;
#ifdef PSEUDOS
if (wp->w_pwin)
@@ -363,18 +363,18 @@ struct win *wp;
console_window = 0;
if (wp->w_logfp != NULL)
fclose(wp->w_logfp);
- ChangeWindowSize(wp, 0, 0);
+ ChangeWindowSize(wp, 0, 0, 0);
+ if (wp->w_hstatus)
+ free(wp->w_hstatus);
+ for (i = 0; wp->w_cmdargs[i]; i++)
+ free(wp->w_cmdargs[i]);
for (d = displays; d; d = d->d_next)
if (d->d_other == wp)
d->d_other = 0;
- while (wp->w_dlist)
- {
- struct displaylist* l;
-
- l = wp->w_dlist->next;
- free((char *)wp->w_dlist);
- wp->w_dlist = l;
- }
+#ifdef MULTIUSER
+ for (i = 0; i < ACL_BITS_PER_WIN; i++)
+ free((char *)wp->w_userbits[i]);
+#endif
free((char *)wp);
}
@@ -646,23 +646,21 @@ struct win *win;
# endif
}
#endif
- debug("haha\n");
SetTTY(newfd, modep);
#ifdef TIOCSWINSZ
glwz.ws_col = w;
glwz.ws_row = h;
- debug("hoho\n");
(void) ioctl(newfd, TIOCSWINSZ, (char *)&glwz);
#endif
+ /* Always turn off nonblocking mode */
+ (void)fcntl(newfd, F_SETFL, 0);
}
- debug("huhu\n");
#ifndef TIOCSWINSZ
sprintf(libuf, "LINES=%d", h);
sprintf(cobuf, "COLUMNS=%d", w);
NewEnv[5] = libuf;
NewEnv[6] = cobuf;
#endif
- debug("hihi\n");
#ifdef MAPKEYS
NewEnv[2] = MakeTermcap(display == 0 || win->w_aflag);
#else
@@ -671,11 +669,9 @@ struct win *win;
else
NewEnv[2] = Termcap;
#endif
- debug("hyhy\n");
strcpy(shellbuf, "SHELL=");
strncpy(shellbuf + 6, ShellProg, MAXPATHLEN);
shellbuf[MAXPATHLEN + 6] = 0;
- debug("hzhz\n");
NewEnv[4] = shellbuf;
debug1("ForkWindow: NewEnv[4] = '%s'\n", shellbuf);
if (term && *term && strcmp(screenterm, term) &&
@@ -886,7 +882,7 @@ char **av;
}
}
#endif /* TIOCPKT */
- pwin->p_pid = ForkWindow(av, NULL, NULL, t, w);
+ pwin->p_pid = ForkWindow(av, (char *)0, (char *)0, t, w);
if ((r = pwin->p_pid) < 0)
FreePseudowin(w);
return r;
@@ -918,7 +914,7 @@ struct win *w;
* Clone routines. To be removed...
*/
-static void CloneTermcap __P((struct display *));
+static int CloneTermcap __P((struct display *));
extern char **environ;
@@ -955,16 +951,27 @@ char **av;
display = old;
Msg(0, "Could not make display.");
close(f);
+ close(sf);
+ return -1;
+ }
+ if (CloneTermcap(old))
+ {
+ FreeDisplay();
+ display = old;
+ close(sf);
return -1;
}
+
SetMode(&D_OldMode, &D_NewMode);
SetTTY(f, &D_NewMode);
+
switch (fork())
{
case -1:
FreeDisplay();
display = old;
Msg(errno, "fork");
+ close(sf);
return -1;
case 0:
D_usertty[0] = 0; /* for SendErrorMsg */
@@ -1016,7 +1023,6 @@ char **av;
break;
}
close(sf);
- CloneTermcap(old);
InitTerm(0);
Activate(0);
if (D_fore == 0)
@@ -1026,12 +1032,22 @@ char **av;
extern struct term term[]; /* terminal capabilities */
-static void
+static int
CloneTermcap(old)
struct display *old;
{
char *tp;
- int i;
+ int i, l;
+
+ l = 0;
+ for (i = 0; i < T_N; i++)
+ if (term[i].type == T_STR && old->d_tcs[i].str)
+ l += strlen(old->d_tcs[i].str) + 1;
+ if ((D_tentry = (char *)malloc(l)) == 0)
+ {
+ Msg(0, strnomem);
+ return -1;
+ }
tp = D_tentry;
for (i = 0; i < T_N; i++)
@@ -1073,7 +1089,10 @@ struct display *old;
#ifdef AUTO_NUKE
D_auto_nuke = old->d_auto_nuke;
#endif
+ if (D_CXC)
+ CreateTransTable(D_CXC);
D_tcinited = 1;
+ return 0;
}
#endif
diff --git a/src/window.h b/src/window.h
index 37cfc69..11b76e2 100644
--- a/src/window.h
+++ b/src/window.h
@@ -15,7 +15,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
****************************************************************
* $Id$ FAU
@@ -43,6 +44,8 @@ struct NewWindow
int c1;
int gr;
int kanji;
+ char *hstatus;
+ char *charset;
};
@@ -100,13 +103,6 @@ struct pseudowin
#endif /* PSEUDOS */
-struct displaylist
-{
- struct displaylist *next;
- struct display *d;
-};
-
-#define w_display w_dlist->d
struct win
@@ -115,7 +111,7 @@ struct win
#ifdef PSEUDOS
struct pseudowin *w_pwin; /* ptr to pseudo */
#endif
- struct displaylist *w_dlist; /* pointer to our display */
+ struct display *w_display; /* pointer to our display */
struct display *w_pdisplay; /* display for printer relay */
int w_number; /* window number */
int w_active; /* is window fore and has no layer? */
@@ -142,13 +138,11 @@ struct win
#if defined (UTMPOK)
struct utmp w_savut; /* utmp entry of this window */
#endif
- char **w_image;
- char **w_attr;
- char **w_font;
+ struct mline *w_mlines;
int w_x, w_y; /* Cursor position */
int w_width, w_height; /* window size */
- char w_Attr; /* character attributes */
- char w_Font; /* character font GL */
+ struct mchar w_rend; /* current rendition */
+ char w_FontL; /* character font GL */
char w_FontR; /* character font GR */
int w_Charset; /* charset number GL */
int w_CharsetR; /* charset number GR */
@@ -156,7 +150,7 @@ struct win
int w_ss;
int w_saved;
int w_Saved_x, w_Saved_y;
- char w_SavedAttr;
+ struct mchar w_SavedRend;
int w_SavedCharset;
int w_SavedCharsetR;
int w_SavedCharsets[4];
@@ -168,6 +162,7 @@ struct win
int w_cursorkeys; /* appl. cursorkeys mode */
int w_revvid; /* reverse video */
int w_curinv; /* cursor invisible */
+ int w_curvvis; /* cursor very visible */
int w_autolf; /* automatic linefeed */
char *w_hstatus; /* hardstatus line */
#ifdef COPY_PASTE
@@ -176,9 +171,9 @@ struct win
int w_pastelen; /* bytes left to paste */
int w_histheight; /* all histbases are malloced with width * histheight */
int w_histidx; /* 0 <= histidx < histheight; where we insert lines */
- char **w_ihist; /* the history buffer image */
- char **w_ahist; /* attributes */
- char **w_fhist; /* fonts */
+ struct mline *w_hlines; /* history buffer */
+#else
+ int w_histheight; /* always 0 */
#endif
enum state_t w_state; /* parser state */
enum string_t w_StringType;
@@ -228,14 +223,11 @@ struct win
/*
- * iWIN gives us a reference to line y of the *whole* image
+ * WIN gives us a reference to line y of the *whole* image
* where line 0 is the oldest line in our history.
- * y must be in WIN coordinate system, not in display.
+ * y must be in whole image coordinate system, not in display.
*/
-#define iWIN(y) ((y < fore->w_histheight) ? fore->w_ihist[(fore->w_histidx + y)\
- % fore->w_histheight] : fore->w_image[y - fore->w_histheight])
-#define aWIN(y) ((y < fore->w_histheight) ? fore->w_ahist[(fore->w_histidx + y)\
- % fore->w_histheight] : fore->w_attr[y - fore->w_histheight])
-#define fWIN(y) ((y < fore->w_histheight) ? fore->w_fhist[(fore->w_histidx + y)\
- % fore->w_histheight] : fore->w_font[y - fore->w_histheight])
+#define WIN(y) ((y < fore->w_histheight) ? \
+ &fore->w_hlines[(fore->w_histidx + y) % fore->w_histheight] \
+ : &fore->w_mlines[y - fore->w_histheight])