diff -c -b R5.orig/0.README dist/0.README *** R5.orig/0.README Wed Sep 29 11:03:23 1993 --- dist/0.README Wed Sep 29 11:08:11 1993 *************** *** 0 **** --- 1,129 ---- + "Well, here it is, finally" :-). + + This is basically the MIT X11R5 xterm with color added. + Almost none of it is original work; I had the R4 color xterm, I ran + big diffs, and I did the ugly, nasty, brutish and all-too-long job + of porting the changes from one version to the other. + + Many instances of "2" needed to be changed to "4", which can be + hard to find when you're selectively applying diffs by hand. + + At the end of this file follows the explanation file from the R4 + version. Their item "1)" is irrelevant to the R5 version, and their + item "3)" I did not include in this version because blitting never + helped *me*. ;-) + + + + This is basically the MIT X11R5 xterm with color added, but I also + put in two tiny amounts of original code: + + I added a couple of new actions, to help with character-oriented + editors. I wanted to be able to move the cursor by pointing and + clicking, but none of the old mouseing stuff seemed right. These new + actions are not, by default, bound to anything at all. + + Their names are vi-button() and dired-button(). + example of binding: + ~Shift ~Ctrl ~Mod1 : dired-button() \n\ + + vi-button() only tries to go to the correct line, and may not + succeed if there are any long lines on the screen; they wrap to + the next screen line and are skipped over by the down-arrow + command, and can't be compensated for by vi-button. + My local vi users love it, though. + + If you run gnu emacs, no doubt you already have better ways to + do this... + + Also, I made a new slot in the font menu, to store the + previously-valid fontname provided from a selection. (The standard + xterm stores this in the menu slot used for fontnames provided by + escape sequence; which I don't like). + + + The file R4color.man is the manual page for the R4 color xterm. + I haven't fixed up the R5 manpage :-(. Sorry. + + + I take no further responsibility for this code, very little of which + originates with me. + It compiles and runs fine for me, and I use it constantly. + The standard MIT xterm ought to have color support, so you shouldn't + need this -- but alas! things aren't that way, so many people will + be happy to get this! + + ======== README.new from the R4 color xterm: ============== + + Well, here it is, finally. This is basically an R4 xterm with lots of + changes. The major changes are listed below. I should emphasize that + no differences from the raw R4 xterm are in any way official MIT stuff. + + A lot of this was done in our spare time, and Silicon Graphics takes + absolutely no responsibility for any of this. The authors of the + major pieces of code are listed purely to give credit where credit + is due. Please don't bother anyone but me about this, as Erik and Paul + are both extremely busy guys. + + It is conceivable that I will continue to work on the color stuff now + that I'm going to be back at school, so if anyone wants to fix + something, or enhance something I'll be happy to take your patches. + + Here are the major changes we've made: + + 1) Rearranged and rewrote most of main.c + + Paul Shupak (shupak@esd.sgi.com) did most of this. + + 2) Added ISO 6429 support for color text. You can set the foreground + and background color for text using SGR. For example, to make the + foreground red, you do: "^[[31m". The values from 30 to 37 set + foreground, those from 40 to 47 set background. The default colors + are: + 0) black 1) red 2) green 3) yellow 4) blue 5) magenta + 6) cyan 7) white + + These are settable with the resources "color0" to "color1". + + 3) Added a resource, menu option, and command line flag for selecting + between scrolling by bliting the window, and scrolling by redrawing + the whole window. On some servers (most notably SGI's ;-) redrawing + is faster than bliting. The command line flags are -blt/+blt, and + the resource is "bltScroll". + + Both 2) and 3) are the fault of me, Tom Weinstein. + (tomw@esd.sgi.com, tom@bears.ucsb.edu) + + NOTE: I'll be back at ucsb after Sept 19th, and my sgi + address will no longer be valid. + + 4) Added escape sequences to set the primary rendition text foreground + color, background color, text cursor color, mouse foreground and + background colors and the Tektronix mode Foreground and Background + colors. These are done with a 'Set Text Parameters' control sequence + (^[]Ps^G) where Ps is 10-16 followed by a list of color names. For + more details, see the cltseqs document. This feature can be enabled + with the dynamicColor resource. One useful trick you can do with + this feature is to have different color backgrounds depending on what + machine you are logged onto. A simple escape sequence in your prompt + string ensures that the color is right, even when you rlogin to + another machine. + + This was designed and implemented by Erik Fortune (erik@esd.sgi.com). + + + One thing to note is that the ANSI color, and the dynamic color features + are totally orthogonal and use completely different color + representations. The ANSI color uses eight predefined colors, and the + dynamic color uses color names, include #NNN specifications. + + Tom Weinstein + Silicon Graphics, Inc., Entry Systems Division, Window Systems + tomw@orac.esd.sgi.com + Any opinions expressed above are mine, not sgi's. + + **************************************************************** + * * + * NOTE: After Sept 19th, my address will be tom@bears.ucsb.edu * + * * + **************************************************************** diff -c -b R5.orig/R4color.man dist/R4color.man *** R5.orig/R4color.man Wed Sep 29 11:06:11 1993 --- dist/R4color.man Wed Sep 29 11:05:52 1993 *************** *** 0 **** --- 1,1602 ---- + .TH XTERM 1 "Release 4" "X Version 11" + .SH NAME + xterm \- terminal emulator for X + .SH SYNOPSIS + .B xterm + [-\fItoolkitoption\fP ...] [-option ...] + .SH DESCRIPTION + The \fIxterm\fP program is a terminal emulator for the X Window System. + It provides DEC VT102 and Tektronix 4014 + compatible terminals for programs that can't + use the window system directly. If the underlying operating system supports + terminal resizing capabilities (for example, the SIGWINCH signal in systems + derived from 4.3bsd), \fIxterm\fP will use the facilities to notify programs + running in the window whenever it is resized. + .PP + The VT102 and Tektronix 4014 terminals each have their own window so that you + can edit text in one and look at graphics in the other at the same time. + To maintain the correct aspect ratio (height/width), Tektronix graphics will + be restricted to the largest box with a 4014's aspect ratio that will fit in + the window. This box is located in the upper left area of the window. + .PP + Although both windows may be displayed at the same time, one of them is + considered the ``active'' window for receiving keyboard input and terminal + output. This is the window that contains the text cursor and whose border + highlights whenever the pointer is in either window. + The active window can be chosen through escape sequences, + the ``Modes'' menu in the VT102 window, and the ``Tektronix'' + menu in the 4014 window. + .SH OPTIONS + The \fIxterm\fP terminal emulator + accepts all of the standard X Toolkit command line options as well as + the following (if the option begins with a + .RB ` + ' + instead of a + .RB ` \- ', + the option is restored to its default value): + .TP 8 + .B \-help + This causes \fIxterm\fP to print out a verbose message describing its options. + .TP 8 + .B \-132 + Normally, the VT102 DECCOLM escape sequence that switches between 80 and + 132 column mode is ignored. + This option causes the DECCOLM escape sequence to be recognized, and the + .I xterm + window will resize appropriately. + .TP 8 + .B \-ah + This option indicates that + .I xterm + should always highlight the text cursor and borders. By default, + .I xterm + will display a hollow text cursor whenever the focus is lost or the + pointer leaves the window. + .TP 8 + .B \+ah + This option indicates that + .I xterm + should do text cursor highlighting. + .TP 8 + .BI \-b " number" + This option specifies the size of the inner border (the distance between + the outer edge of the characters and the window border) in pixels. The + default is 2. + .TP 8 + .B "\-cc \fIcharacterclassrange\fP:\fIvalue\fP[,...]" + This sets classes indicated by the given ranges for using in selecting by + words. See the section specifying character classes. + .TP 8 + .B "\-cn" + This option indicates that newlines should not be cut in line-mode + selections. + .TP 8 + .B \+cn + This option indicates that newlines should be cut in line-mode selections. + .TP 8 + .BI \-cr " color" + This option specifies the color to use for text cursor. The default is to + use the same foreground color that is used for text. + .TP 8 + .B \-cu + This option indicates that \fIxterm\fP should work around a bug in the + .IR curses (3x) + cursor motion package that causes the + .IR more (1) + program to display lines that are exactly the width of the window and + are followed by a line beginning with a tab to be displayed incorrectly + (the leading tabs are not displayed). + .TP 8 + .B \+cu + This option indicates that that \fIxterm\fP should not work around the + .IR curses (3x) + bug mentioned above. + .TP 8 + .BI \-e " program \[arguments \.\.\.\]" + This option specifies the program (and its command line arguments) to be + run in the \fIxterm\fP window. It also sets the window title and icon + name to be the basename of the program being executed if neither \fI-T\fP + nor \fI-n\fP are given on the command line. \fBThis must be the last + option on the command line.\fP + .TP 8 + .BI \-fb " font" + This option specifies a font to be used when displaying bold text. + This font must be the same height and width as the normal font. + If only one of the normal or bold fonts is specified, it will be used as the + normal font and the bold font will be produced by overstriking this font. + The default is to do overstriking of the normal font. + .TP 8 + .B \-j + This option indicates that \fIxterm\fP should do jump scrolling. Normally, + text is scrolled one line at a time; this option allows \fIxterm\fP to move + multiple lines at a time so that it doesn't fall as far behind. Its use is + strongly recommended since it make \fIxterm\fP much faster when scanning + through large amounts of text. The VT100 escape sequences for enabling and + disabling smooth scroll as well as the ``Modes'' menu can be used to turn this + feature on or off. + .TP 8 + .B \+j + This option indicates that \fIxterm\fP should not do jump scrolling. + .TP 8 + .B \-blt + This option indicates that \fIxterm\fP should scroll by copying the text + that is to be scrolled from one part of the window to another and then + drawing text that was not available to be copied into the remaining area + of the window. This is the normal method for scrolling as copying is + usually faster than drawing text. The ``Modes'' menu can be used to + turn this feature on or off. + .TP 8 + .B \+blt + This option indicates that \fIxterm\fP should not do blt scrolling. + Instead, the entire contents of the scrolled region are redrawn. This + is faster on some machines. + .TP 8 + .B \-l + This option indicates that \fIxterm\fP should send all terminal output to + a log file as well as to the screen. This option can be enabled or disabled + using the ``xterm X11'' menu. + .TP 8 + .B \+l + This option indicates that \fIxterm\fP should not do logging. + .TP 8 + .BI \-lf " filename" + This option specifies the name of the file to which the output log described + above is written. If \fIfile\fP begins with a pipe symbol (|), the rest of + the string is assumed to be a command to be used as the endpoint of a pipe. + The default filename is ``\fBXtermLog.\fIXXXXX\fR'' (where \fIXXXXX\fP + is the process id of \fIxterm\fP) and is created in the directory from which + \fIxterm\fP was started (or the user's home directory in the case of a + login window). + .TP 8 + .B \-ls + This option indicates that the shell that is started in the \fIxterm\fP window + be a login shell (i.e. the first character of argv[0] will be a dash, + indicating to the shell that it should read the user's .login or .profile). + .TP 8 + .B \+ls + This option indicates that the shell that is started should not be a login + shell (i.e. it will be a normal ``subshell''). + .TP 8 + .B \-mb + This option indicates that \fIxterm\fP should ring a margin bell when + the user types near the right end of a line. This option can be turned on + and off from the ``Modes'' menu. + .TP 8 + .B \+mb + This option indicates that margin bell should not be rung. + .TP 8 + .B "\-mc milliseconds" + This option specifies the maximum time between multi-click selections. + .TP 8 + .BI \-ms " color" + This option specifies the color to be used for the pointer cursor. The default + is to use the foreground color. + .TP 8 + .BI \-nb " number" + This option specifies the number of characters from the right end of a line + at which the margin bell, if enabled, will ring. The default is 10. + .TP 8 + .B \-rw + This option indicates that reverse-wraparound should be allowed. This allows + the cursor to back up from the leftmost column of one line to the rightmost + column of the previous line. This is very useful for editing long shell + command lines and is encouraged. This option can be turned on and off from + the ``Modes'' menu. + .TP 8 + .B \+rw + This option indicates that reverse-wraparound should not be allowed. + .TP 8 + .B \-aw + This option indicates that auto-wraparound should be allowed. This + allows the cursor to automatically wrap to the beginning of the next + line when when it is at the rightmost position of a line and text is + output. + .TP 8 + .B \+aw + This option indicates that auto-wraparound should not be allowed. + .TP 8 + .B \-s + This option indicates that \fIxterm\fP may scroll asynchronously, meaning that + the screen does not have to be kept completely up to date while scrolling. + This allows \fIxterm\fP to run faster when network latencies are very high + and is typically useful when running across a very large internet or many + gateways. + .TP 8 + .B \+s + This option indicates that \fIxterm\fP should scroll synchronously. + .TP 8 + .B \-sb + This option indicates that some number of lines that are scrolled off the top + of the window should be saved and that a scrollbar should be displayed so that + those lines can be viewed. This option may be turned on and off from the + ``Modes'' menu. + .TP 8 + .B \+sb + This option indicates that a scrollbar should not be displayed. + .TP 8 + .B \-sf + This option indicates that Sun Function Key escape codes should be generated + for function keys. + .TP 8 + .B \+sf + This option indicates that the standard escape codes should be generated for + function keys. + .TP 8 + .B \-si + This option indicates that output to a window should not automatically + reposition the screen to the bottom of the scrolling region. + This option can be turned on and off from the ``Modes'' menu. + .TP 8 + .B \+si + This option indicates that output to a window should cause it to + scroll to the bottom. + .TP 8 + .B \-sk + This option indicates that pressing a key while + using the scrollbar to review previous lines of text should + cause the window to be repositioned automatically in the normal position at the + bottom of the scroll region. + .TP 8 + .B \+sk + This option indicates that pressing a key while using the scrollbar + should not cause the window to be repositioned. + .TP 8 + .BI \-sl " number" + This option specifies the number of lines to save that have been scrolled + off the top of the screen. The default is 64. + .TP 8 + .B \-t + This option indicates that \fIxterm\fP should start in Tektronix mode, rather + than in VT102 mode. Switching between the two windows is done using the + ``Modes'' menus. + .TP 8 + .B \+t + This option indicates that \fIxterm\fP should start in VT102 mode. + .TP 8 + .BI \-tm " string" + This option specifies a series of terminal setting keywords followed by the + characters that should be bound to those functions, similar to the \fIstty\fP + program. Allowable keywords include: intr, quit, erase, kill, eof, + eol, swtch, start, stop, brk, susp, dsusp, rprnt, flush, weras, and lnext. + Control characters may be specified as ^char (e.g. ^c or ^u) and ^? may be + used to indicate delete. + .TP 8 + .BI \-tn " name" + This option specifies the name of the terminal type to be set in the TERM + environment variable. This terminal type must exist in the \fItermcap(5)\fP + database and should have \fIli#\fP and \fIco#\fP entries. + .TP 8 + .B \-ut + This option indicates that \fIxterm\fP shouldn't write a record into the + the system log file \fI/etc/utmp\fP. + .TP 8 + .B \+ut + This option indicates that \fIxterm\fP should write a record into the system + log file \fI/etc/utmp\fP. + .TP 8 + .B \-vb + This option indicates that a visual bell is preferred over an audible one. + Instead of ringing the terminal bell whenever a Control-G is received, the + window will be flashed. + .TP 8 + .B \+vb + This option indicates that a visual bell should not be used. + .TP 8 + .B \-wf + This option indicates that \fIxterm\fP should wait for the window to be mapped + the first time before starting the subprocess so that the initial terminal + size settings and environment variables are correct. It is the application's + responsibility to catch subsequent terminal size changes. + .TP 8 + .B \+wf + This option indicates that \fIxterm\fP show not wait before starting the + subprocess. + .TP 8 + .B \-C + This option indicates that this window should receive console output. This + is not supported on all systems. + .TP 8 + .B \-S\fIccn\fP + This option specifies the last two letters of the name of a pseudoterminal + to use in slave mode, plus the number of the inherited file descriptor. + The option is parsed "%c%c%d". + This allows \fIxterm\fP to be used as an input and + output channel for an existing program and is sometimes used in specialized + applications. + .PP + The following command line arguments are provided for compatibility with + older versions. They may not be supported in the next release as the X + Toolkit provides standard options that accomplish the same task. + .TP 8 + .B "%\fIgeom\fP" + This option specifies the preferred size and position of the Tektronix window. + It is shorthand for specifying the "\fI*tekGeometry\fP" resource. + .TP 8 + .B \#\fIgeom\fP + This option specifies the preferred position of the icon window. + It is shorthand for specifying the "\fI*iconGeometry\fP" resource. + .TP 8 + .BI \-T " string" + This option specifies the title for \fIxterm\fP's windows. + It is equivalent to \fB-title\fP. + .TP 8 + .BI \-n " string" + This option specifies the icon name for \fIxterm\fP's windows. + It is shorthand for specifying the "\fI*iconName\fP" resource. + Note that this is not the same as the toolkit option \fB-name\fP (see below). + The default icon name is the application name. + .TP 8 + .B \-r + This option indicates that reverse video should be simulated by swapping + the foreground and background colors. It is equivalent to + \fB-reversevideo\fP or \fB-rv\fP. + .TP 8 + .BI \-w " number" + This option specifies the width in pixels of the border surrounding the window. + It is equivalent to \fB-borderwidth\fP or \fB-bw\fP. + .PP + The following standard X Toolkit command line arguments are commonly used + with \fIxterm\fP: + .TP 8 + .B \-bg \fIcolor\fP + This option specifies the color to use for the background of the window. + The default is ``white.'' + .TP 8 + .B \-bd \fIcolor\fP + This option specifies the color to use for the border of the window. + The default is ``black.'' + .TP 8 + .B \-bw \fInumber\fP + This option specifies the width in pixels of the border surrounding the window. + .TP 8 + .B \-fg \fIcolor\fP + This option specifies the color to use for displaying text. The default is + ``black''. + .TP 8 + .B \-fn \fIfont\fP + This option specifies the font to be used for displaying normal text. The + default is \fIfixed\fP. + .TP 8 + .B \-name \fIname\fP + This option specifies the application name under which resources are to be + obtained, rather than the default executable file name. + \fIName\fP should not contain ``.'' or ``*'' characters. + .TP 8 + .B \-title \fIstring\fP + This option specifies the window title string, which may be displayed by + window managers if the user so chooses. The default title is the command + line specified after the \fB-e\fP option, if any, otherwise the application + name. + .TP 8 + .B \-rv + This option indicates that reverse video should be simulated by swapping + the foreground and background colors. + .TP 8 + .B \-geometry \fIgeometry\fP + This option specifies the preferred size and position of the VT102 window; + see \fIX(1)\fP. + .TP 8 + .B \-display \fIdisplay\fP + This option specifies the X server to contact; see \fIX(1)\fP. + .TP 8 + .B \-xrm \fIresourcestring\fP + This option specifies a resource string to be used. This is especially + useful for setting resources that do not have separate command line options. + .TP 8 + .B \-iconic + This option indicates that \fIxterm\fP should ask the window manager to + start it as an icon rather than as the normal window. + .B \-dc + This option disables the escape sequence to change the vt100 foreground + and background colors, the text cursor color, the mouse cursor foreground + and background colors and the Tektronix emulator foreground and background + colors. + .B \+dc + This option enables the escape sequence to change the vt100 foreground + and background colors, the text cursor color, the mouse cursor foreground + and background colors and the Tektronix emulator foreground and background + .SH RESOURCES + The program understands all of the core X Toolkit resource names and + classes as well as: + .\".in +1in + .TP 8 + .B "iconGeometry (\fPclass\fB IconGeometry)" + Specifies the preferred size and position of the application when iconified. + It is not necessarily obeyed by all window managers. + .TP 8 + .B "termName (\fPclass\fB TermName)" + Specifies the terminal type name to be set in the TERM environment variable. + .TP 8 + .B "title (\fPclass\fB Title)" + Specifies a string that may be used by the window manager when displaying + this application. + .TP 8 + .B "ttyModes (\fPclass\fB TtyModes)" + Specifies a string containing terminal setting keywords and the characters + to which they may be bound. Allowable keywords include: intr, quit, + erase, kill, eof, eol, swtch, start, stop, brk, susp, dsusp, rprnt, flush, + weras, and lnext. Control characters may be specified as ^char (e.g. ^c or ^u) + and ^? may be used to indicate delete. This is very useful for overriding + the default terminal settings without having to do an \fIstty\fP every time + an \fIxterm\fP is started. + .TP 8 + .B "utmpInhibit (\fPclass\fB UtmpInhibit)" + Specifies whether or not \fIxterm\fP should try to record the user's terminal + in \fI/etc/utmp\fP. + .TP 8 + .B "sunFunctionKeys (\fPclass\fB SunFunctionKeys)" + Specifies whether or not Sun Function Key escape codes should be generated for + function keys instead of standard escape sequences. + .\".in -1in + .sp + .PP + The following resources are specified as part of the \fIvt100\fP widget (class + \fIVT100\fP): + .\".in +1in + .TP 8 + .B "allowSendEvents (\fPclass\fB AllowSendEvents)" + Specifies whether or not synthetic key and button events (generated using + the X protocol SendEvent request) should be interpreted or discarded. + The default is ``false'' meaning they are discarded. Note that allowing + such events creates a very large security hole. + .sp + .TP 8 + .B "alwaysHighlight (\fPclass\fB AlwaysHighlight)" + Specifies whether or not \fIxterm\fP should always display a highlighted + text cursor. By default, a hollow text cursor is displayed whenever the + pointer moves out of the window or the window loses the input focus. + .TP 8 + .B "bltScroll (\fPclass\fB BltScroll)" + Specifies whether or not blt scroll should be used. The default is ``true''. + .TP 8 + .B "boldFont (\fPclass\fB Font)" + Specifies the name of the bold font to use instead of overstriking. + .TP 8 + .B "c132 (\fPclass\fB C132)" + Specifies whether or not the VT102 DECCOLM escape sequence should be honored. + The default is ``false.'' + .TP 8 + .B "charClass (\fPclass\fB CharClass)" + Specifies comma-separated lists of character class bindings of the form + \[\fIlow\fP-\]\fIhigh\fP:\fIvalue\fP. These are used in determining which + sets of characters should be treated the same when doing cut and paste. + See the section on specifying character classes. + .TP 8 + color0 (\fPclass\fB Foreground) + .TP 8 + color1 (\fPclass\fB Foreground) + .TP 8 + color2 (\fPclass\fB Foreground) + .TP 8 + color3 (\fPclass\fB Foreground) + .TP 8 + color4 (\fPclass\fB Foreground) + .TP 8 + color5 (\fPclass\fB Foreground) + .TP 8 + color6 (\fPclass\fB Foreground) + .TP 8 + .B "color7 (\fPclass\fB Foreground)" + These specify the colors for the ISO 6429 extension. The defaults are, + respectively, black, red, green, yellow, blue, magenta, cyan, and white. + .TP 8 + .B "curses (\fPclass\fB Curses)" + Specifies whether or not the last column bug in + .IR curses (3x) + should be worked around. + The default is ``false.'' + .TP 8 + .B "background (\fPclass\fB Background)" + Specifies the color to use for the background of the window. The default is + ``white.'' + .TP 8 + .B "foreground (\fPclass\fB Foreground)" + Specifies the color to use for displaying text in the window. Setting the + class name instead of the instance name is an easy way to have everything + that would normally appear in the "text" color change color. The default + is ``black.'' + .TP 8 + .B "cursorColor (\fPclass\fB Foreground)" + Specifies the color to use for the text cursor. The default is ``black.'' + .TP 8 + .B "eightBitInput (\fPclass\fB EightBitInput\fP)" + Specifies whether or not eight-bit characters input from the keyboard should + be accepted as is or converted into a sequence of escape-7bit characters. + The default is ``true.'' + .TP 8 + .B "eightBitOutput (\fPclass\fB EightBitOutput\fP)" + Specifies whether or not eight-bit characters sent from the host should be + accepted as is or stripped when printed. The default is ``true.'' + .TP 8 + .B "font (\fPclass\fB Font)" + Specifies the name of the normal font. The default is ``fixed.'' + .TP 8 + .B "font1 (\fPclass\fB Font1)" + Specifies the name of the first alternate font. + .TP 8 + .B "font2 (\fPclass\fB Font2)" + Specifies the name of the second alternate font. + .TP 8 + .B "font3 (\fPclass\fB Font3)" + Specifies the name of the third alternate font. + .TP 8 + .B "font4 (\fPclass\fB Font4)" + Specifies the name of the fourth alternate font. + .TP 8 + .B "geometry (\fPclass\fB Geometry)" + Specifies the preferred size and position of the VT102 window. + .TP 8 + .B "internalBorder (\fPclass\fB BorderWidth)" + Specifies the number of pixels between the characters and the window border. + The default is 2. + .TP 8 + .B "jumpScroll (\fPclass\fB JumpScroll)" + Specifies whether or not jump scroll should be used. The default is ``true''. + .TP 8 + .B "logFile (\fPclass\fB Logfile)" + Specifies the name of the file to which a terminal session is logged. The + default is ``\fBXtermLog.\fIXXXXX\fR'' (where \fIXXXXX\fP + is the process id of \fIxterm\fP). + .TP 8 + .B "logging (\fPclass\fB Logging)" + Specifies whether or not a terminal session should be logged. The default is + ``false.'' + .TP 8 + .B "logInhibit (\fPclass\fB LogInhibit)" + Specifies whether or not terminal session logging should be inhibited. The + default is ``false.'' + .TP 8 + .B "loginShell (\fPclass\fB LoginShell)" + Specifies whether or not the shell to be run in the window should be started + as a login shell. The default is ``false.'' + .TP 8 + .B "marginBell (\fPclass\fB MarginBell)" + Specifies whether or not the bell should be run when the user types near the + right margin. The default is ``false.'' + .TP 8 + .B "multiScroll (\fPclass\fB MultiScroll)" + Specifies whether or not asynchronous scrolling is allowed. The default is + ``false.'' + .TP 8 + .B "multiClickTime (\fPclass\fB MultiClickTime)" + Specifies the maximum time in milliseconds between multi-clock select + events. The default is 250 milliseconds. + .TP 8 + .B "multiScroll (\fPclass\fB MultiScroll)" + Specifies whether or not scrolling should be done asynchronously. The default + is ``false.'' + .TP 8 + .B "nMarginBell (\fPclass\fB Column)" + Specifies the number of characters from the right margin at which the margin + bell should be run, when enabled. + .TP 8 + .B "pointerColor (\fPclass\fB Foreground)" + Specifies the foreground color of the pointer. The default is + ``XtDefaultForeground.'' + .TP 8 + .B "pointerColorBackground (\fPclass\fB Background)" + Specifies the background color of the pointer. The default is + ``XtDefaultBackground.'' + .TP 8 + .B "pointerShape (\fPclass\fB Cursor)" + Specifies the name of the shape of the pointer. The default is ``xterm.'' + .TP 8 + .B "dynamicColors (\fPclass\fB DynamicColors)" + Specifies whether or not dynamic modification of colors using the escape + sequence is allowed. + .TP 8 + .B "reverseVideo (\fPclass\fB ReverseVideo)" + Specifies whether or not reverse video should be simulated. The default is + ``false.'' + .TP 8 + .B "reverseWrap (\fPclass\fB ReverseWrap)" + Specifies whether or not reverse-wraparound should be enabled. The default is + ``false.'' + .TP 8 + .B "autoWrap (\fPclass\fB AutoWrap)" + Specifies whether or not auto-wraparound should be enabled. The + default is ``true.'' + .TP 8 + .B "saveLines (\fPclass\fB SaveLines)" + Specifies the number of lines to save beyond the top of the screen when a + scrollbar is turned on. The default is 64. + .TP 8 + .B "scrollBar (\fPclass\fB ScrollBar)" + Specifies whether or not the scrollbar should be displayed. The default is + ``false.'' + .TP 8 + .B "scrollTtyOutput (\fPclass\fB ScrollCond)" + Specifies whether or not output to the terminal should automatically cause + the scrollbar to go to the bottom of the scrolling region. The default is + ``true.'' + .TP 8 + .B "scrollKey (\fPclass\fB ScrollCond)" + Specifies whether or not pressing a key should automatically cause the + scrollbar to go to the bottom of the scrolling region. The default is + ``false.'' + .TP 8 + .B "scrollLines (\fPclass\fB ScrollLines)" + Specifies the number of lines that the \fIscroll-back\fP and + \fIscroll-forw\fP actions should use as a default. The default value is 1. + .TP 8 + .B "signalInhibit (\fPclass\fB SignalInhibit)" + Specifies whether or not the entries in the ``xterm X11'' menu for sending + signals to \fIxterm\fP should be disallowed. The default is ``false.'' + .TP 8 + .B "tekGeometry (\fPclass\fB Geometry)" + Specifies the preferred size and position of the Tektronix window. + .TP 8 + .B "tekInhibit (\fPclass\fB TekInhibit)" + Specifies whether or not Tektronix mode should be disallowed. The default is + ``false.'' + .TP 8 + .B "tekSmall (\fPclass\fB TekSmall)" + Specifies whether or not the Tektronix mode window should start in its smallest + size if no explicit geometry is given. This is useful when running \fIxterm\fP + on displays with small screens. The default is ``false.'' + .TP 8 + .B "tekStartup (\fPclass\fB TekStartup)" + Specifies whether or not \fIxterm\fP should start up in Tektronix mode. + The default is ``false.'' + .TP 8 + .B "titeInhibit (\fPclass\fB TiteInhibit)" + Specifies whether or not \fIxterm\fP should remove remove \fIti\fP or \fIte\fP + termcap entries (used to switch between alternate screens on startup of many + screen-oriented programs) from the TERMCAP string. + .TP 8 + .B "translations (\fPclass\fB Translations)" + Specifies the key and button bindings for menus, selections, ``programmed + strings'', etc. See \fBACTIONS\fP below. + .TP 8 + .B "visualBell (\fPclass\fB VisualBell)" + Specifies whether or not a visible bell (i.e. flashing) should be used instead + of an audible bell when Control-G is received. The default is ``false.'' + .TP 8 + .B "waitForMap (\fPclass\fB WaitForMap)" + Specifies whether or not \fIxterm\fP should wait for the initial window map + before starting the subprocess. The default is ``false.'' + .\".in 11in + .sp + .PP + The following resources are specified as part of the \fItek4014\fP widget + (class \fITek4014\fP): + .\".in +1in + .TP 8 + .B "width (\fPclass\fB Width)" + Specifies the width of the Tektronix window in pixels. + .TP 8 + .B "height (\fPclass\fB Height)" + Specifies the height of the Tektronix window in pixels. + .TP 8 + .B "fontLarge (\fPclass\fB Font)" + Specifies the large font to use in the Tektronix window. + .TP 8 + .B "font2 (\fPclass\fB Font)" + Specifies font number 2 to use in the Tektronix window. + .TP 8 + .B "font3 (\fPclass\fB Font)" + Specifies font number 2 font to use in the Tektronix window. + .TP 8 + .B "fontSmall (\fPclass\fB Font)" + Specifies the small font to use in the Tektronix window. + .\".in -1in + .sp + .PP + The resources that may be specified for the various menus are described in + the documentation for the Athena \fBSimpleMenu\fP widget. The name and classes + of the entries in each of the menus are listed below. + .PP + The \fImainMenu\fP has the following entries: + .\".in +1in + .TP 8 + .B "securekbd (\fPclass\fB SmeBSB)" + This entry invokes the \fBsecure()\fP action. + .TP 8 + .B "allowsends (\fPclass\fB SmeBSB)" + This entry invokes the \fBallow-send-events(toggle)\fP action. + .TP 8 + .B "logging (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-logging(toggle)\fP action. + .TP 8 + .B "redraw (\fPclass\fB SmeBSB)" + This entry invokes the \fBredraw()\fP action. + .TP 8 + .B "line1 (\fPclass\fB SmeLine)" + This is a separator. + .TP 8 + .B "suspend (\fPclass\fB SmeBSB)" + This entry invokes the \fBsend-signal(suspend)\fP action on systems that + support job control. + .TP 8 + .B "continue (\fPclass\fB SmeBSB)" + This entry invokes the \fBsend-signal(cont)\fP action on systems that + support job control. + .TP 8 + .B "interrupt (\fPclass\fB SmeBSB)" + This entry invokes the \fBsend-signal(int)\fP action. + .TP 8 + .B "hangup (\fPclass\fB SmeBSB)" + This entry invokes the \fBsend-signal(hup)\fP action. + .TP 8 + .B "terminate (\fPclass\fB SmeBSB)" + This entry invokes the \fBsend-signal(term)\fP action. + .TP 8 + .B "kill (\fPclass\fB SmeBSB)" + This entry invokes the \fBsend-signal(kill)\fP action. + .TP 8 + .B "line2 (\fPclass\fB SmeLine)" + This is a separator. + .TP 8 + .B "quit (\fPclass\fB SmeBSB)" + This entry invokes the \fBquit()\fP action. + .\".in -1in + .sp + .PP + The \fIvtMenu\fP has the following entries: + .\".in +1in + .TP 8 + .B "scrollbar (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-scrollbar(toggle)\fP action. + .TP 8 + .B "jumpscroll (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-jumpscroll(toggle)\fP action. + .TP 8 + .B "bltscroll (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-bltscroll(toggle)\fP action. + .TP 8 + .B "reversevideo (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-reverse-video(toggle)\fP action. + .TP 8 + .B "autowrap (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-autowrap(toggle)\fP action. + .TP 8 + .B "reversewrap (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-reversewrap(toggle)\fP action. + .TP 8 + .B "autolinefeed (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-autolinefeed(toggle)\fP action. + .TP 8 + .B "appcursor (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-appcursor(toggle)\fP action. + .TP 8 + .B "appkeypad (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-appkeypad(toggle)\fP action. + .TP 8 + .B "scrollkey (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-scroll-on-key(toggle)\fP action. + .TP 8 + .B "scrollttyoutput (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-scroll-on-tty-output(toggle)\fP action. + .TP 8 + .B "allow132 (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-allow132(toggle)\fP action. + .TP 8 + .B "cursesemul (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-cursesemul(toggle)\fP action. + .TP 8 + .B "visualbell (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-visualbell(toggle)\fP action. + .TP 8 + .B "marginbell (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-marginbell(toggle)\fP action. + .TP 8 + .B "altscreen (\fPclass\fB SmeBSB)" + This entry is currently disabled. + .TP 8 + .B "line1 (\fPclass\fB SmeLine)" + This is a separator. + .TP 8 + .B "softreset (\fPclass\fB SmeBSB)" + This entry invokes the \fBsoft-reset()\fP action. + .TP 8 + .B "hardreset (\fPclass\fB SmeBSB)" + This entry invokes the \fBhard-reset()\fP action. + .TP 8 + .B "line2 (\fPclass\fB SmeLine)" + This is a separator. + .TP 8 + .B "tekshow (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-visibility(tek,toggle)\fP action. + .TP 8 + .B "tekmode (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-terminal-type(tek)\fP action. + .TP 8 + .B "vthide (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-visibility(vt,off)\fP action. + .\".in -1in + .sp + .PP + The \fIfontMenu\fP has the following entries: + .\".in +1in + .TP 8 + .B "fontdefault (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-vt-font(d)\fP action. + .TP 8 + .B "font1 (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-vt-font(1)\fP action. + .TP 8 + .B "font2 (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-vt-font(2)\fP action. + .TP 8 + .B "font3 (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-vt-font(3)\fP action. + .TP 8 + .B "font4 (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-vt-font(4)\fP action. + .TP 8 + .B "fontescape (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-vt-font(e)\fP action. + .TP 8 + .B "fontsel (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-vt-font(s)\fP action. + .\".in -1in + .sp + .PP + The \fItekMenu\fP has the following entries: + .\".in +1in + .TP 8 + .B "tektextlarge (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-tek-text(l)\fP action. + .TP 8 + .B "tektext2 (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-tek-text(2)\fP action. + .TP 8 + .B "tektext3 (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-tek-text(3)\fP action. + .TP 8 + .B "tektextsmall (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-tek-text(s)\fP action. + .TP 8 + .B "line1 (\fPclass\fB SmeLine)" + This is a separator. + .TP 8 + .B "tekpage (\fPclass\fB SmeBSB)" + This entry invokes the \fBtek-page()\fP action. + .TP 8 + .B "tekreset (\fPclass\fB SmeBSB)" + This entry invokes the \fBtek-reset()\fP action. + .TP 8 + .B "tekcopy (\fPclass\fB SmeBSB)" + This entry invokes the \fBtek-copy()\fP action. + .TP 8 + .B "line2 (\fPclass\fB SmeLine)" + This is a separator. + .TP 8 + .B "vtshow (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-visibility(vt,toggle)\fP action. + .TP 8 + .B "vtmode (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-terminal-type(vt)\fP action. + .TP 8 + .B "tekhide (\fPclass\fB SmeBSB)" + This entry invokes the \fBset-visibility(tek,toggle)\fP action. + .\".in -1in + .sp + .PP + The following resources are useful when specified for the Athena Scrollbar + widget: + .\".in +1in + .TP 8 + .B "thickness (\fPclass\fB Thickness)" + Specifies the width in pixels of the scrollbar. + .TP 8 + .B "background (\fPclass\fB Background)" + Specifies the color to use for the background of the scrollbar. + .TP 8 + .B "foreground (\fPclass\fB Foreground)" + Specifies the color to use for the foreground of the scrollbar. The ``thumb'' + of the scrollbar is a simple checkerboard pattern alternating pixels for + foreground and background color. + .\".in -1in + .SH EMULATIONS + The VT102 emulation is fairly complete, but does not support the blinking + character attribute nor the double-wide and double-size character sets. + .IR Termcap (5) + entries that work with + .I xterm + include ``xterm'', ``vt102'', ``vt100'' and ``ansi'', and + .I xterm + automatically searches the termcap file in this order for these entries and then + sets the ``TERM'' and the ``TERMCAP'' environment variables. + .PP + Many of the special + .I xterm + features (like logging) may be modified under program control + through a set of escape sequences different from the standard VT102 escape + sequences. + (See the + .I ``Xterm Control Sequences'' + document.) + .PP + The Tektronix 4014 emulation is also fairly good. + Four different font sizes and five different lines types are supported. + The Tektronix text and graphics commands are recorded internally by + .I xterm + and may be written to a file by sending the COPY escape sequence (or through + the + .B Tektronix + menu; see below). + The name of the file will be + ``\fBCOPY\fIyy\fB\-\fIMM\fB\-\fIdd\fB.\fIhh\fB:\fImm\fB:\fIss\fR'', where + .IR yy , + .IR MM , + .IR dd , + .IR hh , + .I mm + and + .I ss + are the year, month, day, hour, minute and second when the COPY was performed + (the file is created in the directory + .I xterm + is started in, or the home directory for a login + .IR xterm ). + .SH "POINTER USAGE" + .PP + Once the VT102 window is created, + .I xterm + allows you to select text and copy it within the same or other windows. + .PP + The selection functions are invoked when the pointer buttons are used with no + modifiers, and when they are used with the ``shift'' key. + The assignment of the functions described below to keys and buttons may + be changed through the resource database; see \fBACTIONS\fP below. + .PP + Pointer button one (usually left) is used to save text into the cut buffer. + Move the cursor to beginning of the text, + and then hold the button down while moving the cursor to the end of the region + and releasing the button. + The selected text is highlighted and is saved in the global cut buffer + and made the PRIMARY selection when + the button is released. Double-clicking selects by words. Triple-clicking + selects by lines. Quadruple-clicking goes back to characters, etc. + Multiple-click is determined by the time from button up to + button down, so you can change the selection unit in the middle of a selection. + If the key/button bindings specify that an X selection is to be made, + \fIxterm\fP will leave the selected text highlighted for as long as it + is the selection owner. + .PP + Pointer button two (usually middle) `types' (pastes) the text from + the PRIMARY selection, if any, otherwise from + the cut buffer, + inserting it as keyboard input. + .PP + Pointer button three (usually right) extends the current selection. + (Without loss of generality, + that is you can swap ``right'' and ``left'' everywhere in the rest of this + paragraph...) If pressed while closer to + the right edge of the selection than the left, it extends/contracts the + right edge of the selection. If you contract the selection past + the left edge of the selection, + .I xterm + assumes you really meant the left edge, restores the original selection, then + extends/contracts the left edge of the selection. Extension starts in the + selection unit mode + that the last selection or extension was performed in; you can multiple-click + to cycle through them. + .PP + By cutting and pasting pieces of text without trailing new lines, + you can take text from several places in different windows and form a command + to the shell, for example, or take output from a program and insert it into + your favorite editor. + Since the cut buffer is globally shared among different applications, + you should regard it as a `file' whose contents you know. + The terminal emulator and other text programs should be treating it as if it + were a text file, i.e. the text is delimited by new lines. + .PP + The scroll region displays the position and amount of text currently showing + in the window (highlighted) relative to the amount of text actually saved. + As more text is saved (up to the maximum), the size of the highlighted area + decreases. + .PP + Clicking button one with the pointer in the scroll region moves the + adjacent line to the top of the display window. + .PP + Clicking button three moves the top line of the display window down to the + pointer position. + .PP + Clicking button two moves the display to a position in the saved text + that corresponds to the pointer's position in the scrollbar. + .PP + .PP + Unlike the VT102 window, the Tektronix window dows not allow the copying of + text. + It does allow Tektronix GIN mode, and in this mode + the cursor will change from an arrow to a cross. + Pressing any key will send that key and the current coordinate of the + cross cursor. + Pressing button one, two, or three will return the letters `l', `m', and + `r', respectively. + If the `shift' key is pressed when a pointer button is pressed, the corresponding + upper case letter is sent. + To distinguish a pointer button from a key, the high bit of the character is + set (but this is bit is normally stripped unless the terminal mode is RAW; + see + .IR tty (4) + for details). + .SH MENUS + .PP + .I Xterm + has four menus, named + .IR mainMenu , + .IR vtMenu , + .IR fontMenu , + and + .IR tekMenu . + Each menu pops up under the correct combinations of key and button presses. + Most menus are divided into two section, separated by a horizontal line. + The top portion contains various modes that can be altered. + A check mark appears next to a mode that is currently active. + Selecting one of these modes toggles its state. + The bottom portion of the menu are command entries; selecting one of these + performs the indicated function. + .PP + The + .B xterm + menu pops up when the ``control'' key and pointer button one are + pressed in a window. + The \fImainMenu\fP contains items that apply to both the VT102 and Tektronix + windows. + The + .B Secure Keyboard + mode is be used when typing in passwords or other sensitive data in an + unsecure environment; + see \fBSECURITY\fP below. + Notable entries in the command section of the menu are the + .BR Continue , + .BR Suspend , + .BR Interrupt , + .BR Hangup , + .B Terminate + and + .B Kill + which sends the SIGCONT, SIGTSTP, SIGINT, SIGHUP, SIGTERM and + SIGKILL signals, respectively, to the process group of the process running + under + .I xterm + (usually the shell). + The + .B Continue + function is especially useful if the user has accidentally typed CTRL-Z, + suspending the process. + .PP + The + .I vtMenu + sets various modes in the VT102 emulation, and is popped up when the + ``control'' key and pointer button two are pressed in the VT102 window. + In the command section of this menu, the soft reset entry will reset + scroll regions. + This can be convenient when some program has left the scroll regions + set incorrectly (often a problem when using VMS or TOPS-20). + The full reset entry will clear the screen, reset tabs to every + eight columns, and reset the terminal modes (such as wrap and smooth scroll) + to their initial states just after + .I xterm + has finished processing the command line options. + .PP + The \fIfontMenu\fP sets the font used in the VT102 window. + .PP + The + .I tekMenu + sets various modes in the Tektronix emulation, and is popped up when the + ``control'' key and pointer button two are pressed in the Tektronix window. + The current font size is checked in the modes section of the menu. + The + .B PAGE + entry in the command section clears the Tektronix window. + .SH SECURITY + .PP + X environments differ in their security consciousness. MIT servers, run + under \fIxdm\fP, are capable of using a ``magic cookie'' authorization + scheme that can provide a reasonable level of security for many people. + If your server is only using a host-based mechanism to control access to + the server (see \fIxhost(1)\fP), then if you enable access for a host and + other users are also permitted to run clients on that same host, there is + every possibility that someone can run an application that will use the + basic services of the X protocol to snoop on your activities, potentially + capturing a transcript of everything you type at the keyboard. + This is of particular concern when you want to type in a password or other + sensitive data. The best solution to this problem is to use a better + authorization mechanism that host-based control, but a simple + mechanism exists for protecting keyboard input in \fIxterm\fP. + .PP + The \fBxterm\fP menu (see \fBMENUS\fP above) contains a \fBSecure Keyboard\fP + entry which, when enabled, ensures that all keyboard input is directed + \fIonly\fP to \fIxterm\fP (using the GrabKeyboard protocol request). + When an application prompts you for a password + (or other sensitive data), you can enable \fBSecure Keyboard\fP using the + menu, type in the data, and then disable \fBSecure Keyboard\fP using + the menu again. Only one X client at a time can secure the keyboard, + so when you attempt to enable \fBSecure Keyboard\fP it may fail. In + this case, the bell will sound. If the \fBSecure Keyboard\fP succeeds, + the foreground and background colors will be exchanged (as if you + selected the \fBReverse Video\fP entry in the \fBModes\fP menu); + they will be exchanged again when you exit secure mode. If the colors + do \fInot\fP switch, then + you should be \fIvery\fP suspicious that you are being spoofed. If + the application you are running displays a prompt before asking for + the password, it is safest to enter secure mode \fIbefore\fP the + prompt gets displayed, and to make sure that the prompt gets displayed + correctly (in the new colors), to minimize the probability of + spoofing. You can also bring up the menu again and make sure that a check + mark appears next to the entry. + .PP + \fBSecure Keyboard\fP mode will be disabled automatically if your xterm + window becomes iconified (or otherwise unmapped), or if you start up + a reparenting window manager (that places a title bar or other decoration + around the window) while in \fBSecure Keyboard\fP mode. (This is a + feature of the X protocol not easily overcome.) When this happens, + the foreground and background colors will be switched back and the bell + will sound in warning. + .SH "CHARACTER CLASSES" + Clicking the middle mouse button twice in rapid succession will cause all + characters of the same class (e.g. letters, white space, punctuation) to be + selected. Since different people have different preferences for what should + be selected (for example, should filenames be selected as a whole or only + the separate subnames), the default mapping can be overridden through the use + of the \fIcharClass\fP (class \fICharClass\fP) resource. + .PP + This resource is simply a list of \fIrange\fP:\fIvalue\fP pairs where the + range is either a single number or \fIlow\fP-\fIhigh\fP in the range of 0 + to 127, corresponding to the ASCII code for the character or characters to be + set. The \fIvalue\fP is arbitrary, although the default table uses the + character number of the first character occurring in the set. + .PP + The default table is: + .sp + .in +10 + .nf + static int charClass[128] = { + /* NUL SOH STX ETX EOT ENQ ACK BEL */ + 32, 1, 1, 1, 1, 1, 1, 1, + /* BS HT NL VT NP CR SO SI */ + 1, 32, 1, 1, 1, 1, 1, 1, + /* DLE DC1 DC2 DC3 DC4 NAK SYN ETB */ + 1, 1, 1, 1, 1, 1, 1, 1, + /* CAN EM SUB ESC FS GS RS US */ + 1, 1, 1, 1, 1, 1, 1, 1, + /* SP ! " # $ % & ' */ + 32, 33, 34, 35, 36, 37, 38, 39, + /* ( ) * + , - . / */ + 40, 41, 42, 43, 44, 45, 46, 47, + /* 0 1 2 3 4 5 6 7 */ + 48, 48, 48, 48, 48, 48, 48, 48, + /* 8 9 : ; < = > ? */ + 48, 48, 58, 59, 60, 61, 62, 63, + /* @ A B C D E F G */ + 64, 48, 48, 48, 48, 48, 48, 48, + /* H I J K L M N O */ + 48, 48, 48, 48, 48, 48, 48, 48, + /* P Q R S T U V W */ + 48, 48, 48, 48, 48, 48, 48, 48, + /* X Y Z [ \\ ] ^ _ */ + 48, 48, 48, 91, 92, 93, 94, 48, + /* ` a b c d e f g */ + 96, 48, 48, 48, 48, 48, 48, 48, + /* h i j k l m n o */ + 48, 48, 48, 48, 48, 48, 48, 48, + /* p q r s t u v w */ + 48, 48, 48, 48, 48, 48, 48, 48, + /* x y z { | } ~ DEL */ + 48, 48, 48, 123, 124, 125, 126, 1}; + .fi + .sp + .in -10 + For example, the string ``33:48,37:48,45-47:48,64:48'' indicates that the + exclamation mark, percent sign, dash, period, slash, and ampersand characters + should be treated the same way as characters and numbers. This is very useful + for cutting and pasting electronic mailing addresses and filenames. + .SH ACTIONS + It is possible to rebind keys (or sequences of keys) to arbitrary strings + for input, by changing the translations for the vt100 or tek4014 widgets. + Changing the translations for events other than key and button events + is not expected, and will cause unpredictable behavior. The following + actions are provided for using within the \fIvt100\fP or \fItek4014\fP + \fBtranslations\fP resources: + .TP 8 + .B "bell([\fIpercent\fP])" + This action rings the keyboard bell at the specified percentage + above or below the base volume. + .TP 8 + .B "ignore()" + This action ignores the event but checks for special pointer position + escape sequences. + .TP 8 + .B "insert()" + This action is a synonym for \fBinsert-seven-bit()\fP + .TP 8 + .B "insert-seven-bit()" + This action inserts the 7-bit USASCII character or string associated with + the keysym that was pressed. + .TP 8 + .B "insert-eight-bit()" + This action inserts the 8-bit ISO Latin-1 character or string associated with + the keysym that was pressed. + .TP 8 + .B "insert-selection(\fIsourcename\fP [, ...])" + This action inserts the string found in the selection or cutbuffer indicated + by \fIsourcename\fP. Sources are checked in the order given (case is + significant) until one is found. Commonly-used selections include: + \fIPRIMARY\fP, \fISECONDARY\fP, and \fICLIPBOARD\fP. Cut buffers are + typically named \fICUT_BUFFER0\fP through \fICUT_BUFFER7\fP. + .TP 8 + .B "keymap(\fIname\fP)" + This action dynamically defines a new translation table whose resource + name is \fIname\fP with the suffix \fIKeymap\fP (case is significant). + The name \fINone\fP restores the original translation table. + .TP 8 + .B "popup-menu(\fImenuname\fP)" + This action displays the specified popup menu. Valid names (case is + significant) include: \fImainMenu\fP, \fIvtMenu\fP, \fIfontMenu\fP, + and \fItekMenu\fP. + .TP 8 + .B "secure()" + This action toggles the \fISecure Keyboard\fP mode described in the + section named \fBSECURITY\fP, and is invoked from the \fBsecurekbd\fP + entry in \fImainMenu\fP. + .TP 8 + .B "select-start()" + This action begins text selection at the current pointer location. See + the section on \fBPOINTER USAGE\fP for information on making selections. + .TP 8 + .B "select-extend()" + This action tracks the pointer and extends the selection. It + should only be bound to Motion events. + .TP 8 + .B "select-end(\fIdestname\fP [, ...])" + This action puts the currently selected text into all of the selections or + cutbuffers specified by \fIdestname\fP. + .TP 8 + .B "select-cursor-start()" + This action is similar to \fBselect-start\fP except that it begins the + selection at the current text cursor position. + .TP 8 + .B "select-cursor-end(\fIdestname\fP [, ...])" + This action is similar to \fBselect-end\fP except that it should be used + with \fBselect-cursor-start\fP. + .TP 8 + .B "set-vt-font(\fId/1/2/3/4/e/s\fP [,\fInormalfont\fP [, \fIboldfont\fP]])" + This action sets the font or fonts currently being used in the VT102 window. + The first argument is a single character that specifies the font to be + used: \fId\fP or \fID\fP indicate the default font (the font initially + used when + \fIxterm\fP was started), \fI1\fP through \fI4\fP indicate the fonts + specified by the \fIfont1\fP through \fIfont4\fP resources, \fIe\fP or \fIE\fP + indicate the normal and bold fonts that may be set through escape codes + (or specified as the second and third action arguments, respectively), and + \fIi\fP or \fII\fP indicate the font selection (as made by programs such as + \fIxfontsel(1)\fP) indicated by the second action argument. + .TP 8 + .B "start-extend()" + This action is similar to \fBselect-start\fB except that the + selection is extended to the current pointer location. + .TP 8 + .B "start-cursor-extend()" + This action is similar to \fBselect-extend\fP except that the + selection is extended to the current text cursor position. + .TP 8 + .B "string(\fIstring\fP)" + This action inserts the specified text string as if it had been typed. + Quotation is necessary if the string contains whitespace or + non-alphanumeric characters. If the string argument begins with the + characters ``0x'', it is interpreted + as a hex character constant. + .TP 8 + .B "scroll-back(\fIcount\fP [,\fIunits\fP])" + This action scrolls the text window backward so that text that had previously + scrolled off the top of the screen is now visible. The \fIcount\fP argument + indicates the number of \fIunits\fP (which may be \fIpage\fP, \fIhalfpage\fP, + \fIpixel\fP, or \fIline\fP) by which to scroll. + .TP 8 + .B "scroll-forw(\fIcount\fP [,\fIunits\fP])" + This action scrolls is similar to \fBscroll-back\fP except that it scrolls + the other direction. + .TP 8 + .B "allow-send-events(\fIon/off/toggle\fP)" + This action set or toggles the \fBallowSendEvents\fP resource and is also + invoked by the \fBallowsends\fP entry in \fImainMenu\fP. + .TP 8 + .B "set-logging(\fIon/off/toggle\fP)" + This action toggles the \fBlogging\fP resource and is also invoked + by the \fBlogging\fP entry in \fImainMenu\fP. + .TP 8 + .B "redraw()" + This action redraws the window and is also invoked by the + \fIredraw\fP entry in \fImainMenu\fP. + .TP 8 + .B "send-signal(\fIsigname\fP)" + This action sends the signal named by \fIsigname\fP (which may also be a + number) to the \fIxterm\fP subprocess (the shell or program specified with + the \fI-e\fP command line option) and is also invoked by the + .BR suspend , + .BR continue , + .BR interrupt , + .BR hangup , + .BR terminate , + and + .I kill + entries in \fImainMenu\fP. Allowable signal names are (case is + not significant): + \fIsuspend\fP, \fItstp\fP (if supported by the operating system), \fIcont\fP + (if supported by the operating system), \fIint\fP, \fIhup\fP, \fIterm\fP, + and \fIkill\fP. + .TP 8 + .B "quit()" + This action sends a SIGHUP to the subprogram and exits. It is also invoked + by the \fBquit\fP entry in \fImainMenu\fP. + .TP 8 + .B "set-scrollbar(\fIon/off/toggle\fP)" + This action toggles the \fBscrollbar\fP resource and is also invoked by + the \fBscrollbar\fP entry in \fIvtMenu\fP. + .TP 8 + .B "set-jumpscroll(\fIon/off/toggle\fP)" + This action toggles the \fBjumpscroll\fP resource and is also invoked by the + \fBjumpscroll\fP entry in \fIvtMenu\fP. + .TP 8 + .B "set-bltscroll(\fIon/off/toggle\fP)" + This action toggles the \fBbltscroll\fP resource and is also invoked by the + \fBbltscroll\fP entry in \fIvtMenu\fP. + .TP 8 + .B "set-reverse-video(\fIon/off/toggle\fP)" + This action toggles the \fIreverseVideo\fP resource and is also invoked by + the \fBreversevideo\fP entry in \fIvtMenu\fP. + .TP 8 + .B "set-autowrap(\fIon/off/toggle\fP)" + This action toggles automatic wrapping of long lines and is also invoked by + the \fBautowrap\fP entry in \fIvtMenu\fP. + .TP 8 + .B "set-reversewrap(\fIon/off/toggle\fP)" + This action toggles the \fBreverseWrap\fP resource and is also invoked by + the \fBreversewrap\fP entry in \fIvtMenu\fP. + .TP 8 + .B "set-autolinefeed(\fIon/off/toggle\fP)" + This action toggles automatic insertion of linefeeds and is also invoked by + the \fBautolinefeed\fP entry in \fIvtMenu\fP. + .TP 8 + .B "set-appcursor(\fIon/off/toggle\fP)" + This action toggles the handling Application Cursor Key mode + and is also invoked by the \Bappcursor\fP entry in \fIvtMenu\fP. + .TP 8 + .B "set-appkeypad(\fIon/off/toggle\fP)" + This action toggles the handling of Application Keypad mode and is also + invoked by the \fBappkeypad\fP entry in \fIvtMenu\fP. + .TP 8 + .B "set-scroll-on-key(\fIon/off/toggle\fP)" + This action toggles the \fBscrollKey\fP resource and is also invoked from + the \fBscrollkey\fP entry in \fIvtMenu\fP. + .TP 8 + .B "set-scroll-on-tty-output(\fIon/off/toggle\fP)" + This action toggles the \fBscrollTtyOutput\fP resource and is also invoked + from the \fBscrollttyoutput\fP entry in \fIvtMenu\fP. + .TP 8 + .B "set-allow132(\fIon/off/toggle\fP)" + This action toggles the \fBc132\fP resource and is also invoked from the + \fBallow132\fP entry in \fIvtMenu\fP. + .TP 8 + .B "set-cursesemul(\fIon/off/toggle\fP)" + This action toggles the \fBcurses\fP resource and is also invoked from the + \fBcursesemul\fP entry in \fIvtMenu\fP. + .TP 8 + .B "set-visual-bell(\fIon/off/toggle\fP)" + This action toggles the \fBvisualBell\fP resource and is also invoked + by the \fBvisualbell\fP entry in \fIvtMenu\fP. + .TP 8 + .B "set-marginbell(\fIon/off/toggle\fP)" + This action toggles the \fBmarginBell\fP resource and is also invoked from + the \fBmarginbell\fP entry in \fIvtMenu\fP. + .TP 8 + .B "set-altscreen(\fIon/off/toggle\fP)" + This action toggles between the alternative and current screens. + .TP 8 + .B "soft-reset()" + This action resets the scrolling region and is also invoked from the + \fBsoftreset\fP entry in \fIvtMenu\fP. + .TP 8 + .B "hard-reset()" + This action resets the scrolling region, tabs, window size, and cursor keys + and clears the screen. It is also invoked from the \fBhardreset\fP + entry in \fIvtMenu\fP. + .TP 8 + .B "set-terminal-type(\fItype\fP)" + This action directs output to either the \fIvt\fP or \fItek\fP windows, + according to the \fItype\fP string. It is also invoked by the + \fBtekmode\fP entry in \fIvtMenu\fP and the \fBvtmode\fP entry in + \fItekMenu\fP. + .TP 8 + .B "set-visibility(\fIvt/tek\fP,\fIon/off/toggle\fP)" + This action controls whether or not the \fIvt\fP or \fItek\fP windows are + visible. It is also invoked from the \fBtekshow\fP and \fBvthide\fP entries + in \fIvtMenu\fP and the \fBvtshow\fP and \fBtekhide\fP entries in + \fItekMenu\fP. + .TP 8 + .B "set-tek-text(\fIlarge/2/3/small\fP)" + This action sets font used in the Tektronix window to the value of the + resources \fBtektextlarge\fP, \fBtektext2\fP, \fBtektext3\fP, and + \fBtektextsmall\fP according to the argument. It is also by the entries + of the same names as the resources in \fItekMenu\fP. + .TP 8 + .B "tek-page()" + This action clears the Tektronix window and is also invoked by the + \fBtekpage\fP entry in \fItekMenu\fP. + .TP 8 + .B "tek-reset()" + This action resets the Tektronix window and is also invoked by the + \fItekreset\fP entry in \fItekMenu\fP. + .TP 8 + .B "tek-copy()" + This action copies the escape codes used to generate the current window + contents to a file in the current directory beginning with the name COPY. + It is also invoked from the \fItekcopy\fP entry in \fItekMenu\fP. + .PP + The Tektronix window also has the following action: + .TP 8 + .B "gin-press(\fIl/L/m/M/r/R\fP)" + This action send the indicated graphics input code. + .PP + The default bindings in the VT102 window are: + .sp + .in +4 + .DS + .TA 2.5i + .ta 2.5i + .nf + Shift Prior: scroll-back(1,halfpage) \\n\\ + Shift Next: scroll-forw(1,halfpage) \\n\\ + Shift Select: select-cursor-start() \\ + select-cursor-end(PRIMARY, CUT_BUFFER0) \\n\\ + Shift Insert: insert-selection(PRIMARY, CUT_BUFFER0) \\n\\ + ~Meta: insert-seven-bit() \\n\\ + Meta: insert-eight-bit() \\n\\ + Ctrl ~Meta: popup-menu(mainMenu) \\n\\ + ~Meta : select-start() \\n\\ + ~Meta : select-extend() \\n\\ + Ctrl ~Meta : popup-menu(vtMenu) \\n\\ + ~Ctrl ~Meta : ignore() \\n\\ + ~Ctrl ~Meta : insert-selection(PRIMARY, CUT_BUFFER0) \\n\\ + Ctrl ~Meta : popup-menu(fontMenu) \\n\\ + ~Ctrl ~Meta : start-extend() \\n\\ + ~Meta : select-extend() \\n\\ + ~Ctrl ~Meta : select-end(PRIMARY, CUT_BUFFER0) \\n\\ + : bell(0) + .fi + .DE + .sp + .in -4 + .PP + The default bindings in the Tektronix window are: + .sp + .in +4 + .DS + .TA 2.5i + .ta 2.5i + .nf + ~Meta: insert-seven-bit() \\n\\ + Meta: insert-eight-bit()\\n\\ + Ctrl ~Meta: popup-menu(mainMenu) \\n\\ + Ctrl ~Meta : popup-menu(tekMenu) \\n\\ + Shift ~Meta: gin-press(L) \\n\\ + ~Meta: gin-press(l) \\n\\ + Shift ~Meta: gin-press(M) \\n\\ + ~Meta: gin-press(m) \\n\\ + Shift ~Meta: gin-press(R) \\n\\ + ~Meta: gin-press(r) + .fi + .DE + .sp + .in -4 + .PP + Below is a sample how of the \fBkeymap()\fP action is used to add special + keys for entering commonly-typed works: + .sp + .in +4 + .nf + .DS + .TA .5i 1.5i + .ta .5i 1.5i + .nf + *VT100.Translations: #override F13: keymap(dbx) + *VT100.dbxKeymap.translations: \\ + F14: keymap(None) \\n\\ + F17: string("next") string(0x0d) \\n\\ + F18: string("step") string(0x0d) \\n\\ + F19: string("continue") string(0x0d) \\n\\ + F20: string("print ") insert-selection(PRIMARY, CUT_BUFFER0) + .fi + .DE + .sp + .in -4 + .SH "OTHER FEATURES" + .I Xterm + automatically highlights the window border and text cursor when the + pointer enters the window (selected) and unhighlights them when the pointer + leaves the window (unselected). + If the window is the focus window, then the window is highlighted no matter + where the pointer is. + .PP + In VT102 mode, there are escape sequences to activate and deactivate + an alternate screen buffer, which is the same size as the display area + of the window. + When activated, the current screen is saved and replace with the alternate + screen. + Saving of lines scrolled off the top of the window is disabled until the + normal screen is restored. + The + .IR termcap (5) + entry for + .I xterm + allows the visual editor + .IR vi (1) + to switch to the alternate screen for editing, and restore the screen + on exit. + .PP + In VT102 mode, + .I xterm + supports the ISO 6429 extension of SGR allowing the setting of foreground + and background colors to eight predefined values in addition to the primary + rendition colors. Concealed text is not yet supported. + .PP + In either VT102 or Tektronix mode, there are escape sequences to change the + name of the windows and to specify a new log file name. + .PP + In VT102 mode, there is an escape sequence to change the setting of + any color resource. You may change the VT102 foreground and background colors + (ISO 6429 primary rendition colors), text cursor color, pointer foreground + and background colors or Tektronix emulator foreground and background + colors. + .SH ENVIRONMENT + .I Xterm + sets the environment variables ``TERM'' and ``TERMCAP'' properly for the + size window you have created. + It also uses and sets the environment + variable ``DISPLAY'' to specify which bit map display terminal to use. + The environment variable ``WINDOWID'' is set to the X window id number + of the + .I xterm + window. + .SH "SEE ALSO" + resize(1), X(1), pty(4), tty(4) + .br + .I \fIXterm Control Sequences\fP + .SH BUGS + .PP + The \fIXterm Control Sequences\fP document has yet to be converted from X10. + The old version, along with a first stab at an update, are available in + the sources. + .PP + The class name is \fIXTerm\fP instead of \fIXterm\fP. + .PP + \fBXterm will hang forever if you try to paste too much text at one time.\fP + It is both producer and consumer for the pty and can deadlock. + .PP + Variable-width fonts are not handled. + .PP + This program still needs to be rewritten. It should be split into very + modular sections, with the various emulators being completely separate + widgets that don't know about each other. Ideally, you'd like to be able to + pick and choose emulator widgets and stick them into a single control widget. + .PP + The focus is considered lost if some other client (e.g., the window manager) + grabs the pointer; it is difficult to do better without an addition to the + protocol. + .PP + There needs to be a dialog box to allow entry of log file name + and the COPY file name. + .PP + Many of the options are not resettable after + .I xterm + starts. + .PP + The Tek widget does not support key/button re-binding. + .SH COPYRIGHT + Copyright 1989, Massachusetts Institute of Technology. + .br + See \fIX(1)\fP for a full statement of rights and permissions. + .SH AUTHORS + Far too many people, including: + .sp + Loretta Guarino Reid (DEC-UEG-WSL), + Joel McCormack (DEC-UEG-WSL), Terry Weissman (DEC-UEG-WSL), + Edward Moy (Berkeley), Ralph R. Swick (MIT-Athena), + Mark Vandevoorde (MIT-Athena), Bob McNamara (DEC-MAD), + Jim Gettys (MIT-Athena), Bob Scheifler (MIT X Consortium), Doug Mink (SAO), + Steve Pitschke (Stellar), Ron Newman (MIT-Athena), Jim Fulton (MIT X + Consortium), Dave Serisky (HP) diff -c -b R5.orig/Tekproc.c dist/Tekproc.c *** R5.orig/Tekproc.c Fri Jun 25 15:09:26 1993 --- dist/Tekproc.c Wed Sep 29 11:00:53 1993 *************** *** 1,5 **** /* ! * $XConsortium: Tekproc.c,v 1.107 91/06/25 19:49:48 gildea Exp $ * * Warning, there be crufty dragons here. */ --- 1,5 ---- /* ! * $XConsortium: Tekproc.c,v 1.107 91/06/25 19:49:48 diff Exp $ * * Warning, there be crufty dragons here. */ *************** *** 145,150 **** --- 145,152 ---- extern int Tpttable[]; extern int Tspttable[]; + extern XtAppContext app_con; + static int *curstate = Talptable; static int *Tparsestate = Talptable; *************** *** 595,601 **** TekGINoff(); TCursorDown(); if (!TekRefresh && ! (QLength(screen->display) > 0 || GetBytesAvailable (ConnectionNumber(screen->display)) > 0)) xevents(); break; --- 597,603 ---- TekGINoff(); TCursorDown(); if (!TekRefresh && ! (XtAppPending(app_con) || GetBytesAvailable (ConnectionNumber(screen->display)) > 0)) xevents(); break; *************** *** 695,701 **** TCursorToggle(TOGGLE); Ttoggled = FALSE; } ! if(QLength(screen->display)) Tselect_mask = X_mask; else { XFlush(screen->display); --- 697,703 ---- TCursorToggle(TOGGLE); Ttoggled = FALSE; } ! if(XtAppPending(app_con) & XtIMXEvent) Tselect_mask = X_mask; else { XFlush(screen->display); *************** *** 1149,1154 **** --- 1151,1157 ---- /* * The following is called the create the tekWidget */ + #include static void TekInitialize(request, new) Widget request, new; *************** *** 1436,1441 **** --- 1439,1491 ---- screen->cur.fontsize = newsize; set_tekfont_menu_item (newsize, TRUE); if (!Ttoggled) TCursorToggle(TOGGLE); + } + + void + ChangeTekColors(screen,pNew) + register TScreen *screen; + ScrnColors *pNew; + { + register int i; + XGCValues gcv; + + + if (COLOR_DEFINED(pNew,TEK_FG)) { + screen->Tforeground= COLOR_VALUE(pNew,TEK_FG); + XSetForeground(screen->display,screen->TnormalGC, + screen->Tforeground); + } + if (COLOR_DEFINED(pNew,TEK_BG)) { + screen->Tbackground= COLOR_VALUE(pNew,TEK_BG); + XSetBackground(screen->display,screen->TnormalGC, + screen->Tbackground); + } + + + if (tekWidget) { + if (tekWidget->core.border_pixel == screen->Tbackground) { + tekWidget->core.border_pixel = screen->Tforeground; + tekWidget->core.parent->core.border_pixel = + screen->Tforeground; + if (tekWidget->core.parent->core.window) + XSetWindowBorder (screen->display, + tekWidget->core.parent->core.window, + tekWidget->core.border_pixel); + } + } + + for(i = 0 ; i < TEKNUMLINES ; i++) { + XSetForeground(screen->display, screen->linepat[i], + screen->Tforeground); + } + + screen->Tcursorcolor = screen->Tforeground; + + gcv.plane_mask = screen->xorplane = (screen->Tbackground ^ + screen->Tcursorcolor); + XChangeGC (screen->display, screen->TcursorGC, GCPlaneMask, &gcv); + TekBackground(screen); + return; } TekReverseVideo(screen) diff -c -b R5.orig/XTerm.ad dist/XTerm.ad *** R5.orig/XTerm.ad Fri Jun 25 15:08:31 1993 --- dist/XTerm.ad Wed Sep 29 11:00:55 1993 *************** *** 76,78 **** --- 76,86 ---- *tek4014*font3: 6x13 *tek4014*fontSmall: 6x10 + *color0: Black + *color1: Red + *color2: Green + *color3: Yellow + *color4: Blue + *color5: Magenta + *color6: Cyan + *color7: White diff -c -b R5.orig/button.c dist/button.c *** R5.orig/button.c Fri Jun 25 15:09:19 1993 --- dist/button.c Wed Sep 29 11:00:55 1993 *************** *** 164,170 **** --- 164,226 ---- #undef KeyModifiers } + void + DiredButton(w, event, params, num_params) + Widget w; + XEvent *event; /* must be XButtonEvent */ + String *params; /* selections */ + Cardinal *num_params; + { /* ^XM-G */ + register TScreen *screen = &term->screen; + int pty = screen->respond; + char Line[ 6 ]; + register unsigned line, col; + if (event->type != ButtonPress && event->type != ButtonRelease) + return; + strcpy( Line, "\030\033G " ); + + line = ( event->xbutton.y - screen->border ) / FontHeight( screen ); + col = (event->xbutton.x - screen->border - screen->scrollbar) + / FontWidth(screen); + Line[3] = ' ' + col; + Line[4] = ' ' + line; + v_write(pty, Line, 5 ); + } + + void + ViButton(w, event, params, num_params) + Widget w; + XEvent *event; /* must be XButtonEvent */ + String *params; /* selections */ + Cardinal *num_params; + { /* ^XM-G */ + register TScreen *screen = &term->screen; + int pty = screen->respond; + char Line[ 6 ]; + register int line, col; + + if (event->type != ButtonPress && event->type != ButtonRelease) + return; + + line = screen->cur_row - + (( event->xbutton.y - screen->border ) / FontHeight( screen )); + /* fprintf( stderr, "xtdb line=%d\n", line ); */ + if ( ! line ) return; + Line[ 1 ] = 0; + Line[ 0 ] = 27; + v_write(pty, Line, 1 ); + + Line[ 0 ] = 'p' & 0x1f; + + if ( line < 0 ) + { line = -line; + Line[ 0 ] = 'n' & 0x1f; + } + while ( --line >= 0 ) v_write(pty, Line, 1 ); + } + + /*ARGSUSED*/ void HandleSelectExtend(w, event, params, num_params) Widget w; *************** *** 773,779 **** register Char *ch; for ( i = screen->max_col, ! ch = screen->buf[2 * (row + screen->topline) + 1] + i ; i >= 0 && !(*ch & CHARDRAWN) ; ch--, i--) ; --- 829,835 ---- register Char *ch; for ( i = screen->max_col, ! ch = screen->buf[4 * (row + screen->topline) + 1] + i ; i >= 0 && !(*ch & CHARDRAWN) ; ch--, i--) ; *************** *** 912,918 **** startSCol = 0; startSRow++; } else { ! ptr = screen->buf[2*(startSRow+screen->topline)] + startSCol; class = charClass[*ptr]; do { --- 968,974 ---- startSCol = 0; startSRow++; } else { ! ptr = screen->buf[4*(startSRow+screen->topline)] + startSCol; class = charClass[*ptr]; do { *************** *** 927,933 **** endSRow++; } else { length = LastTextCol(endSRow); ! ptr = screen->buf[2*(endSRow+screen->topline)] + endSCol; class = charClass[*ptr]; do { --- 983,989 ---- endSRow++; } else { length = LastTextCol(endSRow); ! ptr = screen->buf[4*(endSRow+screen->topline)] + endSCol; class = charClass[*ptr]; do { *************** *** 1354,1360 **** int *eol; { register int i = 0; ! register Char *ch = screen->buf[2 * (row + screen->topline)]; Char attr; register int c; --- 1410,1416 ---- int *eol; { register int i = 0; ! register Char *ch = screen->buf[4 * (row + screen->topline)]; Char attr; register int c; diff -c -b R5.orig/charproc.c dist/charproc.c *** R5.orig/charproc.c Mon Jun 28 13:37:58 1993 --- dist/charproc.c Wed Sep 29 11:00:59 1993 *************** *** 1,5 **** /* ! * $XConsortium: charproc.c,v 1.176 92/03/13 18:00:30 gildea Exp $ */ /* --- 1,5 ---- /* ! * $XConsortium: charproc.c,v 1.176 92/03/13 18:00:30 diff Exp $ */ /* *************** *** 64,69 **** --- 64,70 ---- extern jmp_buf VTend; + extern XtAppContext app_con; extern Widget toplevel; extern void exit(); extern char *malloc(); *************** *** 126,131 **** --- 127,140 ---- #define XtNtiteInhibit "titeInhibit" #define XtNvisualBell "visualBell" #define XtNallowSendEvents "allowSendEvents" + #define XtNcolor0 "color0" + #define XtNcolor1 "color1" + #define XtNcolor2 "color2" + #define XtNcolor3 "color3" + #define XtNcolor4 "color4" + #define XtNcolor5 "color5" + #define XtNcolor6 "color6" + #define XtNcolor7 "color7" #define XtCAlwaysHighlight "AlwaysHighlight" #define XtCAppcursorDefault "AppcursorDefault" *************** *** 208,213 **** --- 217,223 ---- extern void HandleCreateMenu(), HandlePopupMenu(); extern void HandleSetFont(); extern void SetVTFont(); + extern void ViButton(), DiredButton(); extern Boolean SendMousePosition(); extern void ScrnSetAttributes(); *************** *** 314,319 **** --- 324,331 ---- { "tek-reset", HandleTekReset }, { "tek-copy", HandleTekCopy }, { "visual-bell", HandleVisualBell }, + { "dired-button", DiredButton }, + { "vi-button", ViButton }, }; static XtResource resources[] = { *************** *** 476,481 **** --- 488,523 ---- {"font6", "Font6", XtRString, sizeof(String), XtOffsetOf(XtermWidgetRec, screen.menu_font_names[fontMenu_font6]), XtRString, (caddr_t) NULL}, + {XtNcolor0, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffset(XtermWidget, screen.colors[COLOR_0]), + XtRString, "XtDefaultForeground"}, + {XtNcolor1, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffset(XtermWidget, screen.colors[COLOR_1]), + XtRString, "XtDefaultForeground"}, + {XtNcolor2, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffset(XtermWidget, screen.colors[COLOR_2]), + XtRString, "XtDefaultForeground"}, + {XtNcolor3, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffset(XtermWidget, screen.colors[COLOR_3]), + XtRString, "XtDefaultForeground"}, + {XtNcolor4, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffset(XtermWidget, screen.colors[COLOR_4]), + XtRString, "XtDefaultForeground"}, + {XtNcolor5, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffset(XtermWidget, screen.colors[COLOR_5]), + XtRString, "XtDefaultForeground"}, + {XtNcolor6, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffset(XtermWidget, screen.colors[COLOR_6]), + XtRString, "XtDefaultForeground"}, + {XtNcolor7, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffset(XtermWidget, screen.colors[COLOR_7]), + XtRString, "XtDefaultForeground"}, + {"font7", "Font7", XtRString, sizeof(String), + XtOffset(XtermWidget, screen.menu_font_names[fontMenu_font7]), + XtRString, (caddr_t) NULL}, + {"dynamicColors", "DynamicColors", XtRBoolean, sizeof(Boolean), + XtOffset(XtermWidget, misc.dynamicColors), + XtRBoolean, (caddr_t) &defaultTRUE}, }; static void VTClassInit(); *************** *** 551,563 **** } if(screen->curss) { dotext(screen, term->flags, ! screen->gsets[screen->curss], bptr, bptr + 1); screen->curss = 0; bptr++; } if(bptr < cp) dotext(screen, term->flags, ! screen->gsets[screen->curgl], bptr, cp); bptr = cp; break; --- 593,609 ---- } if(screen->curss) { dotext(screen, term->flags, ! screen->gsets[screen->curss], bptr, bptr + 1, ! term->cur_foreground, ! term->cur_background ); screen->curss = 0; bptr++; } if(bptr < cp) dotext(screen, term->flags, ! screen->gsets[screen->curgl], bptr, cp, ! term->cur_foreground, ! term->cur_background ); bptr = cp; break; *************** *** 608,614 **** Index(screen, 1); if (term->flags & LINEFEED) CarriageReturn(screen); ! if (QLength(screen->display) > 0 || GetBytesAvailable (ConnectionNumber(screen->display)) > 0) xevents(); parsestate = groundtable; --- 654,660 ---- Index(screen, 1); if (term->flags & LINEFEED) CarriageReturn(screen); ! if (XtAppPending(app_con) || GetBytesAvailable (ConnectionNumber(screen->display)) > 0) xevents(); parsestate = groundtable; *************** *** 842,848 **** switch (param[row]) { case DEFAULT: case 0: ! term->flags &= ~(INVERSE|BOLD|UNDERLINE); break; case 1: case 5: /* Blink, really. */ --- 888,895 ---- switch (param[row]) { case DEFAULT: case 0: ! term->flags &= ! ~(INVERSE|BOLD|UNDERLINE|FG_COLOR|BG_COLOR); break; case 1: case 5: /* Blink, really. */ *************** *** 853,858 **** --- 900,927 ---- break; case 7: term->flags |= INVERSE; + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + term->flags |= FG_COLOR; + term->cur_foreground = param[row] - 30; + break; + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + term->flags |= BG_COLOR; + term->cur_background = param[row] - 40; + break; } } parsestate = groundtable; *************** *** 940,948 **** if(screen->cursor_state) HideCursor(); for(row = screen->max_row ; row >= 0 ; row--) { ! bzero(screen->buf[2 * row + 1], col = screen->max_col + 1); ! for(cp = (unsigned char *)screen->buf[2 * row] ; col > 0 ; col--) *cp++ = (unsigned char) 'E'; } ScrnRefresh(screen, 0, 0, screen->max_row + 1, --- 1009,1017 ---- if(screen->cursor_state) HideCursor(); for(row = screen->max_row ; row >= 0 ; row--) { ! bzero(screen->buf[4 * row + 1], col = screen->max_col + 1); ! for(cp = (unsigned char *)screen->buf[4 * row] ; col > 0 ; col--) *cp++ = (unsigned char) 'E'; } ScrnRefresh(screen, 0, 0, screen->max_row + 1, *************** *** 984,990 **** case CASE_IND: /* IND */ Index(screen, 1); ! if (QLength(screen->display) > 0 || GetBytesAvailable (ConnectionNumber(screen->display)) > 0) xevents(); parsestate = groundtable; --- 1053,1059 ---- case CASE_IND: /* IND */ Index(screen, 1); ! if (XtAppPending(app_con) || GetBytesAvailable (ConnectionNumber(screen->display)) > 0) xevents(); parsestate = groundtable; *************** *** 995,1001 **** Index(screen, 1); CarriageReturn(screen); ! if (QLength(screen->display) > 0 || GetBytesAvailable (ConnectionNumber(screen->display)) > 0) xevents(); parsestate = groundtable; --- 1064,1070 ---- Index(screen, 1); CarriageReturn(screen); ! if (XtAppPending(app_con) || GetBytesAvailable (ConnectionNumber(screen->display)) > 0) xevents(); parsestate = groundtable; *************** *** 1303,1317 **** XFlush(screen->display); /* always flush writes before waiting */ ! /* Update the masks and, unless X events are already in the queue, ! wait for I/O to be possible. */ select_mask = Select_mask; write_mask = ptymask(); select_timeout.tv_sec = 0; select_timeout.tv_usec = 0; ! i = select(max_plus1, &select_mask, &write_mask, (int *)NULL, ! QLength(screen->display) ? &select_timeout ! : (struct timeval *) NULL); if (i < 0) { if (errno != EINTR) SysError(ERROR_SELECT); --- 1372,1397 ---- XFlush(screen->display); /* always flush writes before waiting */ ! /* ! * Update the masks and, unless X events are already in the ! * queue, wait for I/O to be possible. ! */ select_mask = Select_mask; write_mask = ptymask(); select_timeout.tv_sec = 0; + /* + * if there's either an XEvent or an XtTimeout pending, just take + * a quick peek, i.e. timeout from the select() immediately. If + * there's nothing pending, let select() block a little while, but + * for a shorter interval than the arrow-style scrollbar timeout. + */ + if (XtAppPending(app_con)) select_timeout.tv_usec = 0; ! else ! select_timeout.tv_usec = 50000; ! i = select(max_plus1, ! &select_mask, &write_mask, (int *)NULL, ! select_timeout); if (i < 0) { if (errno != EINTR) SysError(ERROR_SELECT); *************** *** 1325,1331 **** /* if there are X events already in our queue, it counts as being readable */ ! if (QLength(screen->display) || (select_mask & X_mask)) { xevents(); } --- 1405,1411 ---- /* if there are X events already in our queue, it counts as being readable */ ! if (XtAppPending(app_con) || (select_mask & X_mask)) { xevents(); } *************** *** 1339,1347 **** * by charset. worry about end of line conditions (wraparound if selected). */ static void ! dotext(screen, flags, charset, buf, ptr) register TScreen *screen; ! unsigned flags; char charset; char *buf; /* start of characters to process */ char *ptr; /* end */ --- 1419,1427 ---- * by charset. worry about end of line conditions (wraparound if selected). */ static void ! dotext(screen, flags, charset, buf, ptr, fg, bg ) register TScreen *screen; ! unsigned flags, fg, bg; char charset; char *buf; /* start of characters to process */ char *ptr; /* end */ *************** *** 1390,1396 **** if (len < n) n = len; next_col = screen->cur_col + n; ! WriteText(screen, ptr, n, flags); /* * the call to WriteText updates screen->cur_col. * If screen->cur_col != next_col, we must have --- 1470,1476 ---- if (len < n) n = len; next_col = screen->cur_col + n; ! WriteText(screen, ptr, n, flags, fg, bg ); /* * the call to WriteText updates screen->cur_col. * If screen->cur_col != next_col, we must have *************** *** 1407,1422 **** * the current cursor position. update cursor position. */ static void ! WriteText(screen, str, len, flags) register TScreen *screen; register char *str; register int len; ! unsigned flags; { register int cx, cy; register unsigned fgs = flags; GC currentGC; if(screen->cur_row - screen->topline <= screen->max_row) { /* if(screen->cur_row == screen->cursor_row && screen->cur_col <= --- 1487,1507 ---- * the current cursor position. update cursor position. */ static void ! WriteText(screen, str, len, flags, fg, bg ) register TScreen *screen; register char *str; register int len; ! unsigned flags, fg, bg; { register int cx, cy; register unsigned fgs = flags; + register Pixel fg_pix, bg_pix; GC currentGC; + fg_pix = (fgs&FG_COLOR) ? screen->colors[fg] : screen->foreground; + bg_pix = (fgs&BG_COLOR) ? screen->colors[bg] : + term->core.background_pixel; + if(screen->cur_row - screen->topline <= screen->max_row) { /* if(screen->cur_row == screen->cursor_row && screen->cur_col <= *************** *** 1430,1444 **** * make sure that the correct GC is current */ - if (fgs & BOLD) if (fgs & INVERSE) currentGC = screen->reverseboldGC; ! else currentGC = screen->normalboldGC; else /* not bold */ ! if (fgs & INVERSE) ! currentGC = screen->reverseGC; ! else currentGC = screen->normalGC; if (fgs & INSERT) InsertChar(screen, len); if (!(AddToRefresh(screen))) { --- 1515,1538 ---- * make sure that the correct GC is current */ if (fgs & INVERSE) + { + if (fgs & BOLD) currentGC = screen->reverseboldGC; ! else currentGC = screen->reverseGC; ! ! XSetForeground(screen->display, currentGC, bg_pix); ! XSetBackground(screen->display, currentGC, fg_pix); ! } else { ! if (fgs & BOLD) ! currentGC = screen->normalboldGC; else /* not bold */ ! currentGC = screen->normalGC; + XSetForeground(screen->display, currentGC, fg_pix); + XSetBackground(screen->display, currentGC, bg_pix); + } + if (fgs & INSERT) InsertChar(screen, len); if (!(AddToRefresh(screen))) { *************** *** 1467,1473 **** ++ntotal; } } ! ScreenWrite(screen, str, flags, len); CursorForward(screen, len); } --- 1561,1567 ---- ++ntotal; } } ! ScreenWrite(screen, str, flags, fg, bg, len); CursorForward(screen, len); } *************** *** 1998,2009 **** register TScreen *screen; { register int rows = screen->max_row + 1; ! char *save [2 * MAX_ROWS]; ! bcopy((char *)screen->buf, (char *)save, 2 * sizeof(char *) * rows); bcopy((char *)screen->altbuf, (char *)screen->buf, ! 2 * sizeof(char *) * rows); ! bcopy((char *)save, (char *)screen->altbuf, 2 * sizeof(char *) * rows); } VTRun() --- 2092,2103 ---- register TScreen *screen; { register int rows = screen->max_row + 1; ! char *save [4 * MAX_ROWS]; ! bcopy((char *)screen->buf, (char *)save, 4 * sizeof(char *) * rows); bcopy((char *)screen->altbuf, (char *)screen->buf, ! 4 * sizeof(char *) * rows); ! bcopy((char *)save, (char *)screen->altbuf, 4 * sizeof(char *) * rows); } VTRun() *************** *** 2137,2143 **** screen->allbuf = Allocate (nrows, screen->max_col + 1, &screen->sbuf_address); if (screen->scrollWidget) ! screen->buf = &screen->allbuf[2 * screen->savelines]; else screen->buf = screen->allbuf; return; --- 2231,2237 ---- screen->allbuf = Allocate (nrows, screen->max_col + 1, &screen->sbuf_address); if (screen->scrollWidget) ! screen->buf = &screen->allbuf[4 * screen->savelines]; else screen->buf = screen->allbuf; return; *************** *** 2204,2209 **** --- 2298,2307 ---- new->screen.menu_font_names[fontMenu_fontsel] = NULL; new->screen.menu_font_number = fontMenu_fontdefault; + for (i = 0; i < MAXCOLORS; i++) { + new->screen.colors[i] = request->screen.colors[i]; + } + /* * The definition of -rv now is that it changes the definition of * XtDefaultForeground and XtDefaultBackground. So, we no longer *************** *** 2241,2247 **** /* make sure that the resize gravity acceptable */ if ( new->misc.resizeGravity != NorthWestGravity && new->misc.resizeGravity != SouthWestGravity) { - extern XtAppContext app_con; Cardinal nparams = 1; XtAppWarningMsg(app_con, "rangeError", "resizeGravity", "XTermError", --- 2339,2344 ---- *************** *** 2505,2511 **** if (screen->cur_row - screen->topline > screen->max_row) return; ! c = screen->buf[y = 2 * (screen->cursor_row = screen->cur_row)] [x = screen->cursor_col = screen->cur_col]; flags = screen->buf[y + 1][x]; if (c == 0) --- 2602,2608 ---- if (screen->cur_row - screen->topline > screen->max_row) return; ! c = screen->buf[y = 4 * (screen->cursor_row = screen->cur_row)] [x = screen->cursor_col = screen->cur_col]; flags = screen->buf[y + 1][x]; if (c == 0) *************** *** 2545,2550 **** --- 2642,2667 ---- } } } + #if 0 + /*RFB*/ + if ( flags & BG_COLOR ) + XSetForeground( screen->display, currentGC, + screen->colors[ term->cur_background ]); + if ( flags & FG_COLOR ) + XSetBackground( screen->display, currentGC, + screen->colors[ term->cur_foreground ]); + /**********************************************************/ + /* */ + /* we test "flags and background" before calling */ + /* XSetForeground; */ + /* */ + /* it looks funny, but we're in reverse video and the */ + /* color we're setting it to is the current background */ + /* color! */ + /* */ + /**********************************************************/ + /*RFB*/ + #endif } else { /* not selected */ if (( (flags & INVERSE) && !in_selection) || (!(flags & INVERSE) && in_selection)) { *************** *** 2553,2559 **** } else { /* normal video */ currentGC = screen->normalGC; } ! } x = CursorX (screen, screen->cur_col); --- 2670,2685 ---- } else { /* normal video */ currentGC = screen->normalGC; } ! #if 0 ! /*RFB*/ ! if ( flags & FG_COLOR ) ! XSetForeground( screen->display, currentGC, ! screen->colors[ term->cur_foreground ]); ! if ( flags & BG_COLOR ) ! XSetBackground( screen->display, currentGC, ! screen->colors[ term->cur_background ]); ! /*RFB*/ ! #endif } x = CursorX (screen, screen->cur_col); *************** *** 2585,2590 **** --- 2711,2717 ---- HideCursor() { register TScreen *screen = &term->screen; + #if 0 GC currentGC; register int x, y, flags; char c; *************** *** 2592,2598 **** if(screen->cursor_row - screen->topline > screen->max_row) return; ! c = screen->buf[y = 2 * screen->cursor_row][x = screen->cursor_col]; flags = screen->buf[y + 1][x]; if (screen->cursor_row > screen->endHRow || --- 2719,2725 ---- if(screen->cursor_row - screen->topline > screen->max_row) return; ! c = screen->buf[y = 4 * screen->cursor_row][x = screen->cursor_col]; flags = screen->buf[y + 1][x]; if (screen->cursor_row > screen->endHRow || *************** *** 2634,2640 **** --- 2761,2770 ---- if(flags & UNDERLINE) XDrawLine(screen->display, TextWindow(screen), currentGC, x, y+1, x + FontWidth(screen), y+1); + #endif screen->cursor_state = OFF; + ScrnRefresh( screen, screen->cursor_row, screen->cursor_col, + 1, 1, 1 ); /*RFB */ } VTReset(full) *************** *** 2681,2687 **** * (screen->max_row + 1) + 2 * screen->border, &junk, &junk); XSync(screen->display, FALSE); /* synchronize */ ! if(QLength(screen->display) > 0) xevents(); } CursorSet(screen, 0, 0, term->flags); --- 2811,2817 ---- * (screen->max_row + 1) + 2 * screen->border, &junk, &junk); XSync(screen->display, FALSE); /* synchronize */ ! if(XtAppPending(app_con)) xevents(); } CursorSet(screen, 0, 0, term->flags); *************** *** 2958,2967 **** --- 3088,3101 ---- fontnum = fontMenu_font5; break; case '6': fontnum = fontMenu_font6; break; + case '7': + fontnum = fontMenu_font7; break; case 'e': case 'E': fontnum = fontMenu_fontescape; maxparams = 3; break; case 's': case 'S': fontnum = fontMenu_fontsel; maxparams = 2; break; + case 'o': case 'O': + fontnum = fontMenu_fontold; break; default: Bell(); return; *************** *** 3085,3099 **** set_menu_font (False); screen->menu_font_number = fontnum; set_menu_font (True); ! if (tmpname) { /* if setting escape or sel */ if (screen->menu_font_names[fontnum]) free (screen->menu_font_names[fontnum]); screen->menu_font_names[fontnum] = tmpname; - if (fontnum == fontMenu_fontescape) { set_sensitivity (term->screen.fontMenu, fontMenuEntries[fontMenu_fontescape].widget, TRUE); } } set_cursor_gcs (screen); update_font_info (screen, doresize); --- 3219,3244 ---- set_menu_font (False); screen->menu_font_number = fontnum; set_menu_font (True); ! if ( fontnum == fontMenu_fontescape ) ! { /* if setting escape */ if (screen->menu_font_names[fontnum]) free (screen->menu_font_names[fontnum]); screen->menu_font_names[fontnum] = tmpname; set_sensitivity (term->screen.fontMenu, fontMenuEntries[fontMenu_fontescape].widget, TRUE); } + if ( fontnum == fontMenu_fontsel ) + { /* setting from selection. */ + if ( screen->menu_font_names[ fontMenu_fontold ]) + free( screen->menu_font_names[ fontMenu_fontold ]); + screen->menu_font_names[ fontMenu_fontold ] = + malloc( strlen( nfontname ) + 1 ); + strcpy( screen->menu_font_names[ fontMenu_fontold ], + nfontname ); + set_sensitivity ( term->screen.fontMenu, + fontMenuEntries[fontMenu_fontold].widget, + TRUE); } set_cursor_gcs (screen); update_font_info (screen, doresize); diff -c -b R5.orig/files.list dist/files.list *** R5.orig/files.list Wed Sep 29 11:03:15 1993 --- dist/files.list Wed Sep 29 11:00:50 1993 *************** *** 0 **** --- 1,37 ---- + 0.README + files.list + Imakefile + MANIFEST + README + TekPrsTbl.c + Tekparse.def + Tekparse.h + Tekproc.c + Tests + VTPrsTbl.c + VTparse.def + VTparse.h + XTerm.ad + button.c + charproc.c + ctlseqs.ms + cursor.c + data.c + data.h + error.h + input.c + main.c + main.h + menu.c + menu.h + misc.c + ptyx.h + resize.c + resize.man + screen.c + scrollbar.c + tabs.c + termcap + terminfo + util.c + xterm.man diff -c -b R5.orig/main.c dist/main.c *** R5.orig/main.c Mon Jun 28 13:38:16 1993 --- dist/main.c Wed Sep 29 11:01:03 1993 *************** *** 1,5 **** #ifndef lint ! static char *rid="$XConsortium: main.c,v 1.200 92/03/11 17:36:12 gildea Exp $"; #endif /* lint */ /* --- 1,5 ---- #ifndef lint ! static char *rid="$XConsortium: main.c,v 1.200 92/03/11 17:36:12 dif Exp $"; #endif /* lint */ /* *************** *** 176,181 **** --- 176,185 ---- #define ttyslot() 1 #endif /* apollo */ + #ifdef sun + #include + #endif + #include #ifdef LASTLOG #include *************** *** 486,491 **** --- 490,497 ---- {"-cr", "*cursorColor", XrmoptionSepArg, (caddr_t) NULL}, {"-cu", "*curses", XrmoptionNoArg, (caddr_t) "on"}, {"+cu", "*curses", XrmoptionNoArg, (caddr_t) "off"}, + {"-dc", "*dynamicColors",XrmoptionNoArg, (caddr_t) "off"}, + {"+dc", "*dynamicColors",XrmoptionNoArg, (caddr_t) "on"}, {"-e", NULL, XrmoptionSkipLine, (caddr_t) NULL}, {"-fb", "*boldFont", XrmoptionSepArg, (caddr_t) NULL}, {"-j", "*jumpScroll", XrmoptionNoArg, (caddr_t) "on"}, *************** *** 604,609 **** --- 610,616 ---- { "-C", "intercept console messages (not supported)" }, #endif { "-Sxxd", "slave mode on \"ttyxx\", file descriptor \"d\"" }, + { "-/+dc", "turn off/on dynamic color selection" }, { NULL, NULL }}; static char *message[] = { *************** *** 2893,2907 **** int fd; { #ifdef FIONREAD ! static long arg; ioctl (fd, FIONREAD, (char *) &arg); return (int) arg; #else struct pollfd pollfds[1]; pollfds[0].fd = fd; pollfds[0].events = POLLIN; return poll (pollfds, 1, 0); #endif } --- 2900,2918 ---- int fd; { #ifdef FIONREAD ! long arg; ioctl (fd, FIONREAD, (char *) &arg); return (int) arg; #else + #ifdef FIORDCK + return (ioctl (fd, FIORDCHK, NULL)); + #else struct pollfd pollfds[1]; pollfds[0].fd = fd; pollfds[0].events = POLLIN; return poll (pollfds, 1, 0); + #endif #endif } diff -c -b R5.orig/menu.c dist/menu.c *** R5.orig/menu.c Fri Jun 25 15:08:56 1993 --- dist/menu.c Wed Sep 29 11:01:04 1993 *************** *** 96,103 **** { "font4", do_vtfont, NULL }, /* 4 */ { "font5", do_vtfont, NULL }, /* 5 */ { "font6", do_vtfont, NULL }, /* 6 */ ! { "fontescape", do_vtfont, NULL }, /* 7 */ ! { "fontsel", do_vtfont, NULL }}; /* 8 */ /* this should match NMENUFONTS in ptyx.h */ MenuEntry tekMenuEntries[] = { --- 96,105 ---- { "font4", do_vtfont, NULL }, /* 4 */ { "font5", do_vtfont, NULL }, /* 5 */ { "font6", do_vtfont, NULL }, /* 6 */ ! { "font7", do_vtfont, NULL }, /* 7 */ ! { "fontescape", do_vtfont, NULL }, /* 8 */ ! { "fontold", do_vtfont, NULL }, /* 9 */ ! { "fontsel", do_vtfont, NULL }}; /* 10 */ /* this should match NMENUFONTS in ptyx.h */ MenuEntry tekMenuEntries[] = { *************** *** 200,205 **** --- 202,211 ---- set_sensitivity (screen->fontMenu, fontMenuEntries[fontMenu_fontescape].widget, (screen->menu_font_names[fontMenu_fontescape] + ? TRUE : FALSE)); + set_sensitivity (screen->fontMenu, + fontMenuEntries[fontMenu_fontold].widget, + (screen->menu_font_names[fontMenu_fontold] ? TRUE : FALSE)); } FindFontSelection (NULL, True); diff -c -b R5.orig/menu.h dist/menu.h *** R5.orig/menu.h Fri Jun 25 15:08:40 1993 --- dist/menu.h Wed Sep 29 11:01:09 1993 *************** *** 115,123 **** #define fontMenu_font4 4 #define fontMenu_font5 5 #define fontMenu_font6 6 ! #define fontMenu_lastBuiltin fontMenu_font6 ! #define fontMenu_fontescape 7 ! #define fontMenu_fontsel 8 /* number of non-line items should match NMENUFONTS in ptyx.h */ --- 115,125 ---- #define fontMenu_font4 4 #define fontMenu_font5 5 #define fontMenu_font6 6 ! #define fontMenu_font7 7 ! #define fontMenu_lastBuiltin fontMenu_font7 ! #define fontMenu_fontescape 8 ! #define fontMenu_fontold 9 ! #define fontMenu_fontsel 10 /* number of non-line items should match NMENUFONTS in ptyx.h */ diff -c -b R5.orig/misc.c dist/misc.c *** R5.orig/misc.c Fri Jun 25 15:08:49 1993 --- dist/misc.c Wed Sep 29 11:01:11 1993 *************** *** 1,5 **** /* ! * $XConsortium: misc.c,v 1.92 92/03/13 17:02:08 gildea Exp $ */ /* --- 1,5 ---- /* ! * $XConsortium: misc.c,v 1.92 92/03/13 17:02:08 diff Exp $ */ /* *************** *** 63,83 **** static void DoSpecialEnterNotify(); static void DoSpecialLeaveNotify(); xevents() { XEvent event; register TScreen *screen = &term->screen; - extern XtAppContext app_con; if(screen->scroll_amt) FlushScroll(screen); ! if (!XPending (screen->display)) ! /* protect against events/errors being swallowed by us or Xlib */ return; do { if (waitingForTrackInfo) return; ! XNextEvent (screen->display, &event); /* * Hack to get around problems with the toolkit throwing away * eventing during the exclusive grab of the menu popup. By --- 63,95 ---- static void DoSpecialEnterNotify(); static void DoSpecialLeaveNotify(); + extern XtAppContext app_con; + xevents() { XEvent event; + XtInputMask input_mask; register TScreen *screen = &term->screen; if(screen->scroll_amt) FlushScroll(screen); ! /* ! * process timeouts, relying on the fact that XtAppProcessEvent ! * will process the timeout and return without blockng on the ! * XEvent queue. Other sources i.e. the pty are handled elsewhere ! * with select(). ! */ ! while ((input_mask = XtAppPending(app_con)) & XtIMTimer) ! XtAppProcessEvent(app_con, XtIMTimer); ! /* ! * If there's no XEvents, don't wait around... ! */ ! if ((input_mask & XtIMXEvent) != XtIMXEvent) return; do { if (waitingForTrackInfo) return; ! XtAppNextEvent (app_con, &event); /* * Hack to get around problems with the toolkit throwing away * eventing during the exclusive grab of the menu popup. By *************** *** 103,109 **** (event.xany.type != ButtonPress) && (event.xany.type != ButtonRelease))) XtDispatchEvent(&event); ! } while (QLength(screen->display) > 0); } --- 115,121 ---- (event.xany.type != ButtonPress) && (event.xany.type != ButtonRelease))) XtDispatchEvent(&event); ! } while ((input_mask = XtAppPending(app_con)) & XtIMXEvent); } *************** *** 321,327 **** the bell again? */ if(screen->bellSuppressTime) { if(screen->bellInProgress) { ! if (QLength(screen->display) > 0 || GetBytesAvailable (ConnectionNumber(screen->display)) > 0) xevents(); if(screen->bellInProgress) { /* even after new events? */ --- 333,339 ---- the bell again? */ if(screen->bellSuppressTime) { if(screen->bellInProgress) { ! if (XtAppPending(app_con) || GetBytesAvailable (ConnectionNumber(screen->display)) > 0) xevents(); if(screen->bellInProgress) { /* even after new events? */ *************** *** 626,631 **** --- 638,654 ---- Changetitle(buf); break; + case 10: case 11: case 12: + case 13: case 14: case 15: + case 16: + { + extern Boolean ChangeColorsRequest(); + if (term->misc.dynamicColors) + ChangeColorsRequest(term,mode-10,buf); + } + break; + + case 46: /* new log file */ #ifdef ALLOWLOGFILECHANGES /* *************** *** 677,682 **** --- 700,884 ---- { ChangeGroup( XtNtitle, (XtArgVal)name ); } + + /***====================================================================***/ + + ScrnColors *pOldColors= NULL; + + Boolean + GetOldColors(pTerm) + XtermWidget pTerm; + { + int i; + if (pOldColors==NULL) { + pOldColors= (ScrnColors *)XtMalloc(sizeof(ScrnColors)); + if (pOldColors==NULL) { + fprintf(stderr,"allocation failure in GetOldColors\n"); + return(FALSE); + } + pOldColors->which= 0; + for (i=0;icolors[i]= 0; + pOldColors->names[i]= NULL; + } + GetColors(pTerm,pOldColors); + } + return(TRUE); + } + + Boolean + UpdateOldColors(pTerm,pNew) + XtermWidget pTerm; + ScrnColors *pNew; + { + int i; + + /* if we were going to free old colors, this would be the place to + * do it. I've decided not to (for now), because it seems likely + * that we'd have a small set of colors we use over and over, and that + * we could save some overhead this way. The only case in which this + * (clearly) fails is if someone is trying a boatload of colors, in + * which case they can restart xterm + */ + for (i=0;inames[i]!=NULL) { + XtFree(pOldColors->names[i]); + pOldColors->names[i]= NULL; + } + if (pNew->names[i]) { + pOldColors->names[i]= pNew->names[i]; + } + pOldColors->colors[i]= pNew->colors[i]; + } + } + return(TRUE); + } + + void + ReverseOldColors() + { + register ScrnColors *pOld= pOldColors; + Pixel tmpPix; + char *tmpName; + + if (pOld) { + /* change text cursor, if necesary */ + if (pOld->colors[TEXT_CURSOR]==pOld->colors[TEXT_FG]) { + pOld->colors[TEXT_CURSOR]= pOld->colors[TEXT_BG]; + if (pOld->names[TEXT_CURSOR]) { + XtFree(pOldColors->names[TEXT_CURSOR]); + pOld->names[TEXT_CURSOR]= NULL; + } + if (pOld->names[TEXT_BG]) { + tmpName= XtMalloc(strlen(pOld->names[TEXT_BG])+1); + if (tmpName) { + strcpy(tmpName,pOld->names[TEXT_BG]); + pOld->names[TEXT_CURSOR]= tmpName; + } + } + } + + /* swap text FG and BG */ + tmpPix= pOld->colors[TEXT_FG]; + tmpName= pOld->names[TEXT_FG]; + pOld->colors[TEXT_FG]= pOld->colors[TEXT_BG]; + pOld->names[TEXT_FG]= pOld->names[TEXT_BG]; + pOld->colors[TEXT_BG]= tmpPix; + pOld->names[TEXT_BG]= tmpName; + + /* swap mouse FG and BG */ + tmpPix= pOld->colors[MOUSE_FG]; + tmpName= pOld->names[MOUSE_FG]; + pOld->colors[MOUSE_FG]= pOld->colors[MOUSE_BG]; + pOld->names[MOUSE_FG]= pOld->names[MOUSE_BG]; + pOld->colors[MOUSE_BG]= tmpPix; + pOld->names[MOUSE_BG]= tmpName; + + /* swap Tek FG and BG */ + tmpPix= pOld->colors[TEK_FG]; + tmpName= pOld->names[TEK_FG]; + pOld->colors[TEK_FG]= pOld->colors[TEK_BG]; + pOld->names[TEK_FG]= pOld->names[TEK_BG]; + pOld->colors[TEK_BG]= tmpPix; + pOld->names[TEK_BG]= tmpName; + } + return; + } + + Boolean + AllocateColor(pTerm,pNew,ndx,name) + XtermWidget pTerm; + ScrnColors *pNew; + int ndx; + char *name; + { + XColor def; + register TScreen *screen= &pTerm->screen; + Colormap cmap= pTerm->core.colormap; + char *newName; + + if ((XParseColor(screen->display,cmap,name,&def))&& + (XAllocColor(screen->display,cmap,&def))) { + SET_COLOR_VALUE(pNew,ndx,def.pixel); + newName= XtMalloc(strlen(name)+1); + if (newName) { + strcpy(newName,name); + SET_COLOR_NAME(pNew,ndx,newName); + } + return(TRUE); + } + return(FALSE); + } + + Boolean + ChangeColorsRequest(pTerm,start,names) + XtermWidget pTerm; + int start; + register char *names; + { + char *thisName; + ScrnColors newColors; + int i,ndx; + + if ((pOldColors==NULL)&&(!GetOldColors(pTerm))) { + return(FALSE); + } + newColors.which= 0; + for (i=0;imisc.re_verse) ndx= OPPOSITE_COLOR(i); + else ndx= i; + if ((names==NULL)||(names[0]=='\0')) { + newColors.names[ndx]= NULL; + } + else { + if (names[0]==';') + thisName= NULL; + else thisName= names; + names= index(names,';'); + if (names!=NULL) { + *names= '\0'; + names++; + } + if ((!pOldColors->names[ndx])|| + (thisName&&(strcmp(thisName,pOldColors->names[ndx])))) { + AllocateColor(pTerm,&newColors,ndx,thisName); + } + } + } + + if (newColors.which==0) + return(TRUE); + + ChangeColors(pTerm,&newColors); + UpdateOldColors(pTerm,&newColors); + return(TRUE); + } + + /***====================================================================***/ #ifndef DEBUG /* ARGSUSED */ diff -c -b R5.orig/ptyx.h dist/ptyx.h *** R5.orig/ptyx.h Fri Jun 25 15:08:47 1993 --- dist/ptyx.h Wed Sep 29 11:01:11 1993 *************** *** 132,138 **** #define APC 0x9F #define RDEL 0xFF ! #define NMENUFONTS 9 /* entries in fontMenu */ #define NBOX 5 /* Number of Points in box */ #define NPARAM 10 /* Max. parameters */ --- 132,138 ---- #define APC 0x9F #define RDEL 0xFF ! #define NMENUFONTS 11 /* entries in fontMenu */ #define NBOX 5 /* Number of Points in box */ #define NPARAM 10 /* Max. parameters */ *************** *** 188,197 **** --- 188,245 ---- int height; } BitmapBits; + + #define SAVELINES 64 /* default # lines to save */ #define SCROLLLINES 1 /* default # lines to scroll */ + /***====================================================================***/ + + #define TEXT_FG 0 + #define TEXT_BG 1 + #define TEXT_CURSOR 2 + #define MOUSE_FG 3 + #define MOUSE_BG 4 + #define TEK_FG 5 + #define TEK_BG 6 + #define NCOLORS 7 + + #define COLOR_DEFINED(s,w) ((s)->which&(1<<(w))) + #define COLOR_VALUE(s,w) ((s)->colors[w]) + #define SET_COLOR_VALUE(s,w,v) (((s)->colors[w]=(v)),((s)->which|=(1<<(w)))) + + #define COLOR_NAME(s,w) ((s)->names[w]) + #define SET_COLOR_NAME(s,w,v) (((s)->names[w]=(v)),((s)->which|=(1<<(w)))) + + #define UNDEFINE_COLOR(s,w) ((s)->which&=(~((w)<<1))) + #define OPPOSITE_COLOR(n) (((n)==TEXT_FG?TEXT_BG:\ + ((n)==TEXT_BG?TEXT_FG:\ + ((n)==MOUSE_FG?MOUSE_BG:\ + ((n)==MOUSE_BG?MOUSE_FG:\ + ((n)==TEK_FG?TEK_BG:\ + ((n)==TEXT_BG?TEK_FG:(n)))))))) + typedef struct { + unsigned which; + Pixel colors[NCOLORS]; + char *names[NCOLORS]; + } ScrnColors; + + /***====================================================================***/ + + #define MAXCOLORS 8 + #define COLOR_0 0 + #define COLOR_1 1 + #define COLOR_2 2 + #define COLOR_3 3 + #define COLOR_4 4 + #define COLOR_5 5 + #define COLOR_6 6 + #define COLOR_7 7 + + + + typedef struct { /* These parameters apply to both windows */ Display *display; /* X display for screen */ int respond; /* socket for responses *************** *** 210,215 **** --- 258,264 ---- Pixel cursorcolor; /* Cursor color */ Pixel mousecolor; /* Mouse color */ Pixel mousecolorback; /* Mouse color background */ + Pixel colors[MAXCOLORS]; /* ANSI color emulation */ int border; /* inner border */ Cursor arrow; /* arrow cursor */ unsigned short send_mouse_pos; /* user wants mouse transition */ *************** *** 394,399 **** --- 443,449 ---- Boolean tekSmall; /* start tek window in small size */ Boolean appcursorDefault; Boolean appkeypadDefault; + Boolean dynamicColors; } Misc; typedef struct {int foo;} XtermClassPart, TekClassPart; *************** *** 425,430 **** --- 475,482 ---- TKeyboard keyboard; /* terminal keyboard */ TScreen screen; /* terminal screen */ unsigned flags; /* mode flags */ + unsigned cur_foreground; /* current foreground color */ + unsigned cur_background; /* current background color */ unsigned initflags; /* initial mode flags */ Tabs tabs; /* tabstops of the terminal */ Misc misc; /* miscellaneous parameters */ *************** *** 446,452 **** * term->flags and screen->save_modes. This need only fit in an unsigned. */ ! #define ATTRIBUTES 0x07 /* mask: user-visible attributes */ /* global flags and character flags (visible character attributes) */ #define INVERSE 0x01 /* invert the characters to be output */ #define UNDERLINE 0x02 /* true if underlining */ --- 498,504 ---- * term->flags and screen->save_modes. This need only fit in an unsigned. */ ! #define ATTRIBUTES 0x67 /* mask: user-visible attributes */ /* global flags and character flags (visible character attributes) */ #define INVERSE 0x01 /* invert the characters to be output */ #define UNDERLINE 0x02 /* true if underlining */ *************** *** 464,469 **** --- 516,524 ---- screen. Used to distinguish blanks from empty parts of the screen when selecting */ /* global flags */ + #define BG_COLOR 0x20 /* true if background set */ + #define FG_COLOR 0x40 /* true if foreground set */ + #define WRAPAROUND 0x400 /* true if auto wraparound mode */ #define REVERSEWRAP 0x800 /* true if reverse wraparound mode */ #define REVERSE_VIDEO 0x1000 /* true if screen white on black */ diff -c -b R5.orig/screen.c dist/screen.c *** R5.orig/screen.c Fri Jun 25 15:08:50 1993 --- dist/screen.c Wed Sep 29 11:01:12 1993 *************** *** 54,59 **** --- 54,62 ---- thereto each line is formed from a pair of char arrays. The first (even) one is the actual character array and the second (odd) one is the attributes. + > each line is formed from four char arrays. The first one is the actual + > character array, the second one is the attributes, the third is the + > foreground color, and the fourth is the background color. */ register int nrow, ncol; Char **addr; *************** *** 62,68 **** register Char *tmp; register int i; ! if ((base = (ScrnBuf) calloc ((unsigned)(nrow *= 2), sizeof (char *))) == 0) SysError (ERROR_SCALLOC); if ((tmp = calloc ((unsigned) (nrow * ncol), sizeof(char))) == 0) --- 65,71 ---- register Char *tmp; register int i; ! if ((base = (ScrnBuf) calloc ((unsigned)(nrow *= 4), sizeof (char *))) == 0) SysError (ERROR_SCALLOC); if ((tmp = calloc ((unsigned) (nrow * ncol), sizeof(char))) == 0) *************** *** 95,101 **** if (sbuf == NULL || *sbuf == NULL) return 0; ! oldrow *= 2; oldbuf = *sbufaddr; /* --- 98,104 ---- if (sbuf == NULL || *sbuf == NULL) return 0; ! oldrow *= 4; oldbuf = *sbufaddr; /* *************** *** 110,120 **** * If the screen shrinks, remove lines off the top of the buffer * if resizeGravity resource says to do so. */ ! nrow *= 2; if (nrow < oldrow && term->misc.resizeGravity == SouthWestGravity) { /* Remove lines off the top of the buffer if necessary. */ move_up = oldrow-nrow ! - 2*(term->screen.max_row - term->screen.cur_row); if (move_up < 0) move_up = 0; /* Overlapping bcopy here! */ --- 113,123 ---- * If the screen shrinks, remove lines off the top of the buffer * if resizeGravity resource says to do so. */ ! nrow *= 4; if (nrow < oldrow && term->misc.resizeGravity == SouthWestGravity) { /* Remove lines off the top of the buffer if necessary. */ move_up = oldrow-nrow ! - 4*(term->screen.max_row - term->screen.cur_row); if (move_up < 0) move_up = 0; /* Overlapping bcopy here! */ *************** *** 138,144 **** mincols = (oldcol < ncol) ? oldcol : ncol; if (nrow > oldrow && term->misc.resizeGravity == SouthWestGravity) { /* move data down to bottom of expanded screen */ ! move_down = Min(nrow-oldrow, 2*term->screen.savedlines); tmp += ncol*move_down; } for (i = 0; i < minrows; i++, tmp += ncol) { --- 141,147 ---- mincols = (oldcol < ncol) ? oldcol : ncol; if (nrow > oldrow && term->misc.resizeGravity == SouthWestGravity) { /* move data down to bottom of expanded screen */ ! move_down = Min(nrow-oldrow, 4*term->screen.savedlines); tmp += ncol*move_down; } for (i = 0; i < minrows; i++, tmp += ncol) { *************** *** 153,162 **** /* Now free the old buffer */ free(oldbuf); ! return move_down ? move_down/2 : -move_up/2; /* convert to rows */ } ! ScreenWrite (screen, str, flags, length) /* Writes str into buf at row row and column col. Characters are set to match flags. --- 156,165 ---- /* Now free the old buffer */ free(oldbuf); ! return move_down ? move_down/4 : -move_up/4; /* convert to rows */ } ! ScreenWrite (screen, str, flags, cur_fg, cur_bg, length) /* Writes str into buf at row row and column col. Characters are set to match flags. *************** *** 164,172 **** TScreen *screen; char *str; register unsigned flags; register int length; /* length of string */ { ! register Char *attrs; register int avail = screen->max_col - screen->cur_col + 1; register Char *col; --- 167,176 ---- TScreen *screen; char *str; register unsigned flags; + register unsigned cur_fg, cur_bg; register int length; /* length of string */ { ! register Char *attrs, *fgs, *bgs; register int avail = screen->max_col - screen->cur_col + 1; register Char *col; *************** *** 175,187 **** if (length <= 0) return; ! col = screen->buf[avail = 2 * screen->cur_row] + screen->cur_col; attrs = screen->buf[avail + 1] + screen->cur_col; flags &= ATTRIBUTES; flags |= CHARDRAWN; bcopy(str, col, length); while(length-- > 0) ! *attrs++ = flags; } ScrnInsertLine (sb, last, where, n, size) --- 179,197 ---- if (length <= 0) return; ! col = screen->buf[avail = 4 * screen->cur_row] + screen->cur_col; attrs = screen->buf[avail + 1] + screen->cur_col; + fgs = screen->buf[avail + 2] + screen->cur_col; + bgs = screen->buf[avail + 3] + screen->cur_col; + flags &= ATTRIBUTES; flags |= CHARDRAWN; bcopy(str, col, length); while(length-- > 0) ! { *attrs++ = flags; ! *fgs++ = cur_fg; ! *bgs++ = cur_bg; ! } } ScrnInsertLine (sb, last, where, n, size) *************** *** 196,210 **** register int where, n, size; { register int i; ! char *save [2 * MAX_ROWS]; /* save n lines at bottom */ ! bcopy ((char *) &sb [2 * (last -= n - 1)], (char *) save, ! 2 * sizeof (char *) * n); /* clear contents of old rows */ ! for (i = 2 * n - 1; i >= 0; i--) bzero ((char *) save [i], size); /* --- 206,220 ---- register int where, n, size; { register int i; ! char *save [4 * MAX_ROWS]; /* save n lines at bottom */ ! bcopy ((char *) &sb [4 * (last -= n - 1)], (char *) save, ! 4 * sizeof (char *) * n); /* clear contents of old rows */ ! for (i = 4 * n - 1; i >= 0; i--) bzero ((char *) save [i], size); /* *************** *** 216,226 **** * * +--------|---------|----+ */ ! bcopy ((char *) &sb [2 * where], (char *) &sb [2 * (where + n)], ! 2 * sizeof (char *) * (last - where)); /* reuse storage for new lines at where */ ! bcopy ((char *)save, (char *) &sb[2 * where], 2 * sizeof(char *) * n); } --- 226,236 ---- * * +--------|---------|----+ */ ! bcopy ((char *) &sb [4 * where], (char *) &sb [4 * (where + n)], ! 4 * sizeof (char *) * (last - where)); /* reuse storage for new lines at where */ ! bcopy ((char *)save, (char *) &sb[4 * where], 4 * sizeof(char *) * n); } *************** *** 236,257 **** int where; { register int i; ! char *save [2 * MAX_ROWS]; /* save n lines at where */ ! bcopy ((char *) &sb[2 * where], (char *)save, 2 * sizeof(char *) * n); /* clear contents of old rows */ ! for (i = 2 * n - 1 ; i >= 0 ; i--) bzero ((char *) save [i], size); /* move up lines */ ! bcopy ((char *) &sb[2 * (where + n)], (char *) &sb[2 * where], ! 2 * sizeof (char *) * ((last -= n - 1) - where)); /* reuse storage for new bottom lines */ ! bcopy ((char *)save, (char *) &sb[2 * last], ! 2 * sizeof(char *) * n); } --- 246,267 ---- int where; { register int i; ! char *save [4 * MAX_ROWS]; /* save n lines at where */ ! bcopy ((char *) &sb[4 * where], (char *)save, 4 * sizeof(char *) * n); /* clear contents of old rows */ ! for (i = 4 * n - 1 ; i >= 0 ; i--) bzero ((char *) save [i], size); /* move up lines */ ! bcopy ((char *) &sb[4 * (where + n)], (char *) &sb[4 * where], ! 4 * sizeof (char *) * ((last -= n - 1) - where)); /* reuse storage for new bottom lines */ ! bcopy ((char *)save, (char *) &sb[4 * last], ! 4 * sizeof(char *) * n); } *************** *** 264,271 **** register int col, n; { register int i, j; ! register Char *ptr = sb [2 * row]; ! register Char *attrs = sb [2 * row + 1]; int wrappedbit = attrs[0]&LINEWRAPPED; attrs[0] &= ~LINEWRAPPED; /* make sure the bit isn't moved */ --- 274,281 ---- register int col, n; { register int i, j; ! register Char *ptr = sb [4 * row]; ! register Char *attrs = sb [4 * row + 1]; int wrappedbit = attrs[0]&LINEWRAPPED; attrs[0] &= ~LINEWRAPPED; /* make sure the bit isn't moved */ *************** *** 292,299 **** register int row, size; register int n, col; { ! register Char *ptr = sb[2 * row]; ! register Char *attrs = sb[2 * row + 1]; register nbytes = (size - n - col); int wrappedbit = attrs[0]&LINEWRAPPED; --- 302,309 ---- register int row, size; register int n, col; { ! register Char *ptr = sb[4 * row]; ! register Char *attrs = sb[4 * row + 1]; register nbytes = (size - n - col); int wrappedbit = attrs[0]&LINEWRAPPED; *************** *** 332,343 **** --- 342,356 ---- for (row = toprow; row <= maxrow; y += FontHeight(screen), row++) { register Char *chars; register Char *attrs; + register Char *fgs, *bgs; register int col = leftcol; int maxcol = leftcol + ncols - 1; int lastind; int flags; + int fg, bg; int x, n; GC gc; + Pixel fg_pix, bg_pix; Boolean hilite; if (row < screen->top_marg || row > screen->bot_marg) *************** *** 348,355 **** if (lastind < 0 || lastind > max) continue; ! chars = screen->buf [2 * (lastind + topline)]; ! attrs = screen->buf [2 * (lastind + topline) + 1]; if (row < screen->startHRow || row > screen->endHRow || (row == screen->startHRow && maxcol < screen->startHCol) || --- 361,370 ---- if (lastind < 0 || lastind > max) continue; ! chars = screen->buf [4 * (lastind + topline)]; ! attrs = screen->buf [4 * (lastind + topline) + 1]; ! fgs = screen->buf [4 * (lastind + topline) + 2]; ! bgs = screen->buf [4 * (lastind + topline) + 3]; if (row < screen->startHRow || row > screen->endHRow || (row == screen->startHRow && maxcol < screen->startHCol) || *************** *** 386,405 **** if (col > maxcol) continue; flags = attrs[col]; if ( (!hilite && (flags & INVERSE) != 0) || ! (hilite && (flags & INVERSE) == 0) ) if (flags & BOLD) gc = screen->reverseboldGC; else gc = screen->reverseGC; ! else if (flags & BOLD) gc = screen->normalboldGC; else gc = screen->normalGC; x = CursorX(screen, col); lastind = col; for (; col <= maxcol; col++) { ! if (attrs[col] != flags) { XDrawImageString(screen->display, TextWindow(screen), gc, x, y, (char *) &chars[lastind], n = col - lastind); if((flags & BOLD) && screen->enbolden) --- 401,439 ---- if (col > maxcol) continue; flags = attrs[col]; + fg = fgs[col]; + bg = bgs[col]; + fg_pix = (flags & FG_COLOR) ? screen->colors[fg] + : screen->foreground; + bg_pix = (flags & BG_COLOR) ? screen->colors[bg] + : term->core.background_pixel; + if ( (!hilite && (flags & INVERSE) != 0) || ! (hilite && (flags & INVERSE) == 0) ) { if (flags & BOLD) gc = screen->reverseboldGC; else gc = screen->reverseGC; ! ! XSetForeground(screen->display, gc, bg_pix); ! XSetBackground(screen->display, gc, fg_pix); ! ! } else { if (flags & BOLD) gc = screen->normalboldGC; else gc = screen->normalGC; + XSetForeground(screen->display, gc, fg_pix); + XSetBackground(screen->display, gc, bg_pix); + } + + x = CursorX(screen, col); lastind = col; for (; col <= maxcol; col++) { ! if (attrs[col] != flags || ! (flags & FG_COLOR && fgs[col] != fg) || ! (flags & BG_COLOR && bgs[col] != bg)) { ! XDrawImageString(screen->display, TextWindow(screen), gc, x, y, (char *) &chars[lastind], n = col - lastind); if((flags & BOLD) && screen->enbolden) *************** *** 414,428 **** lastind = col; flags = attrs[col]; ! if ((!hilite && (flags & INVERSE) != 0) || ! (hilite && (flags & INVERSE) == 0) ) if (flags & BOLD) gc = screen->reverseboldGC; else gc = screen->reverseGC; ! else if (flags & BOLD) gc = screen->normalboldGC; else gc = screen->normalGC; } if(chars[col] == 0) chars[col] = ' '; --- 448,478 ---- lastind = col; flags = attrs[col]; + fg = fgs[col]; + bg = bgs[col]; ! fg_pix = (flags & FG_COLOR) ? screen->colors[fg] ! : screen->foreground; ! bg_pix = (flags & BG_COLOR) ? screen->colors[bg] ! : term->core.background_pixel; ! ! if ( (!hilite && (flags & INVERSE) != 0) || ! (hilite && (flags & INVERSE) == 0) ) { if (flags & BOLD) gc = screen->reverseboldGC; else gc = screen->reverseGC; ! ! XSetForeground(screen->display, gc, bg_pix); ! XSetBackground(screen->display, gc, fg_pix); ! ! } else { if (flags & BOLD) gc = screen->normalboldGC; else gc = screen->normalGC; + + XSetForeground(screen->display, gc, fg_pix); + XSetBackground(screen->display, gc, bg_pix); + } + } if(chars[col] == 0) chars[col] = ' '; *************** *** 430,441 **** if ( (!hilite && (flags & INVERSE) != 0) || ! (hilite && (flags & INVERSE) == 0) ) if (flags & BOLD) gc = screen->reverseboldGC; else gc = screen->reverseGC; ! else if (flags & BOLD) gc = screen->normalboldGC; else gc = screen->normalGC; XDrawImageString(screen->display, TextWindow(screen), gc, x, y, (char *) &chars[lastind], n = col - lastind); if((flags & BOLD) && screen->enbolden) --- 480,501 ---- if ( (!hilite && (flags & INVERSE) != 0) || ! (hilite && (flags & INVERSE) == 0) ) { if (flags & BOLD) gc = screen->reverseboldGC; else gc = screen->reverseGC; ! ! XSetForeground(screen->display, gc, bg_pix); ! XSetBackground(screen->display, gc, fg_pix); ! ! } else { if (flags & BOLD) gc = screen->normalboldGC; else gc = screen->normalGC; + + XSetForeground(screen->display, gc, fg_pix); + XSetBackground(screen->display, gc, bg_pix); + + } + XDrawImageString(screen->display, TextWindow(screen), gc, x, y, (char *) &chars[lastind], n = col - lastind); if((flags & BOLD) && screen->enbolden) *************** *** 455,462 **** register TScreen *screen; register int first, last; { ! first *= 2; ! last = 2 * last + 1; while (first <= last) bzero (screen->buf [first++], (screen->max_col + 1)); } --- 515,522 ---- register TScreen *screen; register int first, last; { ! first *= 4; ! last = 4 * last + 3; while (first <= last) bzero (screen->buf [first++], (screen->max_col + 1)); } *************** *** 536,542 **** rows + savelines, cols, screen->max_row + 1 + savelines, screen->max_col + 1); ! screen->buf = &screen->allbuf[2 * savelines]; screen->max_row += delta_rows; screen->max_col = cols - 1; --- 596,602 ---- rows + savelines, cols, screen->max_row + 1 + savelines, screen->max_col + 1); ! screen->buf = &screen->allbuf[4 * savelines]; screen->max_row += delta_rows; screen->max_col = cols - 1; *************** *** 635,641 **** length = avail; if (length <= 0) return; ! attrs = screen->buf[2 * row + 1] + col; value &= mask; /* make sure we only change the bits allowed by mask*/ while(length-- > 0) { *attrs &= ~mask; /* clear the bits */ --- 695,701 ---- length = avail; if (length <= 0) return; ! attrs = screen->buf[4 * row + 1] + col; value &= mask; /* make sure we only change the bits allowed by mask*/ while(length-- > 0) { *attrs &= ~mask; /* clear the bits */ *************** *** 666,672 **** if (length <= 0) return 0; ret = length; ! attrs = screen->buf[2 * row + 1] + col; while(length-- > 0) { *str++ = *attrs++; } --- 726,732 ---- if (length <= 0) return 0; ret = length; ! attrs = screen->buf[4 * row + 1] + col; while(length-- > 0) { *str++ = *attrs++; } *************** *** 678,684 **** register int row, col, len; { register int i; ! register Char *ptr = sb [2 * row]; for (i = col; i < len; i++) { if (ptr[i]) --- 738,744 ---- register int row, col, len; { register int i; ! register Char *ptr = sb [4 * row]; for (i = col; i < len; i++) { if (ptr[i]) diff -c -b R5.orig/scrollbar.c dist/scrollbar.c *** R5.orig/scrollbar.c Fri Jun 25 15:08:43 1993 --- dist/scrollbar.c Wed Sep 29 11:01:13 1993 *************** *** 336,350 **** if (doalloc && screen->allbuf) { if((screen->allbuf = (ScrnBuf) realloc((char *) screen->buf, ! (unsigned) 2*(screen->max_row + 2 + screen->savelines) * sizeof(char *))) == NULL) Error (ERROR_SBRALLOC); ! screen->buf = &screen->allbuf[2 * screen->savelines]; bcopy ((char *)screen->allbuf, (char *)screen->buf, ! 2 * (screen->max_row + 2) * sizeof (char *)); ! for(i = 2 * screen->savelines - 1 ; i >= 0 ; i--) if((screen->allbuf[i] = calloc((unsigned) screen->max_col + 1, sizeof(char))) == NULL) --- 336,350 ---- if (doalloc && screen->allbuf) { if((screen->allbuf = (ScrnBuf) realloc((char *) screen->buf, ! (unsigned) 4*(screen->max_row + 2 + screen->savelines) * sizeof(char *))) == NULL) Error (ERROR_SBRALLOC); ! screen->buf = &screen->allbuf[4 * screen->savelines]; bcopy ((char *)screen->allbuf, (char *)screen->buf, ! 4 * (screen->max_row + 2) * sizeof (char *)); ! for(i = 4 * screen->savelines - 1 ; i >= 0 ; i--) if((screen->allbuf[i] = calloc((unsigned) screen->max_col + 1, sizeof(char))) == NULL) Only in R5.orig: tektests diff -c -b R5.orig/util.c dist/util.c *** R5.orig/util.c Fri Jun 25 15:08:58 1993 --- dist/util.c Wed Sep 29 11:01:14 1993 *************** *** 616,627 **** FontHeight(screen)); } } ! bzero(screen->buf [2 * screen->cur_row] + screen->cur_col, (screen->max_col - screen->cur_col + 1)); ! bzero(screen->buf [2 * screen->cur_row + 1] + screen->cur_col, (screen->max_col - screen->cur_col + 1)); /* with the right part cleared, we can't be wrapping */ ! screen->buf [2 * screen->cur_row + 1] [0] &= ~LINEWRAPPED; } /* --- 616,631 ---- FontHeight(screen)); } } ! bzero(screen->buf [4 * screen->cur_row] + screen->cur_col, (screen->max_col - screen->cur_col + 1)); ! bzero(screen->buf [4 * screen->cur_row + 1] + screen->cur_col, (screen->max_col - screen->cur_col + 1)); + bzero(screen->buf [4 * screen->cur_row + 2] + screen->cur_col, + (screen->max_col - screen->cur_col + 1)); + bzero(screen->buf [4 * screen->cur_row + 3] + screen->cur_col, + (screen->max_col - screen->cur_col + 1)); /* with the right part cleared, we can't be wrapping */ ! screen->buf [4 * screen->cur_row + 1] [0] &= ~LINEWRAPPED; } /* *************** *** 649,662 **** } } ! for ( i=0, cp=screen->buf[2 * screen->cur_row]; i < screen->cur_col + 1; i++, cp++) *cp = ' '; ! for ( i=0, cp=screen->buf[2 * screen->cur_row + 1]; i < screen->cur_col + 1; i++, cp++) *cp = CHARDRAWN; } /* --- 653,669 ---- } } ! for ( i=0, cp=screen->buf[4 * screen->cur_row]; i < screen->cur_col + 1; i++, cp++) *cp = ' '; ! for ( i=0, cp=screen->buf[4 * screen->cur_row + 1]; i < screen->cur_col + 1; i++, cp++) *cp = CHARDRAWN; + bzero (screen->buf [4 * screen->cur_row + 2], (screen->cur_col + 1)); + bzero (screen->buf [4 * screen->cur_row + 3], (screen->cur_col + 1)); + } /* *************** *** 679,686 **** Width(screen), FontHeight(screen)); } } ! bzero (screen->buf [2 * screen->cur_row], (screen->max_col + 1)); ! bzero (screen->buf [2 * screen->cur_row + 1], (screen->max_col + 1)); } ClearScreen(screen) --- 686,695 ---- Width(screen), FontHeight(screen)); } } ! bzero (screen->buf [4 * screen->cur_row], (screen->max_col + 1)); ! bzero (screen->buf [4 * screen->cur_row + 1], (screen->max_col + 1)); ! bzero (screen->buf [4 * screen->cur_row + 2], (screen->max_col + 1)); ! bzero (screen->buf [4 * screen->cur_row + 3], (screen->max_col + 1)); } ClearScreen(screen) *************** *** 921,926 **** --- 930,1037 ---- return (0); } + /***====================================================================***/ + + void + GetColors(term,pColors) + XtermWidget term; + ScrnColors *pColors; + { + register TScreen *screen = &term->screen; + GC tmpGC; + Window tek = TWindow(screen); + unsigned long tmp; + + + pColors->which= 0; + SET_COLOR_VALUE(pColors,TEXT_FG, screen->foreground); + SET_COLOR_VALUE(pColors,TEXT_BG, term->core.background_pixel); + SET_COLOR_VALUE(pColors,TEXT_CURSOR, screen->cursorcolor); + SET_COLOR_VALUE(pColors,MOUSE_FG, screen->mousecolor); + SET_COLOR_VALUE(pColors,MOUSE_BG, screen->mousecolorback); + + + SET_COLOR_VALUE(pColors,TEK_FG, screen->Tforeground); + SET_COLOR_VALUE(pColors,TEK_BG, screen->Tbackground); + } + + + ChangeColors(term,pNew) + XtermWidget term; + ScrnColors *pNew; + { + register TScreen *screen = &term->screen; + GC tmpGC; + Window tek = TWindow(screen); + unsigned long tmp; + Bool newCursor= TRUE; + + + if (COLOR_DEFINED(pNew,TEXT_BG)) { + term->core.background_pixel= COLOR_VALUE(pNew,TEXT_BG); + } + + if (COLOR_DEFINED(pNew,TEXT_CURSOR)) { + screen->cursorcolor= COLOR_VALUE(pNew,TEXT_CURSOR); + } + else if ((screen->cursorcolor == screen->foreground)&& + (COLOR_DEFINED(pNew,TEXT_FG))) { + screen->cursorcolor= COLOR_VALUE(pNew,TEXT_FG); + } + else newCursor= FALSE; + + if (COLOR_DEFINED(pNew,TEXT_FG)) { + Pixel fg= COLOR_VALUE(pNew,TEXT_FG); + screen->foreground= fg; + XSetForeground(screen->display,screen->normalGC,fg); + XSetBackground(screen->display,screen->reverseGC,fg); + XSetForeground(screen->display,screen->normalboldGC,fg); + XSetBackground(screen->display,screen->reverseboldGC,fg); + } + + if (COLOR_DEFINED(pNew,TEXT_BG)) { + Pixel bg= COLOR_VALUE(pNew,TEXT_BG); + term->core.background_pixel= bg; + XSetBackground(screen->display,screen->normalGC,bg); + XSetForeground(screen->display,screen->reverseGC,bg); + XSetBackground(screen->display,screen->normalboldGC,bg); + XSetForeground(screen->display,screen->reverseboldGC,bg); + XSetWindowBackground(screen->display, TextWindow(screen), + term->core.background_pixel); + } + + if (COLOR_DEFINED(pNew,MOUSE_FG)||(COLOR_DEFINED(pNew,MOUSE_BG))) { + if (COLOR_DEFINED(pNew,MOUSE_FG)) + screen->mousecolor= COLOR_VALUE(pNew,MOUSE_FG); + if (COLOR_DEFINED(pNew,MOUSE_BG)) + screen->mousecolorback= COLOR_VALUE(pNew,MOUSE_BG); + + recolor_cursor (screen->pointer_cursor, + screen->mousecolor, screen->mousecolorback); + recolor_cursor (screen->arrow, + screen->mousecolor, screen->mousecolorback); + XDefineCursor(screen->display, TextWindow(screen), + screen->pointer_cursor); + if(tek) + XDefineCursor(screen->display, tek, screen->arrow); + } + + if ((tek)&&(COLOR_DEFINED(pNew,TEK_FG)||COLOR_DEFINED(pNew,TEK_BG))) { + ChangeTekColors(screen,pNew); + } + set_cursor_gcs(screen); + XClearWindow(screen->display, TextWindow(screen)); + ScrnRefresh (screen, 0, 0, screen->max_row + 1, + screen->max_col + 1, False); + if(screen->Tshow) { + XClearWindow(screen->display, tek); + TekExpose((XExposeEvent *) NULL); + } + } + + /***====================================================================***/ + + ReverseVideo (termw) XtermWidget termw; { *************** *** 973,978 **** --- 1084,1090 ---- XClearWindow(screen->display, tek); TekExpose((Widget)NULL, (XEvent *)NULL, (Region)NULL); } + ReverseOldColors(); update_reversevideo(); }