| 1 |
<!-- |
| 2 |
***************************************************************************** |
| 3 |
* Copyright 1997-2025,2026 by Thomas E. Dickey * |
| 4 |
* All Rights Reserved. * |
| 5 |
* * |
| 6 |
* Permission to use, copy, modify, and distribute this software and its * |
| 7 |
* documentation for any purpose and without fee is hereby granted, provided * |
| 8 |
* that the above copyright notice appear in all copies and that both that * |
| 9 |
* copyright notice and this permission notice appear in supporting * |
| 10 |
* documentation, and that the name of the above listed copyright holder(s) * |
| 11 |
* not be used in advertising or publicity pertaining to distribution of the * |
| 12 |
* software without specific, written prior permission. * |
| 13 |
* * |
| 14 |
* THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD * |
| 15 |
* TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * |
| 16 |
* FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE * |
| 17 |
* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * |
| 18 |
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * |
| 19 |
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * |
| 20 |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * |
| 21 |
***************************************************************************** |
| 22 |
--> |
| 23 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> |
| 24 |
<html> |
| 25 |
<head> |
| 26 |
<meta name="generator" content= |
| 27 |
"HTML Tidy for HTML5 for Linux version 5.8.0"> |
| 28 |
<title>XTerm – Frequently Asked Questions (FAQ)</title> |
| 29 |
<link rel="author" href="mailto:[email protected]"> |
| 30 |
<meta http-equiv="Content-Type" content= |
| 31 |
"text/html; charset=us-ascii"> |
| 32 |
<meta name="keywords" content= |
| 33 |
"xterm, terminal, vt220, vt420, 256-colors, UTF-8"> |
| 34 |
<meta name="description" content= |
| 35 |
"xterm is the standard terminal emulator for the X Window System. This page gives some background and pointers to xterm resources."> |
| 36 |
<link rel="SHORTCUT ICON" href="/img/icons/xterm.ico" type= |
| 37 |
"image/x-icon"> |
| 38 |
<link rel="stylesheet" href="/css/simplestyle.css" type= |
| 39 |
"text/css"> |
| 40 |
<link rel="stylesheet" href="/css/inline-code.css" type= |
| 41 |
"text/css"> |
| 42 |
<link rel="stylesheet" href="/css/xterm-icons.css" type= |
| 43 |
"text/css"> |
| 44 |
<style type="text/css"> |
| 45 |
@import "/css/simplenavXX.css" all; |
| 46 |
</style> |
| 47 |
<meta name="viewport" content= |
| 48 |
"width=device-width, initial-scale=1"> |
| 49 |
</head> |
| 50 |
<body> |
| 51 |
<hr> |
| 52 |
|
| 53 |
<p><a href="/">https://invisible-island.net/</a><a href= |
| 54 |
"./">xterm/</a><br> |
| 55 |
Copyright © 1997-2025,2026 by Thomas E. Dickey</p> |
| 56 |
|
| 57 |
<hr> |
| 58 |
|
| 59 |
<p><a href= |
| 60 |
"https://invisible-island.net/xterm/xterm.faq.html">Here</a> is |
| 61 |
the latest version of this file.</p> |
| 62 |
|
| 63 |
<h1 class="no-header">XTerm – Frequently Asked Questions |
| 64 |
(FAQ)</h1> |
| 65 |
|
| 66 |
<div class="nav"> |
| 67 |
<ul> |
| 68 |
<li class="nav-top"><a href="/xterm/xterm.faq.html">(top)</a></li> |
| 69 |
|
| 70 |
<li><a href="#what_is_it">What is <strong>XTerm</strong>?</a></li> |
| 71 |
|
| 72 |
<li><a href="#who_did_it">Who wrote |
| 73 |
<strong>XTerm</strong>?</a></li> |
| 74 |
|
| 75 |
<li><a href="#what_is_vt220">What is a VT220?</a></li> |
| 76 |
|
| 77 |
<li><a href="#what_platforms">What platforms does it run |
| 78 |
on?</a></li> |
| 79 |
|
| 80 |
<li><a href="#latest_version">What is the latest version?</a></li> |
| 81 |
|
| 82 |
<li><a href="#other_versions">What versions are |
| 83 |
available?</a></li> |
| 84 |
|
| 85 |
<li><a href="#not_an_xterm">What are some programs that are |
| 86 |
not X terminals?</a></li> |
| 87 |
|
| 88 |
<li><a href="#compare_versions">Comparing versions, by |
| 89 |
counting controls</a></li> |
| 90 |
|
| 91 |
<li><a href="#how_do_i">How do I ...</a></li> |
| 92 |
|
| 93 |
<li><a href="#frequent_problems">Frequent problems</a></li> |
| 94 |
|
| 95 |
<li><a href="#known_bugs">Known Bugs in |
| 96 |
<strong>XTerm</strong> and Look–alikes</a></li> |
| 97 |
|
| 98 |
<li><a href="#building_it">How do I build |
| 99 |
<strong>XTerm</strong>?</a></li> |
| 100 |
|
| 101 |
<li><a href="#report_bugs">How do I report bugs?</a></li> |
| 102 |
|
| 103 |
<li><a href="#more_info">Additional Information</a></li> |
| 104 |
|
| 105 |
<li><a href="#future_work">Ongoing/future work</a></li> |
| 106 |
</ul> |
| 107 |
</div> |
| 108 |
|
| 109 |
<h2 id="what_is_it-id"><a name="what_is_it" id="what_is_it">What |
| 110 |
is <strong>XTerm</strong>?</a></h2> |
| 111 |
|
| 112 |
<p>From the manual page:</p> |
| 113 |
|
| 114 |
<blockquote class="code-block"> |
| 115 |
<p>The xterm program is a terminal emulator for the X Window |
| 116 |
System. It provides DEC VT102/VT220 and selected features from |
| 117 |
higher-level terminals such as VT320/VT420/VT520 (VTxxx). It |
| 118 |
also provides Tektronix 4014 emulation for programs that cannot |
| 119 |
use the window system directly. If the underlying operating |
| 120 |
system supports terminal resizing capabilities (for example, |
| 121 |
the SIGWINCH signal in systems derived from 4.3bsd), xterm will |
| 122 |
use the facilities to notify programs running in the window |
| 123 |
whenever it is resized.</p> |
| 124 |
</blockquote> |
| 125 |
|
| 126 |
<p>That is, xterm (pronounced "<em>eks</em>-term") is a |
| 127 |
<em>specific</em> program, not a generic item. It is the standard |
| 128 |
X terminal emulator program.</p> |
| 129 |
|
| 130 |
<p>This FAQ presents various useful bits of information for both |
| 131 |
the specific program as well as other programs that imitate |
| 132 |
it.</p> |
| 133 |
|
| 134 |
<p>As a stylistic convention, the capitalized form is |
| 135 |
<em>“XTerm”</em>, which corresponds to the X resource |
| 136 |
class name. Similarly, <em>uxterm</em> becomes |
| 137 |
<em>“UXTerm”</em>.</p> |
| 138 |
|
| 139 |
<h2 id="who_did_it-id"><a name="who_did_it" id="who_did_it">Who |
| 140 |
wrote <strong>XTerm</strong>?</a></h2> |
| 141 |
|
| 142 |
<p>I've been working on xterm since early 1996 (see my <a href= |
| 143 |
"xterm.log.html">changelog</a> for details).</p> |
| 144 |
|
| 145 |
<p>But the program is much older than that:</p> |
| 146 |
|
| 147 |
<ul> |
| 148 |
<li> |
| 149 |
<p><a href="#prehistory">A Prehistory Perspective</a></p> |
| 150 |
</li> |
| 151 |
|
| 152 |
<li> |
| 153 |
<p><a href="#some_digging">Looking for more perspective</a></p> |
| 154 |
</li> |
| 155 |
|
| 156 |
<li> |
| 157 |
<p><a href="#my_history">My involvement</a></p> |
| 158 |
</li> |
| 159 |
|
| 160 |
<li> |
| 161 |
<p><a href="#forward_history">Focus of this FAQ</a></p> |
| 162 |
</li> |
| 163 |
</ul> |
| 164 |
|
| 165 |
<h3 id="pre_history-id"><a href="#who_did_it" name="prehistory" |
| 166 |
id="prehistory">A Prehistory Perspective</a></h3> |
| 167 |
|
| 168 |
<p>A lot of people, cited at the bottom of the manual page wrote |
| 169 |
the original xterm program, maintained by the X Consortium (later |
| 170 |
part of The Open Group – I'm well aware of the distinction, |
| 171 |
but am citing when the work was done, not who the current owner |
| 172 |
may be). There is no changelog, and it is not clear who did what. |
| 173 |
Email from Jim Gettys (September 1998) provides some |
| 174 |
background:</p> |
| 175 |
|
| 176 |
<blockquote class="code-block"> |
| 177 |
<p>Cast of thousands...</p> |
| 178 |
|
| 179 |
<p>To give a bit of history, xterm predates X!</p> |
| 180 |
|
| 181 |
<p>It was originally written as a stand-alone terminal emulator |
| 182 |
for the VS100 by Mark Vandevoorde, as my coop student the |
| 183 |
summer that X started.</p> |
| 184 |
|
| 185 |
<p>Part way through the summer, it became clear that X was more |
| 186 |
useful than trying to do a stand alone program, so I had him |
| 187 |
retarget it to X. Part of why xterm's internals are so |
| 188 |
horrifying is that it was originally intended that a single |
| 189 |
process be able to drive multiple VS100 displays. Don't hold |
| 190 |
this against Mark; it isn't his fault.</p> |
| 191 |
|
| 192 |
<p>I then did a lot of hacking on it, and merged several |
| 193 |
improved versions from others back in.</p> |
| 194 |
|
| 195 |
<p>Notable improvements include the proper ANSI parser, that |
| 196 |
Bob McNamara did.</p> |
| 197 |
|
| 198 |
<p>The Tek 4010 support came from a guy at Smithsonian |
| 199 |
Astrophysical Observatory whose name slips my mind at the |
| 200 |
moment.</p> |
| 201 |
|
| 202 |
<p>Ported to X11 by Loretta Guarino.</p> |
| 203 |
|
| 204 |
<p>Then hacked on at the X Consortium by uncounted people.</p> |
| 205 |
</blockquote> |
| 206 |
|
| 207 |
<p>Email from Doug Mink (October 1999) provides more |
| 208 |
background:</p> |
| 209 |
|
| 210 |
<blockquote class="code-block"> |
| 211 |
<p>I was checking out the newly revised AltaVista search engine |
| 212 |
to see what was on the net about xterm, and I found your pages. |
| 213 |
I can add to the FAQ in that I was the "guy at the Smithsonian |
| 214 |
Astrophysical Observatory" Jim Gettys refers to. I am listed at |
| 215 |
the end of the man page under authors. What happened was that I |
| 216 |
was hired by SAO (after leaving the research staff at MIT) in |
| 217 |
October 1985 to write analysis software for the Spacelab 2 |
| 218 |
Infrared Telescope which was to fly on the Space Shuttle in |
| 219 |
1985 less than six months after I was hired. I came with a tar |
| 220 |
tape full of software I had written for Unix and Tektronix |
| 221 |
terminals, but I was presented with a VS100 terminal which had |
| 222 |
an early version (X6 or so) of xterm, with no graphics |
| 223 |
capabilities. SAO is at Harvard, across Cambridge from MIT, |
| 224 |
where Jim Gettys was detailed from DEC to the X project, and |
| 225 |
Jim had connections with SAO, having worked here after college |
| 226 |
(MIT, where we had both worked at the observatory at various |
| 227 |
times); he was still sharing an apartment with an SAO colleague |
| 228 |
of mine, too. Anyway, everyone decided that since I knew |
| 229 |
Tektronix commands pretty well, and our group desparately |
| 230 |
needed the graphics capabilities, it would be a good use of my |
| 231 |
time to implement a Tektronix terminal emulator under X. So I |
| 232 |
set to work learning more C--I had only written a couple of |
| 233 |
wrappers to C I/O routines so I could use them with my Fortran |
| 234 |
software--and wrote a Tektronix emulator. The only X |
| 235 |
documentation at the time was the code itself. While I was at |
| 236 |
it, I wrote an improved Tektronix emulator for our Imagen laser |
| 237 |
printer which used the full resolution of that 300 dpi printer |
| 238 |
instead of the effective 100 dpi (i.e. jaggy) emultator |
| 239 |
distributed with the printer. The original xterm Tek emulator |
| 240 |
shared a window with the VT100 emulator, much like on the VT240 |
| 241 |
terminals which I had been using at MIT before I came to |
| 242 |
Harvard. With a VAX 750 running several VS100's, window |
| 243 |
creation was sloowww, so sharing a window was the quickest way |
| 244 |
to do things, and all of my software was written for that mode |
| 245 |
of operation, anyway. While I wrote the emulator so that my |
| 246 |
software would work on it, it was tested by the X group against |
| 247 |
a BBN graphics package, the name of which slips my mind right |
| 248 |
now.</p> |
| 249 |
|
| 250 |
<p>Anyway, 15 years later, I am still using xterm and some of |
| 251 |
the same mapping software I wrote the emulator for. And I am |
| 252 |
still at the Smithsonian Astrophysical Observatory.</p> |
| 253 |
</blockquote> |
| 254 |
|
| 255 |
<h3><a href="#who_did_it" name="some_digging" id= |
| 256 |
"some_digging">Looking for more perspective</a></h3> |
| 257 |
|
| 258 |
<p>VS100 refers to the VAXstation 100, introduced by DEC in 1984 |
| 259 |
(see <a href= |
| 260 |
"https://www.bitsavers.org/pdf/dec/vax/vaxstation100/AA-N660A-TE_VAXstation_100_Users_Guide_Jun84.pdf"> |
| 261 |
manual</a>).</p> |
| 262 |
|
| 263 |
<p>There is a git repository <a href= |
| 264 |
"https://cgit.freedesktop.org/~alanc/xc-historical/log/xc/programs/xterm/"> |
| 265 |
here</a> which gives some more of xterm's prehistory. But it has |
| 266 |
no usable data for X10 (see initial revisions in <a href= |
| 267 |
"https://cgit.freedesktop.org/~alanc/xc-historical/log/?ofs=25700"> |
| 268 |
1985/1986</a>). The X developers did not really start checking in |
| 269 |
their code until 1987.</p> |
| 270 |
|
| 271 |
<p>The earliest version of xterm which is available is from |
| 272 |
X10R3. According to the xc-historical repository, that was |
| 273 |
<a href= |
| 274 |
"https://cgit.freedesktop.org/~alanc/xc-historical/commit/?id=49c79082577b5ef39c456c03a047e07d8c702e9f"> |
| 275 |
February 1, 1986</a> (a change to the <tt>rgb.c</tt> file). Even |
| 276 |
that date is suspect because the X10R3 tarball contains xterm |
| 277 |
files later than that date:</p> |
| 278 |
|
| 279 |
<blockquote> |
| 280 |
<pre class="code-block"> |
| 281 |
17024 May 17 1986 xterm/util.c |
| 282 |
31545 May 17 1986 xterm/main.c |
| 283 |
1377 Feb 10 1986 xterm/Makefile |
| 284 |
10804 Feb 3 1986 man/xterm.1 |
| 285 |
660 Feb 2 1986 xterm/terminfo |
| 286 |
606 Feb 2 1986 xterm/termcap |
| 287 |
1178 Feb 2 1986 xterm/tabs.c |
| 288 |
10525 Feb 2 1986 xterm/screen.c |
| 289 |
2907 Feb 2 1986 xterm/resize.c |
| 290 |
6699 Feb 2 1986 xterm/ptyx.h |
| 291 |
2720 Feb 2 1986 xterm/input.c |
| 292 |
2959 Feb 2 1986 xterm/esctable.h |
| 293 |
4482 Feb 2 1986 xterm/cursor.c |
| 294 |
7661 Feb 2 1986 xterm/chartable.h |
| 295 |
23543 Feb 2 1986 xterm/charproc.c |
| 296 |
13990 Feb 2 1986 xterm/button.c |
| 297 |
1122 Feb 2 1986 xterm/buf.c |
| 298 |
3932 Feb 2 1986 xterm/ansi.c |
| 299 |
15662 Feb 2 1986 xterm/Tplot.c |
| 300 |
2382 Feb 2 1986 xterm/README |
| 301 |
234 Feb 2 1986 cursors/xterm_mask.cursor |
| 302 |
234 Feb 2 1986 include/X/cursors/xterm_mask.cursor |
| 303 |
261 Feb 2 1986 cursors/xterm.cursor |
| 304 |
261 Feb 2 1986 include/X/cursors/xterm.cursor |
| 305 |
1335 Dec 21 1985 xterm/icon.ic |
| 306 |
1350 Dec 21 1985 xterm/icon_mask.ic |
| 307 |
</pre> |
| 308 |
</blockquote> |
| 309 |
|
| 310 |
<p>But since the X10R3 tarball contains only 10 |
| 311 |
“later” files out of 974, the 3-4 xterm files are |
| 312 |
just some after-the-fact correction whose reason is long |
| 313 |
lost.</p> |
| 314 |
|
| 315 |
<p>A posting by Andreas Motl to <a href= |
| 316 |
"https://web.archive.org/web/20151102155441/http://www.netfrag.org/webnews/article.php?id=1064&group=nfo.links.computing"> |
| 317 |
<em>nfo.links.computing</em></a> in March 2003 recapitulates the |
| 318 |
content of a page <a href= |
| 319 |
"https://web.archive.org/web/20030618125926/http://www.robotwisdom.com/linux/desktops.html"> |
| 320 |
<em>Linux desktops (GUIs, widgets, window managers, etc)</em></a> |
| 321 |
(Jorn Barger, November 2002). That mentions X10 (e.g., “X |
| 322 |
v10”):</p> |
| 323 |
|
| 324 |
<blockquote> |
| 325 |
<pre class="code-block"> |
| 326 |
1985: Sep: X v9 distributed as free [cite] cf Andrew [Gettys] |
| 327 |
1985: X/Open Portability Guide [cite] |
| 328 |
1985: Oct: Amiga 1.0 [info] |
| 329 |
1985: 20Nov: Windows 1.0 ships [tour] |
| 330 |
1985: Dec: Clayton Elwell's Portable User Interface Library project [GooJa] |
| 331 |
|
| 332 |
1985: Dec: X v10r2 [annc] |
| 333 |
|
| 334 |
"X is a portable network transparent window system for bitmap displays. |
| 335 |
Applications can be run from any machine in a local area network via stream |
| 336 |
connections (currently TCP and Unix domain are supported). X is a fully |
| 337 |
hierarchic window system intended to be very flexible. Manipulation of existing |
| 338 |
windows is done with an external window manager; if you don't like ours, write |
| 339 |
your own. Applications include a terminal emulator (~VT102 and Tek 4010), load |
| 340 |
monitor, clock, imagen previewer, and several window managers among other |
| 341 |
things." |
| 342 |
|
| 343 |
no-date: Windows 2.0 clones Mac interface; withdrawn and tweaked to avoid |
| 344 |
lawsuit? [cite] |
| 345 |
|
| 346 |
1986: Jan: DEC announces VAXstation with X |
| 347 |
1986: Feb: X v10r3 [annc] |
| 348 |
</pre> |
| 349 |
</blockquote> |
| 350 |
|
| 351 |
<p>September 1985 might be accurate for X version 9. However, the |
| 352 |
first line of the xterm manual page from X10R3 says</p> |
| 353 |
|
| 354 |
<blockquote> |
| 355 |
<pre class="code-block"> |
| 356 |
.TH XTERM 1 "1 January 1985" "X Version 10" |
| 357 |
</pre> |
| 358 |
</blockquote> |
| 359 |
|
| 360 |
<p>Jim Gettys might be able to explain that. Several of the files |
| 361 |
in that version of xterm have copyright dates from 1984, making |
| 362 |
that the likely beginning of development for xterm. Other parts |
| 363 |
of the X10R3 source tree have similar clues. For example, Xlib |
| 364 |
may have begun development in 1984, but since it was unreleased |
| 365 |
until the end of 1985, the actual date is indeterminate.</p> |
| 366 |
|
| 367 |
<p>A comment by Jim Fulton on <a href= |
| 368 |
"https://tech.slashdot.org/comments.pl?sid=7262&cid=830314">slashdot |
| 369 |
in 2000</a> gives more details on the early versions of X:</p> |
| 370 |
|
| 371 |
<blockquote> |
| 372 |
<p class="code-block">There weren't really ten full releases |
| 373 |
prior to X11R1, however there were 10 incompatible revs of the |
| 374 |
protocol. Most of the early versions were primarily used within |
| 375 |
MIT (Athena and LCS) and friendly commercial R&D labs. |
| 376 |
Here's some of the pre-history based on cryptic notes and |
| 377 |
blurry memory: X1 - summer 1984 - the first version, based on a |
| 378 |
substantial rearchitecting of the UNIX port of the W Window |
| 379 |
System (originally developed for the V Kernel). X3 - fall 1984 |
| 380 |
- used internally at MIT as the initial basis of various |
| 381 |
plotting packages for coursework. X6 - spring 1985 - first |
| 382 |
version licensed by MIT to various companies (including |
| 383 |
Cognition, MASSCOMP, and Digital) for use in commercial |
| 384 |
products. It cost $100 and if you wanted you could stop off at |
| 385 |
the (very small) licensing office to pick up your own magtape. |
| 386 |
X8/X9 - fall 1985 - added color (X8 lasted all of about a week; |
| 387 |
X9 was quickly released to fix a protocol alignment problem |
| 388 |
that impacted ports on the IBM PC/RT). Many organizations began |
| 389 |
developing ports (including a version to the Lexidata 9000 |
| 390 |
display card for VAXen that was used at the Autofact tradeshow |
| 391 |
in late 1985 to show a prototype of the first 3rd party |
| 392 |
application: a mechanical engineering design system). X.V10R1 - |
| 393 |
spring 1986 - first version released by MIT that did not |
| 394 |
require signing a license agreement. Also the first version to |
| 395 |
have a DOS Xserver developed. X.V10R[234] - fall 1986 & |
| 396 |
spring 1987 - an explosion of ports done on a variety of |
| 397 |
platforms. X.V11R1 - Sep 15, 1987 - major overall done in |
| 398 |
collaboration with folks from Digital, Sun, IBM, and other |
| 399 |
companies. Formed the basis of core protocol used today. |
| 400 |
Companies and organizations releasing X-based products used |
| 401 |
this release as a starting port for incorporating into their |
| 402 |
own distributions. X.V11R2 - March 1, 1988 - first version |
| 403 |
released under the auspices of the newly-formed MIT X |
| 404 |
Consortium. The MIT X Consortium continued to put out releases |
| 405 |
of X11 for a number of years. Then in the mid-90s, it was spun |
| 406 |
off into a separate not-for-profit organization (simple the X |
| 407 |
Consortium). As has been noted, that eventually folded into |
| 408 |
various organizations that became X.ORG. The rest is history. |
| 409 |
:) Jim Fulton</p> |
| 410 |
</blockquote> |
| 411 |
|
| 412 |
<h3 id="my_history-id"><a href="#who_did_it" name="my_history" |
| 413 |
id="my_history">My Involvement</a></h3> |
| 414 |
|
| 415 |
<p>My involvement with <strong>xterm</strong> through XFree86 |
| 416 |
began at the <a href="/xterm/xterm.html#history">end of 1995</a>. |
| 417 |
This website has been “here” since 2001/6/5, |
| 418 |
replacing my ClarkNet page. I started the ClarkNet page |
| 419 |
1996/12/31, as a followup to the <a href= |
| 420 |
"/ncurses/ncurses-license.html#patch_961224">release of ncurses |
| 421 |
4.0</a>) which featured xterm as one of the 16 programs I was |
| 422 |
involved with. From the outset, the page provided a link to a |
| 423 |
snapshot of the current source. Copies of patches which I sent to |
| 424 |
XFree86 were available on the ftp area.</p> |
| 425 |
|
| 426 |
<p>XFree86 had its sources in CVS, but (like others in that era), |
| 427 |
were not directly visible to random developers. That came later. |
| 428 |
I started by downloading the sources (30Mb of compressed |
| 429 |
tar-files on a 56Kb phone connection took about 6 hours) and |
| 430 |
updating them with patches from the XFree86 mailing list.</p> |
| 431 |
|
| 432 |
<p>Like the other programs that I worked on with others (<a href= |
| 433 |
"/vile/vile.html">vile</a>, <a href="/tin/tin.html">tin</a>, |
| 434 |
<a href="/lynx/lynx.html">lynx</a>), I set up an RCS archive to |
| 435 |
track my changes locally before sending patches to the |
| 436 |
development list. As the XFree86 developers issued new patches, I |
| 437 |
would re-synchronize my archive. Later, XFree86 provided CVS |
| 438 |
(initially readonly). I was granted commit privileges on this |
| 439 |
<a href="/ansification/ansify-xfs-cve.html#xfree86_work">in |
| 440 |
November 2000</a>, and stopped mailing patches after <a href= |
| 441 |
"xterm.log.html#xterm_149">#149</a>.</p> |
| 442 |
|
| 443 |
<p>Throughout this period, my work on <strong>xterm</strong> was |
| 444 |
released as part of XFree86. It was rare for a separate package |
| 445 |
to be provided. That was due to the potential conflict between |
| 446 |
the install procedures. Users of the downloads from my web/ftp |
| 447 |
site were predominantly individual developers.</p> |
| 448 |
|
| 449 |
<p>There were exceptions. Christian Weisgerber proposed a package |
| 450 |
for FreeBSD ports later in 1999 (<a href= |
| 451 |
"https://web.archive.org/web/20130801223050/http://www.mavetju.org/mail/view_message.php?list=freebsd-ports&id=578273">ports/15545: |
| 452 |
new port: x11/xterm</a>, followup in <a href= |
| 453 |
"https://marc.info/?t=102422536300028&r=l&=2">March |
| 454 |
2000</a>). However, that was an exception. None of the Linux |
| 455 |
distributions provided a separate package before 2003 (when Mike |
| 456 |
Harris created a package of <a href= |
| 457 |
"xterm.log.html#xterm_177">patch #177</a> for Red Hat). Again |
| 458 |
that is more of an exception than a rule:</p> |
| 459 |
|
| 460 |
<ul> |
| 461 |
<li> |
| 462 |
<p>SuSE's package began October 23, 2004 with <a href= |
| 463 |
"xterm.log.html#xterm_196">patch #196</a>.</p> |
| 464 |
</li> |
| 465 |
|
| 466 |
<li> |
| 467 |
<p>Mandriva's package began October 22, 2005 with <a href= |
| 468 |
"xterm.log.html#xterm_205">patch #205</a>.</p> |
| 469 |
</li> |
| 470 |
|
| 471 |
<li> |
| 472 |
<p>The Debian package for xterm began in January 6, 2006 with |
| 473 |
<a href="/xterm/xterm.log.html#xterm_204">patch #204</a>.</p> |
| 474 |
</li> |
| 475 |
</ul> |
| 476 |
|
| 477 |
<p>Given that context (sources distributed via XFree86 CVS, |
| 478 |
releases via XFree86), the statement made by an Xorg hacker |
| 479 |
<a href= |
| 480 |
"https://lists.freedesktop.org/archives/xorg/2005-January/005847.html"> |
| 481 |
early in 2005</a> asserting that “It has not been |
| 482 |
maintained by anyone within the XFree86 or X.org trees for many |
| 483 |
years” was at best misleading.</p> |
| 484 |
|
| 485 |
<p>After the “<a href= |
| 486 |
"xterm.faq.html#xterm-xorg">fork</a>” (sic) of Xorg in |
| 487 |
2004, I continued to commit changes for xterm in <a href= |
| 488 |
"https://cvsweb.xfree86.org/cvsweb/xc/programs/xterm/">XFree86 |
| 489 |
CVS</a> until <a href="/xterm/xterm.log.html#xterm_216">patch |
| 490 |
#216</a> in mid-2006. I stopped at that point because it was not |
| 491 |
possible to incorporate changes into xterm which were not sent to |
| 492 |
me first. I still send patch announcements to both the XFree86 |
| 493 |
and Xorg mailing lists, of course.</p> |
| 494 |
|
| 495 |
<p>At that point (mid-2006), the XFree86 CVS was no longer the |
| 496 |
primary development repository for xterm. My RCS archive filled |
| 497 |
that need. Later (starting in 2016), I provided <a href= |
| 498 |
"/personal/git-exports.html">Git snapshots</a> using the RCS |
| 499 |
labels which I make in development:</p> |
| 500 |
|
| 501 |
<ul> |
| 502 |
<li> |
| 503 |
<p><a href="/xterm/old-xterm-patches/">Old xterm patches</a>, |
| 504 |
from patch #1 through patch #149.</p> |
| 505 |
</li> |
| 506 |
|
| 507 |
<li> |
| 508 |
<p><a href= |
| 509 |
"https://github.com/ThomasDickey/xterm-snapshots">Git |
| 510 |
snapshots</a>, starting from xterm patch #41</p> |
| 511 |
</li> |
| 512 |
</ul> |
| 513 |
|
| 514 |
<h3 id="forward_history-id"><a href="#who_did_it" name= |
| 515 |
"forward_history" id="forward_history">Focus of this FAQ</a></h3> |
| 516 |
|
| 517 |
<p>This FAQ is oriented toward the version of xterm originally |
| 518 |
distributed with XFree86 (more commonly known as modern, or "new |
| 519 |
xterm", with a corresponding terminal description "xterm-new"), |
| 520 |
which was based on the X11R6.3 xterm, with the addition of ANSI |
| 521 |
color and VT220 controls.</p> |
| 522 |
|
| 523 |
<h2 id="what_is_vt220-id"><a name="what_is_vt220" id= |
| 524 |
"what_is_vt220">What is a VT220?</a></h2> |
| 525 |
|
| 526 |
<ul> |
| 527 |
<li> |
| 528 |
<p><a href="#what_vt220">Why a VT220?</a></p> |
| 529 |
</li> |
| 530 |
|
| 531 |
<li> |
| 532 |
<p><a href="#whatis_state_table">What is a State Table?</a></p> |
| 533 |
</li> |
| 534 |
|
| 535 |
<li> |
| 536 |
<p><a href="#why_not_vt320">Why not emulate VT320?</a></p> |
| 537 |
</li> |
| 538 |
|
| 539 |
<li> |
| 540 |
<p><a href="#why_vt420">Why emulate VT420?</a></p> |
| 541 |
</li> |
| 542 |
|
| 543 |
<li> |
| 544 |
<p><a href="#why_not_vt520">Why not emulate VT520?</a></p> |
| 545 |
</li> |
| 546 |
</ul> |
| 547 |
|
| 548 |
<h3 id="why_vt220-id"><a name="what_vt220" id="what_vt220">Why a |
| 549 |
VT220?</a></h3> |
| 550 |
|
| 551 |
<p>The manual page mentions a VT220. Most terminal emulators |
| 552 |
documentation talk about VT100. But a VT100 is a rather limited |
| 553 |
subset of what people expect:</p> |
| 554 |
|
| 555 |
<ul> |
| 556 |
<li> |
| 557 |
<p>VT100s have no function keys. Arguably, PF1-PF4 are |
| 558 |
function keys. My keyboard has 12 function keys.</p> |
| 559 |
</li> |
| 560 |
|
| 561 |
<li> |
| 562 |
<p>VT100s do not do <a href= |
| 563 |
"/ncurses/ncurses.faq.html#vt100_color">color</a>.</p> |
| 564 |
</li> |
| 565 |
</ul> |
| 566 |
|
| 567 |
<p>Initially, I was only interested in making colors workable for |
| 568 |
curses programs.</p> |
| 569 |
|
| 570 |
<p>Later, I noticed that xterm had some support for what would |
| 571 |
now be termed as ISO-2022. That was a VT220 feature which |
| 572 |
preceded ISO-2022 called <em>National Replacement Character</em> |
| 573 |
sets. In any case, it was not a VT100 feature. There were some |
| 574 |
missing pieces. So I decided to fill in those pieces and make |
| 575 |
xterm a VT220 emulator. (VT220s do not do ANSI color |
| 576 |
either—the missing pieces were in other areas).</p> |
| 577 |
|
| 578 |
<p><strong>XTerm</strong> also provides features that are in |
| 579 |
neither VT100 nor VT220, which are used by other programs as |
| 580 |
"xterm emulation".</p> |
| 581 |
|
| 582 |
<ul> |
| 583 |
<li> |
| 584 |
<p>set (and retrieve) window- and icon-labels using escape |
| 585 |
sequences.</p> |
| 586 |
</li> |
| 587 |
|
| 588 |
<li> |
| 589 |
<p>interpret mouse clicks as escape sequences that can be |
| 590 |
read by a program.</p> |
| 591 |
</li> |
| 592 |
</ul> |
| 593 |
|
| 594 |
<p>By the way, the control string used for setting the titles was |
| 595 |
not in a standard format:</p> |
| 596 |
|
| 597 |
<ul> |
| 598 |
<li> |
| 599 |
<p>In X10 (1988), the string was simply terminated by any |
| 600 |
nonprinting character.</p> |
| 601 |
</li> |
| 602 |
|
| 603 |
<li> |
| 604 |
<p>X11R4 (1989) modified that to ensure that the nonprinting |
| 605 |
character is an ASCII BEL (control/G).</p> |
| 606 |
</li> |
| 607 |
|
| 608 |
<li> |
| 609 |
<p>There is no explanation in the (sketchy) notes distributed |
| 610 |
with the X11R4 xterm; in retrospect it seems that the most |
| 611 |
likely explanation for the choice is that it was simpler to |
| 612 |
implement in shell scripts than <code>ESC \</code>.</p> |
| 613 |
</li> |
| 614 |
</ul> |
| 615 |
|
| 616 |
<p>ECMA-48 (the standard) does not describe this particular |
| 617 |
control, but prescribes its format (an <a href= |
| 618 |
"ctlseqs/ctlseqs.html#h2-Operating-System-Commands">operating |
| 619 |
system command</a>). It does not use a |
| 620 |
<strong><code>BEL</code></strong>.</p> |
| 621 |
|
| 622 |
<p>I revised that area <a href= |
| 623 |
"/xterm/xterm.log.html#xterm_24">starting in 1996</a>,</p> |
| 624 |
|
| 625 |
<ul> |
| 626 |
<li> |
| 627 |
<p>first to use xterm's state table for handling the input, |
| 628 |
and then</p> |
| 629 |
</li> |
| 630 |
|
| 631 |
<li> |
| 632 |
<p>to accept the standard string terminator as well.</p> |
| 633 |
</li> |
| 634 |
</ul> |
| 635 |
|
| 636 |
<p>In addition to implementing the VT220's <em>National |
| 637 |
Replacement Character</em> sets (see vttest <a href= |
| 638 |
"/vttest/vttest-nrcs.html">screenshots</a>), I added other |
| 639 |
features to emulate the successive models of DEC terminals. The |
| 640 |
<a href= |
| 641 |
"manpage/xterm.html#VT100-Widget-Resources:decTerminalID"><code>decTerminalID</code></a> |
| 642 |
resource (in <a href="xterm.log.html#xterm_29">1996</a>) lets |
| 643 |
users select the emulation to use. Because many of my changes |
| 644 |
were <em>extensions</em> (features not in any of DEC's terminals) |
| 645 |
and because well-behaved VT100 applications would not use |
| 646 |
features from higher-level terminals it was not initially |
| 647 |
important to prevent use of those by applications which assumed |
| 648 |
they were using just a VT100. Knowledgeable users could easily |
| 649 |
configure xterm to emulate a VT220. In <a href= |
| 650 |
"xterm.log.html#xterm_280">2012</a>, I changed the default from |
| 651 |
VT100 to VT420.</p> |
| 652 |
|
| 653 |
<h3 id="whatis_state_table-id"><a name="whatis_state_table" id= |
| 654 |
"whatis_state_table">What is a State Table?</a></h3> |
| 655 |
|
| 656 |
<p>That was mentioned regarding the title strings. |
| 657 |
<strong>XTerm</strong> uses a state machine to handle incoming |
| 658 |
characters. That is essentially what a real terminal does. Other |
| 659 |
“xterm” terminal emulators typically do not do this, |
| 660 |
which makes them not do well with <a href= |
| 661 |
"/vttest/vttest.html">vttest</a>.</p> |
| 662 |
|
| 663 |
<h3 id="why_not_vt320-id"><a name="why_not_vt320" id= |
| 664 |
"why_not_vt320">Why not emulate VT320?</a></h3> |
| 665 |
|
| 666 |
<p>You could do that (by changing <code>decTerminalID</code>, but |
| 667 |
the results were not that interesting). In retrospect, the VT320 |
| 668 |
was a stopgap implementation designed to bridge between the VT200 |
| 669 |
series and the VT420. It provided a standard codepage (for ISO |
| 670 |
Latin-1).</p> |
| 671 |
|
| 672 |
<p>While it had other features not found in the VT200-series, |
| 673 |
most of those are less useful in a terminal emulator. I did adapt |
| 674 |
the ECMA-48 <em>scrolling</em> operations which the VT320 |
| 675 |
interpreted as <em>panning</em> the visible display in the |
| 676 |
terminal's memory. Expect some difference there (if you can find |
| 677 |
an application on VMS which used the feature).</p> |
| 678 |
|
| 679 |
<p>The VT320 was popular with developers of commercial terminal |
| 680 |
emulators, whose literature referred to it as supporting ANSI |
| 681 |
color. It did not do this.</p> |
| 682 |
|
| 683 |
<h3 id="why_vt420-id"><a name="why_vt420" id="why_vt420">Why |
| 684 |
emulate VT420?</a></h3> |
| 685 |
|
| 686 |
<p>The VT420 was interesting because it provided two features |
| 687 |
that could be useful:</p> |
| 688 |
|
| 689 |
<ul> |
| 690 |
<li> |
| 691 |
<p>rectangles</p> |
| 692 |
</li> |
| 693 |
|
| 694 |
<li> |
| 695 |
<p>left/right margins (like the top/bottom scrolling |
| 696 |
margins)</p> |
| 697 |
</li> |
| 698 |
</ul> |
| 699 |
|
| 700 |
<p>A VT420, of course, supports all of the features in VT320, in |
| 701 |
turn all of the features in VT220, and in turn VT100. Users would |
| 702 |
not lose features by changing the default emulation to VT420. By |
| 703 |
changing the default emulation, most users would automatically be |
| 704 |
able to use applications (such as <code>tmux</code>) that could |
| 705 |
perform better if the left/right margin feature is available. I |
| 706 |
changed the emulation to VT420 in 2012 for this reason.</p> |
| 707 |
|
| 708 |
<p>XTerm does not emulate some esoteric features (such as dual |
| 709 |
sessions) because those require hosts using special software, and |
| 710 |
no publicly-available documentation was available.</p> |
| 711 |
|
| 712 |
<h3 id="why_not_vt520-id"><a name="why_not_vt520" id= |
| 713 |
"why_not_vt520">Why not emulate VT520?</a></h3> |
| 714 |
|
| 715 |
<p>Again, the VT500-series is less interesting because most of |
| 716 |
the features which are not hardware-specific (such as reporting |
| 717 |
transmission rate) are less useful.</p> |
| 718 |
|
| 719 |
<p>However:</p> |
| 720 |
|
| 721 |
<ul> |
| 722 |
<li> |
| 723 |
<p>the VT500-series provides additional codepages (like the |
| 724 |
VT320). XTerm does that.</p> |
| 725 |
</li> |
| 726 |
|
| 727 |
<li> |
| 728 |
<p>the VT500-series supports some of the ECMA-48 |
| 729 |
cursor-movement operations which had been overlooked in the |
| 730 |
previous terminals. XTerm does that (based on ECMA-48 itself, |
| 731 |
and later on DEC's documentation).</p> |
| 732 |
</li> |
| 733 |
</ul> |
| 734 |
|
| 735 |
<p>As for the other features, most are not useful in emulation |
| 736 |
(since they are hardware-specific). Additionally, these less-used |
| 737 |
features are not documented precisely and since the only point of |
| 738 |
providing them would be for successful interoperability with |
| 739 |
legacy applications, some reverse-engineering would be needed to |
| 740 |
provide a faithful emulation. To date there are no known terminal |
| 741 |
emulators which do that.</p> |
| 742 |
|
| 743 |
<h2 id="what_platforms-id"><a name="what_platforms" id= |
| 744 |
"what_platforms">What platforms does it run on?</a></h2> |
| 745 |
|
| 746 |
<p><strong>XTerm</strong> runs in all of the implementations of |
| 747 |
X11. As of 2000, I had built and run these since I started |
| 748 |
working on xterm in 1996:</p> |
| 749 |
|
| 750 |
<ul> |
| 751 |
<li>AIX 3.2.5, 4.1, 4.3 (cc)</li> |
| 752 |
|
| 753 |
<li>Digital Unix 3.2, 4.0, 5.0 (cc)</li> |
| 754 |
|
| 755 |
<li>FreeBSD 2.2.6 to 6.0 (gcc 2.8)</li> |
| 756 |
|
| 757 |
<li>HP-UX 9.05 to 11.23 (gcc 2.7.2 to 3.4)</li> |
| 758 |
|
| 759 |
<li>IRIX 5.2, 6.2 (cc, gcc 2.7.2, gcc 2.8)</li> |
| 760 |
|
| 761 |
<li>Linux 2.0.0 to 2.6.26 (gcc 2.7.2 to 4.3)</li> |
| 762 |
|
| 763 |
<li>SCO OpenServer 5 (cc, gcc).</li> |
| 764 |
|
| 765 |
<li>Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8 (cc, gcc 2.7.2)</li> |
| 766 |
|
| 767 |
<li>SunOS 4.1.1, 4.1.3 (gcc 2.7.2)</li> |
| 768 |
</ul> |
| 769 |
|
| 770 |
<p>The older configurations have X11R5 libraries. Only minor |
| 771 |
changes are needed to make xterm work on those systems. However, |
| 772 |
X11R6 provided better locale support, as well as new features |
| 773 |
such as the active icon. X11R7... not much to say there.</p> |
| 774 |
|
| 775 |
<p>Since 2000, there have been many changes (including new |
| 776 |
platforms such as MacOS, NetBSD, OpenBSD, etc., as well as QNX, |
| 777 |
Cygwin, and Minix).</p> |
| 778 |
|
| 779 |
<h2 id="latest_version-id"><a name="latest_version" id= |
| 780 |
"latest_version">What is the latest version?</a></h2> |
| 781 |
|
| 782 |
<p>The most recent (and well supported) version of xterm is the |
| 783 |
one that I maintain:</p> |
| 784 |
|
| 785 |
<ul> |
| 786 |
<li> |
| 787 |
<p><a href="/datafiles/release/xterm.tar.gz">source</a></p> |
| 788 |
</li> |
| 789 |
|
| 790 |
<li> |
| 791 |
<p><a href="/archives/xterm/">archives</a></p> |
| 792 |
</li> |
| 793 |
</ul> |
| 794 |
|
| 795 |
<h2 id="other_versions-id"><a name="other_versions" id= |
| 796 |
"other_versions">What versions are available?</a></h2> |
| 797 |
|
| 798 |
<p>There are several other versions of xterm, based on xterm's |
| 799 |
source. These include</p> |
| 800 |
|
| 801 |
<ul> |
| 802 |
<li> |
| 803 |
<p><a href="#bug_ansi_xterm">ansi_xterm</a></p> |
| 804 |
</li> |
| 805 |
|
| 806 |
<li> |
| 807 |
<p><a href="xterm.faq.html#bug_color_xterm">color_xterm</a></p> |
| 808 |
</li> |
| 809 |
|
| 810 |
<li> |
| 811 |
<p><a href="#bug_cxterm">cxterm</a> (Chinese)</p> |
| 812 |
</li> |
| 813 |
|
| 814 |
<li> |
| 815 |
<p><a href="#bug_hanterm">hanterm</a> (Korean)</p> |
| 816 |
</li> |
| 817 |
|
| 818 |
<li> |
| 819 |
<p><a href="#bug_mxterm">mxterm</a></p> |
| 820 |
</li> |
| 821 |
|
| 822 |
<li> |
| 823 |
<p><a href="#bug_nxterm">nxterm</a></p> |
| 824 |
</li> |
| 825 |
|
| 826 |
<li> |
| 827 |
<p><a href="#bug_kterm">kterm</a> (Japanese)</p> |
| 828 |
</li> |
| 829 |
|
| 830 |
<li> |
| 831 |
<p><a href="#bug_xterm_r6">xterm</a> (from X Consortium)</p> |
| 832 |
</li> |
| 833 |
</ul> |
| 834 |
|
| 835 |
<p>There are similar programs not based on xterm's source, which |
| 836 |
are compatible to different degrees. These include</p> |
| 837 |
|
| 838 |
<ul> |
| 839 |
<li> |
| 840 |
<p><a href="#bug_dtterm">dtterm</a></p> |
| 841 |
</li> |
| 842 |
|
| 843 |
<li> |
| 844 |
<p><a href="#bug_emu">emu</a> (from X Consortium)</p> |
| 845 |
</li> |
| 846 |
|
| 847 |
<li> |
| 848 |
<p><a href="#bug_eterm">Eterm</a></p> |
| 849 |
</li> |
| 850 |
|
| 851 |
<li> |
| 852 |
<p><a href="#bug_gnometerm">GNOME Terminal</a></p> |
| 853 |
</li> |
| 854 |
|
| 855 |
<li> |
| 856 |
<p><a href="#bug_multignome">Multi GNOME Terminal (MGT)</a></p> |
| 857 |
</li> |
| 858 |
|
| 859 |
<li> |
| 860 |
<p><a href="#bug_mterm">mterm</a></p> |
| 861 |
</li> |
| 862 |
|
| 863 |
<li> |
| 864 |
<p><a href="#bug_konsole">konsole</a></p> |
| 865 |
</li> |
| 866 |
|
| 867 |
<li> |
| 868 |
<p><a href="#bug_mlterm">mlterm</a> (Multi Lingual)</p> |
| 869 |
</li> |
| 870 |
|
| 871 |
<li> |
| 872 |
<p><a href="#bug_osso_xterm">osso-xterm</a></p> |
| 873 |
</li> |
| 874 |
|
| 875 |
<li> |
| 876 |
<p><a href="#bug_roxterm">roxterm</a></p> |
| 877 |
</li> |
| 878 |
|
| 879 |
<li> |
| 880 |
<p><a href="#bug_rxvt">rxvt</a></p> |
| 881 |
</li> |
| 882 |
|
| 883 |
<li> |
| 884 |
<p><a href="#bug_st">st</a></p> |
| 885 |
</li> |
| 886 |
|
| 887 |
<li> |
| 888 |
<p><a href="#bug_xfce_term">xfce-term</a></p> |
| 889 |
</li> |
| 890 |
|
| 891 |
<li> |
| 892 |
<p><a href="#bug_xgterm">xgterm</a></p> |
| 893 |
</li> |
| 894 |
|
| 895 |
<li> |
| 896 |
<p><a href="#bug_xiterm">xiterm</a></p> |
| 897 |
</li> |
| 898 |
</ul> |
| 899 |
|
| 900 |
<p>Some of these use the <a href="#vte_widget">VTE widget</a>. |
| 901 |
Since that supplies most of the terminal emulation, the remaining |
| 902 |
differences between programs using VTE tend to be at the level of |
| 903 |
the window manager (menus, borders, etc.). Other (older) programs |
| 904 |
which are based on reusable widgets include <a href= |
| 905 |
"#bug_dtterm">dtterm</a> and <a href= |
| 906 |
"xterm.faq.html#bug_emu">emu</a>.</p> |
| 907 |
|
| 908 |
<p>(I am aware of a few others, such as <strong>xcterm</strong>, |
| 909 |
but have not seen a working version of these).</p> |
| 910 |
|
| 911 |
<p>Finally of course, there are a multitude of programs which set |
| 912 |
TERM to “xterm”, in the hope that applications will |
| 913 |
treat them the same as xterm. For example,</p> |
| 914 |
|
| 915 |
<ul> |
| 916 |
<li> |
| 917 |
<p>PuTTY does this (see its FAQ <a href= |
| 918 |
"https://www.chiark.greenend.org.uk/~sgtatham/putty/faq.html#faq-term"> |
| 919 |
<em>A.5.1 What terminal type does PuTTY use?</em></a>). But |
| 920 |
its wrapping behavior is incompatible with xterm (and any |
| 921 |
vt100 emulator). You can see this in the first menu entry for |
| 922 |
<a href="/vttest/vttest.html">vttest</a>.</p> |
| 923 |
</li> |
| 924 |
|
| 925 |
<li> |
| 926 |
<p>VTE does this. But consider the list of problems with |
| 927 |
<a href= |
| 928 |
"https://web.archive.org/web/20150903071650/https://bugzilla.gnome.org/buglist.cgi?quicksearch=vte"> |
| 929 |
VTE</a> and with <a href= |
| 930 |
"https://web.archive.org/web/20150903071608/https://bugzilla.gnome.org/buglist.cgi?quicksearch=gnome%20terminal"> |
| 931 |
GNOME Terminal</a>. The attitude of the developers is that by |
| 932 |
copying from xterm, they are <em>entitled</em> to do this |
| 933 |
whether or not the program actually matches xterm's terminal |
| 934 |
description. This is unchanged since the mid-2000s (see |
| 935 |
Debian <a href= |
| 936 |
"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=368916">#368916</a> |
| 937 |
for example).</p> |
| 938 |
|
| 939 |
<p>Those are old. There are newer reports in gitlab, but a |
| 940 |
caveat noted <a href= |
| 941 |
"/personal/changelogs.html#problem_hostile">here</a> |
| 942 |
applies.</p> |
| 943 |
</li> |
| 944 |
|
| 945 |
<li> |
| 946 |
<p>Konsole does this as well—intentionally as shown in |
| 947 |
<a href="https://bugs.kde.org/show_bug.cgi?id=145977"><em>KDE |
| 948 |
#145977 – Konsole has a terminfo entry of its own; |
| 949 |
please change default $TERM</em></a>. The reasoning expressed |
| 950 |
there is that Konsole “should” match xterm. |
| 951 |
Incidentally, one of the comments (about xterm's support for |
| 952 |
mouse) cited as proof a <a href= |
| 953 |
"https://www.linuxjournal.com/article/1136">page about |
| 954 |
Gpm</a> from Linux Journal which was more than 12 years |
| 955 |
old.</p> |
| 956 |
</li> |
| 957 |
</ul> |
| 958 |
|
| 959 |
<p>Each of the programs noted here which are well-established and |
| 960 |
which are known to differ markedly from xterm have their own |
| 961 |
terminal descriptions in ncurses, to which TERM should be set. |
| 962 |
Otherwise, bug-reports are misdirected to <a href= |
| 963 |
"/ncurses/ncurses.html#download_database">ncurses</a> which |
| 964 |
should have been addressed by the respective developers of these |
| 965 |
programs. These include</p> |
| 966 |
|
| 967 |
<ul> |
| 968 |
<li> |
| 969 |
<p><a href="/ncurses/terminfo.src.html#tic-_Eterm">Eterm</a></p> |
| 970 |
</li> |
| 971 |
|
| 972 |
<li> |
| 973 |
<p><a href="/ncurses/terminfo.src.html#tic-gnome">gnome</a> |
| 974 |
(obsolete)</p> |
| 975 |
</li> |
| 976 |
|
| 977 |
<li> |
| 978 |
<p><a href= |
| 979 |
"/ncurses/terminfo.src.html#tic-konsole">konsole</a></p> |
| 980 |
</li> |
| 981 |
|
| 982 |
<li> |
| 983 |
<p><a href="/ncurses/terminfo.src.html#tic-mlterm">mlterm</a></p> |
| 984 |
</li> |
| 985 |
|
| 986 |
<li> |
| 987 |
<p><a href="/ncurses/terminfo.src.html#tic-mrxvt">mrxvt</a></p> |
| 988 |
</li> |
| 989 |
|
| 990 |
<li> |
| 991 |
<p><a href="/ncurses/terminfo.src.html#tic-putty">putty</a></p> |
| 992 |
</li> |
| 993 |
|
| 994 |
<li> |
| 995 |
<p><a href="/ncurses/terminfo.src.html#tic-rxvt">rxvt</a></p> |
| 996 |
</li> |
| 997 |
|
| 998 |
<li> |
| 999 |
<p><a href="/ncurses/terminfo.src.html#tic-st">st</a></p> |
| 1000 |
</li> |
| 1001 |
|
| 1002 |
<li> |
| 1003 |
<p><a href="/ncurses/terminfo.src.html#tic-vte">vte</a> |
| 1004 |
(preferred)</p> |
| 1005 |
</li> |
| 1006 |
</ul> |
| 1007 |
|
| 1008 |
<h2><a name="not_an_xterm" id="not_an_xterm">What are some |
| 1009 |
programs that are not X terminals?</a></h2> |
| 1010 |
|
| 1011 |
<p>Some developers suppose that just by setting the <tt>TERM</tt> |
| 1012 |
environment variable to <em>xterm-256color</em> they have |
| 1013 |
“xterm” (not really).</p> |
| 1014 |
|
| 1015 |
<p>A X Window terminal emulator which acts like xterm does |
| 1016 |
this:</p> |
| 1017 |
|
| 1018 |
<ul> |
| 1019 |
<li> |
| 1020 |
<p>provides remote connections to an X server, to execute the |
| 1021 |
terminal on the X server's host.</p> |
| 1022 |
</li> |
| 1023 |
|
| 1024 |
<li> |
| 1025 |
<p>provides a resizable window using the mouse, and accepts |
| 1026 |
the X11 mouse protocol for input events.</p> |
| 1027 |
</li> |
| 1028 |
|
| 1029 |
<li> |
| 1030 |
<p>passes (if not all of) a consistent set of the repertoire |
| 1031 |
in <a href="/vttest/">vttest</a>.</p> |
| 1032 |
</li> |
| 1033 |
|
| 1034 |
<li> |
| 1035 |
<p>passes all of the checks in <a href= |
| 1036 |
"/ncurses/tack/">tack</a> for the terminal description.</p> |
| 1037 |
</li> |
| 1038 |
</ul> |
| 1039 |
|
| 1040 |
<p>Reflecting on some of the terminals reviewed here and in the |
| 1041 |
<a href="/ncurses/ncurses.faq.html#xterm_generic">ncurses |
| 1042 |
FAQ</a>:</p> |
| 1043 |
|
| 1044 |
<ul> |
| 1045 |
<li> |
| 1046 |
<p>Some do not work via a network connection. Some others |
| 1047 |
should be excluded on that basis, such as gnome-terminal |
| 1048 |
which for many years has relied upon a crutch (<a href= |
| 1049 |
"https://dbus.freedesktop.org/doc/dbus-launch.1.html">dbus-launch</a>) |
| 1050 |
to accomplish this goal.</p> |
| 1051 |
</li> |
| 1052 |
|
| 1053 |
<li> |
| 1054 |
<p>Some are best known on non-X platforms, e.g., |
| 1055 |
<em>PuTTY</em>. In that case, its X Window port (pterm) gets |
| 1056 |
some mention.</p> |
| 1057 |
</li> |
| 1058 |
|
| 1059 |
<li> |
| 1060 |
<p>Some (such as those using OpenGL 4.3) do not work well in |
| 1061 |
X, although OpenGL has an X11 driver. Some work passably with |
| 1062 |
older versions of OpenGL (such as alacritty).</p> |
| 1063 |
</li> |
| 1064 |
|
| 1065 |
<li> |
| 1066 |
<p>Some terminals are none-of-the above, e.g., iTerm2, MacOS |
| 1067 |
Terminal, Windows Terminal, because they do not run in an X |
| 1068 |
Window environment, and because those are missing |
| 1069 |
features.</p> |
| 1070 |
</li> |
| 1071 |
</ul> |
| 1072 |
|
| 1073 |
<h2 id="compare_versions-id"><a name="compare_versions" id= |
| 1074 |
"compare_versions">Comparing versions, by counting controls</a></h2> |
| 1075 |
|
| 1076 |
<p>Several of these programs are claimed (either by their |
| 1077 |
developers, or their users) to emulate “most” of |
| 1078 |
xterm. To me, “most” would be something quantifiable, |
| 1079 |
e.g., 80 percent. To satisfy my curiosity, I wrote a script to |
| 1080 |
extract the control sequence information from <a href= |
| 1081 |
"xterm.faq.html#ctlseqs_ms">ctlseqs.txt</a>. This counts each |
| 1082 |
control sequence, as well as the variations such as setting bold, |
| 1083 |
color, inverse video. Then I (laboriously) inspected these |
| 1084 |
terminal implementations:</p> |
| 1085 |
|
| 1086 |
<ul> |
| 1087 |
<li>xterm patch #266 ("xterm-new")</li> |
| 1088 |
|
| 1089 |
<li>X11R6.3 xterm (xterm-r6)</li> |
| 1090 |
|
| 1091 |
<li>DEC vt220</li> |
| 1092 |
|
| 1093 |
<li>DEC vt102</li> |
| 1094 |
|
| 1095 |
<li>rxvt 2.7.10</li> |
| 1096 |
|
| 1097 |
<li>rxvt-unicode 9.09 (urxvt)</li> |
| 1098 |
|
| 1099 |
<li>konsole 2.5.3</li> |
| 1100 |
|
| 1101 |
<li>VTE 0.25.91 (vte), used in GNOME-Terminal and kindred.</li> |
| 1102 |
</ul> |
| 1103 |
|
| 1104 |
<p>As of mid-November 2010, these were the latest |
| 1105 |
implementations. I included data for the vt220 and vt102 to be |
| 1106 |
able to contrast the various terminal <em>emulators</em> against |
| 1107 |
those as well as xterm. There were:</p> |
| 1108 |
|
| 1109 |
<ul> |
| 1110 |
<li> |
| 1111 |
<p>498 control sequences listed in the corresponding file for |
| 1112 |
xterm patch #266.</p> |
| 1113 |
</li> |
| 1114 |
|
| 1115 |
<li> |
| 1116 |
<p>192 of those are “primary”, e.g., disregarding |
| 1117 |
parameters such as those distinguishing bold from color.</p> |
| 1118 |
</li> |
| 1119 |
|
| 1120 |
<li> |
| 1121 |
<p>37 of the primary control sequences have secondary |
| 1122 |
sequences.</p> |
| 1123 |
</li> |
| 1124 |
</ul> |
| 1125 |
|
| 1126 |
<p>For each control, there are three possibilities:</p> |
| 1127 |
|
| 1128 |
<ol> |
| 1129 |
<li> |
| 1130 |
<p>“yes” — the terminal implements it, |
| 1131 |
matching xterm. If xterm implements it, and it is a feature |
| 1132 |
of vt220 or vt102, then in turn xterm's behavior must match |
| 1133 |
vt220 or vt102.</p> |
| 1134 |
</li> |
| 1135 |
|
| 1136 |
<li> |
| 1137 |
<p>“partial” — the terminal implements it, |
| 1138 |
but its behavior does not match the reference noted |
| 1139 |
above.</p> |
| 1140 |
</li> |
| 1141 |
|
| 1142 |
<li> |
| 1143 |
<p>“no” — the terminal does not implement |
| 1144 |
the control.</p> |
| 1145 |
</li> |
| 1146 |
</ol> |
| 1147 |
|
| 1148 |
<p>The <a href="ctlseqs/ctlseqs.html">control sequences</a> |
| 1149 |
document lists a few controls which xterm does not (completely) |
| 1150 |
implement, e.g.,</p> |
| 1151 |
|
| 1152 |
<ul> |
| 1153 |
<li> |
| 1154 |
<p><a href= |
| 1155 |
"ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-?-Pm-h:Ps-=-8.1E68"> |
| 1156 |
key-repeat</a></p> |
| 1157 |
</li> |
| 1158 |
|
| 1159 |
<li> |
| 1160 |
<p><a href= |
| 1161 |
"ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps-q.1CB1"> |
| 1162 |
enabling LEDs</a> other than scroll-lock</p> |
| 1163 |
</li> |
| 1164 |
</ul> |
| 1165 |
|
| 1166 |
<p>Those are not implemented in xterm because all X applications |
| 1167 |
share the same keyboard (see <a href= |
| 1168 |
"manpage/xterm.html#h2-EMULATIONS">manpage</a>), and <a href= |
| 1169 |
"https://www.x.org/releases/current/doc/man/man1/xset.1.xhtml">xset</a> |
| 1170 |
is the proper tool for changing auto-repeat. The <a href= |
| 1171 |
"https://github.com/ThomasDickey/old-xterm/blob/d448c6d7373c3bc3df4c75e815baa1e645462893/charproc.c#L1048"> |
| 1172 |
X10R4</a> xterm did implement key-repeat, but the feature was |
| 1173 |
removed in <a href= |
| 1174 |
"https://github.com/ThomasDickey/old-xterm/blob/6bf1714f13b7811c3e28d186bfc9942d971edd9b/charproc.c#L1048"> |
| 1175 |
X11R1</a>. None of the other terminal emulators implements those |
| 1176 |
either.</p> |
| 1177 |
|
| 1178 |
<table border="1" summary= |
| 1179 |
"Comparing against the control sequences document"> |
| 1180 |
<caption> |
| 1181 |
Comparing against the control sequences document |
| 1182 |
</caption> |
| 1183 |
|
| 1184 |
<colgroup> |
| 1185 |
<col width="15%"> |
| 1186 |
<col width="15%"> |
| 1187 |
<col width="15%"> |
| 1188 |
<col width="35%"> |
| 1189 |
</colgroup> |
| 1190 |
|
| 1191 |
<tr> |
| 1192 |
<th>yes</th> |
| 1193 |
<th>partial</th> |
| 1194 |
<th>no</th> |
| 1195 |
<th>program</th> |
| 1196 |
</tr> |
| 1197 |
|
| 1198 |
<tr> |
| 1199 |
<td>488</td> |
| 1200 |
<td>4</td> |
| 1201 |
<td>6</td> |
| 1202 |
<td>xterm-new</td> |
| 1203 |
</tr> |
| 1204 |
|
| 1205 |
<tr> |
| 1206 |
<td>154</td> |
| 1207 |
<td>6</td> |
| 1208 |
<td>338</td> |
| 1209 |
<td>xterm-r6</td> |
| 1210 |
</tr> |
| 1211 |
|
| 1212 |
<tr> |
| 1213 |
<td>188</td> |
| 1214 |
<td>5</td> |
| 1215 |
<td>305</td> |
| 1216 |
<td>vt220</td> |
| 1217 |
</tr> |
| 1218 |
|
| 1219 |
<tr> |
| 1220 |
<td>104</td> |
| 1221 |
<td>0</td> |
| 1222 |
<td>394</td> |
| 1223 |
<td>vt102</td> |
| 1224 |
</tr> |
| 1225 |
|
| 1226 |
<tr> |
| 1227 |
<td>204</td> |
| 1228 |
<td>3</td> |
| 1229 |
<td>291</td> |
| 1230 |
<td>rxvt</td> |
| 1231 |
</tr> |
| 1232 |
|
| 1233 |
<tr> |
| 1234 |
<td>219</td> |
| 1235 |
<td>3</td> |
| 1236 |
<td>276</td> |
| 1237 |
<td>urxvt</td> |
| 1238 |
</tr> |
| 1239 |
|
| 1240 |
<tr> |
| 1241 |
<td>191</td> |
| 1242 |
<td>2</td> |
| 1243 |
<td>305</td> |
| 1244 |
<td>putty</td> |
| 1245 |
</tr> |
| 1246 |
|
| 1247 |
<tr> |
| 1248 |
<td>170</td> |
| 1249 |
<td>3</td> |
| 1250 |
<td>325</td> |
| 1251 |
<td>konsole</td> |
| 1252 |
</tr> |
| 1253 |
|
| 1254 |
<tr> |
| 1255 |
<td>184</td> |
| 1256 |
<td>6</td> |
| 1257 |
<td>308</td> |
| 1258 |
<td>vte</td> |
| 1259 |
</tr> |
| 1260 |
</table> |
| 1261 |
|
| 1262 |
<p>Modern xterm implements 188 primary controls. In this table, |
| 1263 |
vte ranks lower than PuTTY because it does not support vt52 |
| 1264 |
emulation. This is not unusual, since the rxvt-based emulators do |
| 1265 |
not, either. However, all vt100's provide this feature; programs |
| 1266 |
lacking this are not really a vt100 emulator. On the other hand, |
| 1267 |
PuTTY (which is not a vt100 emulator due to its incompatible |
| 1268 |
wrapping behavior) supports this feature.</p> |
| 1269 |
|
| 1270 |
<p>Aside from that, the various emulators implement much the same |
| 1271 |
features from xterm. None implements as many as half of xterm's |
| 1272 |
controls.</p> |
| 1273 |
|
| 1274 |
<table border="1" summary="Comparing against xterm"> |
| 1275 |
<caption> |
| 1276 |
Comparing against xterm |
| 1277 |
</caption> |
| 1278 |
|
| 1279 |
<colgroup> |
| 1280 |
<col width="15%"> |
| 1281 |
<col width="15%"> |
| 1282 |
<col width="15%"> |
| 1283 |
<col width="35%"> |
| 1284 |
</colgroup> |
| 1285 |
|
| 1286 |
<tr> |
| 1287 |
<th>yes</th> |
| 1288 |
<th>partial</th> |
| 1289 |
<th>no</th> |
| 1290 |
<th>program</th> |
| 1291 |
</tr> |
| 1292 |
|
| 1293 |
<tr> |
| 1294 |
<td>488</td> |
| 1295 |
<td>0</td> |
| 1296 |
<td>0</td> |
| 1297 |
<td>xterm-new</td> |
| 1298 |
</tr> |
| 1299 |
|
| 1300 |
<tr> |
| 1301 |
<td>154</td> |
| 1302 |
<td>6</td> |
| 1303 |
<td>328</td> |
| 1304 |
<td>xterm-r6</td> |
| 1305 |
</tr> |
| 1306 |
|
| 1307 |
<tr> |
| 1308 |
<td>182</td> |
| 1309 |
<td>2</td> |
| 1310 |
<td>304</td> |
| 1311 |
<td>vt220</td> |
| 1312 |
</tr> |
| 1313 |
|
| 1314 |
<tr> |
| 1315 |
<td>98</td> |
| 1316 |
<td>0</td> |
| 1317 |
<td>390</td> |
| 1318 |
<td>vt102</td> |
| 1319 |
</tr> |
| 1320 |
|
| 1321 |
<tr> |
| 1322 |
<td>204</td> |
| 1323 |
<td>3</td> |
| 1324 |
<td>281</td> |
| 1325 |
<td>rxvt</td> |
| 1326 |
</tr> |
| 1327 |
|
| 1328 |
<tr> |
| 1329 |
<td>219</td> |
| 1330 |
<td>3</td> |
| 1331 |
<td>266</td> |
| 1332 |
<td>urxvt</td> |
| 1333 |
</tr> |
| 1334 |
|
| 1335 |
<tr> |
| 1336 |
<td>189</td> |
| 1337 |
<td>2</td> |
| 1338 |
<td>297</td> |
| 1339 |
<td>putty</td> |
| 1340 |
</tr> |
| 1341 |
|
| 1342 |
<tr> |
| 1343 |
<td>170</td> |
| 1344 |
<td>3</td> |
| 1345 |
<td>315</td> |
| 1346 |
<td>konsole</td> |
| 1347 |
</tr> |
| 1348 |
|
| 1349 |
<tr> |
| 1350 |
<td>184</td> |
| 1351 |
<td>6</td> |
| 1352 |
<td>298</td> |
| 1353 |
<td>vte</td> |
| 1354 |
</tr> |
| 1355 |
</table> |
| 1356 |
|
| 1357 |
<p>DEC VT220 implements 96 primary controls. Modern xterm (as |
| 1358 |
documented), implements most of the VT220. VTE implements fewer |
| 1359 |
than half. The others are a little better. None of the others |
| 1360 |
could be used as a real VT220.</p> |
| 1361 |
|
| 1362 |
<table border="1" summary="Comparing against vt220"> |
| 1363 |
<caption> |
| 1364 |
Comparing against vt220 |
| 1365 |
</caption> |
| 1366 |
|
| 1367 |
<colgroup> |
| 1368 |
<col width="15%"> |
| 1369 |
<col width="15%"> |
| 1370 |
<col width="15%"> |
| 1371 |
<col width="35%"> |
| 1372 |
</colgroup> |
| 1373 |
|
| 1374 |
<tr> |
| 1375 |
<th>yes</th> |
| 1376 |
<th>partial</th> |
| 1377 |
<th>no</th> |
| 1378 |
<th>program</th> |
| 1379 |
</tr> |
| 1380 |
|
| 1381 |
<tr> |
| 1382 |
<td>182</td> |
| 1383 |
<td>0</td> |
| 1384 |
<td>6</td> |
| 1385 |
<td>xterm-new</td> |
| 1386 |
</tr> |
| 1387 |
|
| 1388 |
<tr> |
| 1389 |
<td>78</td> |
| 1390 |
<td>6</td> |
| 1391 |
<td>104</td> |
| 1392 |
<td>xterm-r6</td> |
| 1393 |
</tr> |
| 1394 |
|
| 1395 |
<tr> |
| 1396 |
<td>188</td> |
| 1397 |
<td>0</td> |
| 1398 |
<td>0</td> |
| 1399 |
<td>vt220</td> |
| 1400 |
</tr> |
| 1401 |
|
| 1402 |
<tr> |
| 1403 |
<td>104</td> |
| 1404 |
<td>0</td> |
| 1405 |
<td>84</td> |
| 1406 |
<td>vt102</td> |
| 1407 |
</tr> |
| 1408 |
|
| 1409 |
<tr> |
| 1410 |
<td>101</td> |
| 1411 |
<td>3</td> |
| 1412 |
<td>84</td> |
| 1413 |
<td>rxvt</td> |
| 1414 |
</tr> |
| 1415 |
|
| 1416 |
<tr> |
| 1417 |
<td>106</td> |
| 1418 |
<td>3</td> |
| 1419 |
<td>79</td> |
| 1420 |
<td>urxvt</td> |
| 1421 |
</tr> |
| 1422 |
|
| 1423 |
<tr> |
| 1424 |
<td>107</td> |
| 1425 |
<td>2</td> |
| 1426 |
<td>79</td> |
| 1427 |
<td>putty</td> |
| 1428 |
</tr> |
| 1429 |
|
| 1430 |
<tr> |
| 1431 |
<td>100</td> |
| 1432 |
<td>3</td> |
| 1433 |
<td>85</td> |
| 1434 |
<td>konsole</td> |
| 1435 |
</tr> |
| 1436 |
|
| 1437 |
<tr> |
| 1438 |
<td>88</td> |
| 1439 |
<td>6</td> |
| 1440 |
<td>94</td> |
| 1441 |
<td>vte</td> |
| 1442 |
</tr> |
| 1443 |
</table> |
| 1444 |
|
| 1445 |
<p>DEC VT102 (the actual flavor used for “vt100” in |
| 1446 |
most cases), implements 68 primary controls. Again, VTE fares |
| 1447 |
worst, and the others a little better.</p> |
| 1448 |
|
| 1449 |
<table border="1" summary="Comparing against vt102"> |
| 1450 |
<caption> |
| 1451 |
Comparing against vt102 |
| 1452 |
</caption> |
| 1453 |
|
| 1454 |
<colgroup> |
| 1455 |
<col width="15%"> |
| 1456 |
<col width="15%"> |
| 1457 |
<col width="15%"> |
| 1458 |
<col width="35%"> |
| 1459 |
</colgroup> |
| 1460 |
|
| 1461 |
<tr> |
| 1462 |
<th>yes</th> |
| 1463 |
<th>partial</th> |
| 1464 |
<th>no</th> |
| 1465 |
<th>program</th> |
| 1466 |
</tr> |
| 1467 |
|
| 1468 |
<tr> |
| 1469 |
<td>98</td> |
| 1470 |
<td>0</td> |
| 1471 |
<td>6</td> |
| 1472 |
<td>xterm-new</td> |
| 1473 |
</tr> |
| 1474 |
|
| 1475 |
<tr> |
| 1476 |
<td>70</td> |
| 1477 |
<td>6</td> |
| 1478 |
<td>28</td> |
| 1479 |
<td>xterm-r6</td> |
| 1480 |
</tr> |
| 1481 |
|
| 1482 |
<tr> |
| 1483 |
<td>104</td> |
| 1484 |
<td>0</td> |
| 1485 |
<td>0</td> |
| 1486 |
<td>vt220</td> |
| 1487 |
</tr> |
| 1488 |
|
| 1489 |
<tr> |
| 1490 |
<td>104</td> |
| 1491 |
<td>0</td> |
| 1492 |
<td>0</td> |
| 1493 |
<td>vt102</td> |
| 1494 |
</tr> |
| 1495 |
|
| 1496 |
<tr> |
| 1497 |
<td>79</td> |
| 1498 |
<td>2</td> |
| 1499 |
<td>23</td> |
| 1500 |
<td>rxvt</td> |
| 1501 |
</tr> |
| 1502 |
|
| 1503 |
<tr> |
| 1504 |
<td>81</td> |
| 1505 |
<td>2</td> |
| 1506 |
<td>21</td> |
| 1507 |
<td>urxvt</td> |
| 1508 |
</tr> |
| 1509 |
|
| 1510 |
<tr> |
| 1511 |
<td>86</td> |
| 1512 |
<td>2</td> |
| 1513 |
<td>16</td> |
| 1514 |
<td>putty</td> |
| 1515 |
</tr> |
| 1516 |
|
| 1517 |
<tr> |
| 1518 |
<td>85</td> |
| 1519 |
<td>3</td> |
| 1520 |
<td>16</td> |
| 1521 |
<td>konsole</td> |
| 1522 |
</tr> |
| 1523 |
|
| 1524 |
<tr> |
| 1525 |
<td>60</td> |
| 1526 |
<td>1</td> |
| 1527 |
<td>43</td> |
| 1528 |
<td>vte</td> |
| 1529 |
</tr> |
| 1530 |
</table> |
| 1531 |
|
| 1532 |
<p>I have continued to add features to xterm:</p> |
| 1533 |
|
| 1534 |
<ul> |
| 1535 |
<li> |
| 1536 |
<p>as of September 2013, it implemented 546 of 556 documented |
| 1537 |
controls</p> |
| 1538 |
</li> |
| 1539 |
|
| 1540 |
<li> |
| 1541 |
<p>as of October 2019, xterm implemented 713 of 723 |
| 1542 |
documented controls.</p> |
| 1543 |
</li> |
| 1544 |
</ul> |
| 1545 |
|
| 1546 |
<p>The other programs change far more slowly. As a result they |
| 1547 |
implement a smaller fraction of xterm's repertoire in 2019 than |
| 1548 |
in 2010. Even for cases where they implement a function, it may |
| 1549 |
not work properly (see for example the screenshot of VTE in the |
| 1550 |
<a href="/vttest/vttest-nrcs.html">vttest NRCS</a> examples).</p> |
| 1551 |
|
| 1552 |
<p>In summary, none of the other terminal emulators emulates |
| 1553 |
“most” of xterm. Instead, they implement the most |
| 1554 |
commonly-used control sequences, and there are differences |
| 1555 |
between them.</p> |
| 1556 |
|
| 1557 |
<h2 id="how_do_i-id"><a name="how_do_i" id="how_do_i">How do I |
| 1558 |
...</a></h2> |
| 1559 |
|
| 1560 |
<p>Not really problems, but frequently asked questions (the point |
| 1561 |
of this, after all):</p> |
| 1562 |
|
| 1563 |
<ul> |
| 1564 |
<li> |
| 1565 |
<p><a href="#how2_fsize">How do I change the font size?</a></p> |
| 1566 |
</li> |
| 1567 |
|
| 1568 |
<li> |
| 1569 |
<p><a href="#how2_print">How do I print the screen?</a></p> |
| 1570 |
</li> |
| 1571 |
|
| 1572 |
<li> |
| 1573 |
<p><a href="#how2_fkeys">How do I set up function keys?</a></p> |
| 1574 |
</li> |
| 1575 |
|
| 1576 |
<li> |
| 1577 |
<p><a href="#how2_title">How do I set the title?</a></p> |
| 1578 |
</li> |
| 1579 |
|
| 1580 |
<li> |
| 1581 |
<p><a href="#how2_blink">How do I make the cursor blink?</a></p> |
| 1582 |
</li> |
| 1583 |
</ul> |
| 1584 |
|
| 1585 |
<h3 id="how2_fsize-id"><a name="how2_fsize" id="how2_fsize">How |
| 1586 |
do I change the font size?</a></h3> |
| 1587 |
|
| 1588 |
<p><strong>XTerm</strong> uses fonts given as resource settings. |
| 1589 |
You can switch between these fonts at runtime, using a menu. This |
| 1590 |
is documented in the manpage, in the <a href= |
| 1591 |
"/xterm/manpage/xterm.html#h2-MENUS">MENUS</a> section.</p> |
| 1592 |
|
| 1593 |
<p>X Consortium xterm provides popup menus, by pressing the |
| 1594 |
control key together with the mouse button. Control right mouse |
| 1595 |
button pops up the <em>VT FONTS</em> menu, from which you can |
| 1596 |
select fonts that are specified in xterm's resources. Usually |
| 1597 |
these are in increasing order of size.</p> |
| 1598 |
|
| 1599 |
<p>Modern xterm provides the menu, plus a feature adapted from |
| 1600 |
rxvt: pressing the shifted keypad plus or minus keys steps |
| 1601 |
through the font menu selections, in order of their size.</p> |
| 1602 |
|
| 1603 |
<p><strong>XTerm</strong>'s manpage does not document the syntax |
| 1604 |
for X resources; it is done in the X documentation. If you are |
| 1605 |
instead asking about a <a href= |
| 1606 |
"xterm.faq.html#utf8_fonts">problem displaying a given font</a>, |
| 1607 |
it may be due to a problem with your resource settings.</p> |
| 1608 |
|
| 1609 |
<h3 id="how2_print-id"><a name="how2_print" id="how2_print">How |
| 1610 |
do I print the screen?</a></h3> |
| 1611 |
|
| 1612 |
<p>That depends on why you want to print it.</p> |
| 1613 |
|
| 1614 |
<h4 id="how2_print_trace">Tracing a session</h4> |
| 1615 |
|
| 1616 |
<p>If you want a trace of an interactive session, you should use |
| 1617 |
the <em>script</em> program. It records every character sent to |
| 1618 |
the screen, recording them in a file <code>typescript</code>. |
| 1619 |
There are two drawbacks to this approach:</p> |
| 1620 |
|
| 1621 |
<ul> |
| 1622 |
<li> |
| 1623 |
<p>Every character is recorded. Even cursor movement, if you |
| 1624 |
run an editor.</p> |
| 1625 |
</li> |
| 1626 |
|
| 1627 |
<li> |
| 1628 |
<p>You must start a new shell to capture the |
| 1629 |
<code>typescript</code> file.</p> |
| 1630 |
</li> |
| 1631 |
</ul> |
| 1632 |
|
| 1633 |
<h4 id="how2_print_logging">Logging a session</h4> |
| 1634 |
|
| 1635 |
<p>Well, what about logging? Some versions of xterm support |
| 1636 |
logging to a file. In fact modern xterm does. Logging was dropped |
| 1637 |
from X Consortium xterm during X11R5 due to security concerns. |
| 1638 |
Those were addressed, but logging was not reinstated (in fact |
| 1639 |
there is a related <a href="#bug_xterm_r6">bug</a> in xterm). |
| 1640 |
Some people prefer this, because it is convenient: you can start |
| 1641 |
and stop logging a popup menu entry. However</p> |
| 1642 |
|
| 1643 |
<ul> |
| 1644 |
<li> |
| 1645 |
<p>Every character is recorded. Even cursor movement, if you |
| 1646 |
run an editor.</p> |
| 1647 |
</li> |
| 1648 |
|
| 1649 |
<li> |
| 1650 |
<p>Line drawing characters are translated to control |
| 1651 |
characters, i.e., codes 0-31 (this may be fixed sometime, it |
| 1652 |
is a problem inherited from X Consortium xterm).</p> |
| 1653 |
</li> |
| 1654 |
</ul> |
| 1655 |
|
| 1656 |
<p>Both <em>script</em> and logging are useful for recording, but |
| 1657 |
they require interpretation to make sense of the trace. You |
| 1658 |
probably would not send that trace to a printer (not twice, |
| 1659 |
anyway).</p> |
| 1660 |
|
| 1661 |
<h4 id="how2_print_mediacopy">Printing the screen using control |
| 1662 |
sequences</h4> |
| 1663 |
|
| 1664 |
<p>If you want to print the contents of the screen, modern xterm |
| 1665 |
implements, as part of the VT100 emulation, an |
| 1666 |
“attached” printer (i.e., the <a href= |
| 1667 |
"/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps-i.1CA9"> |
| 1668 |
Media Copy</a> control sequences).</p> |
| 1669 |
|
| 1670 |
<ul> |
| 1671 |
<li> |
| 1672 |
<p>The printer is really a pipe command, to which xterm |
| 1673 |
writes.</p> |
| 1674 |
</li> |
| 1675 |
|
| 1676 |
<li> |
| 1677 |
<p>You can print the current line, page, or continuously with |
| 1678 |
the corresponding control sequences. That takes an |
| 1679 |
application program which knows how to print the screen.</p> |
| 1680 |
</li> |
| 1681 |
|
| 1682 |
<li> |
| 1683 |
<p>If you do not have an application, xterm has a popup menu |
| 1684 |
entry to print the window.</p> |
| 1685 |
</li> |
| 1686 |
</ul> |
| 1687 |
|
| 1688 |
<p>There are limitations and tradeoffs using the |
| 1689 |
“attached” printer, because it is an emulation:</p> |
| 1690 |
|
| 1691 |
<ul> |
| 1692 |
<li> |
| 1693 |
<p>The emulation is based on detailed documentation for a |
| 1694 |
VT320. This states that control sequences are sent in each |
| 1695 |
line to reset bold, underlining and other printable |
| 1696 |
attributes, and to set them as needed. Your printer probably |
| 1697 |
does not understand this sort of input. Use the xterm |
| 1698 |
resource <a href= |
| 1699 |
"/xterm/manpage/xterm.html#VT100-Widget-Resources:printAttributes"> |
| 1700 |
<code>printAttributes</code></a> to get more easily printed |
| 1701 |
output.</p> |
| 1702 |
</li> |
| 1703 |
|
| 1704 |
<li> |
| 1705 |
<p>The printer may hang. Not really, but it seems that way. |
| 1706 |
If you use the “attached” printer from an |
| 1707 |
application designed for the VT100 terminal, it is written |
| 1708 |
with the assumption that the printer is a dedicated piece of |
| 1709 |
hardware, printing onto a continuous form. Use the <a href= |
| 1710 |
"/xterm/manpage/xterm.html#VT100-Widget-Resources:printerAutoClose"> |
| 1711 |
<code>printerAutoClose</code></a> resource to change xterm's |
| 1712 |
behavior to close the printer pipe whenever the terminal is |
| 1713 |
told to switch the printer offline.</p> |
| 1714 |
</li> |
| 1715 |
</ul> |
| 1716 |
|
| 1717 |
<p>If you use the popup menu to print the screen, this will close |
| 1718 |
the printer pipe unless it was already opened by the application |
| 1719 |
running in xterm.</p> |
| 1720 |
|
| 1721 |
<h4 id="how2_print_screendump">Other types of screen dumps</h4> |
| 1722 |
|
| 1723 |
<p>Tracing, logging, copying the screen to a printer are all ways |
| 1724 |
to use the text from the screen.</p> |
| 1725 |
|
| 1726 |
<p>While the printer output contains video attributes in addition |
| 1727 |
to text, this is not what users might expect. It is also possible |
| 1728 |
to copy xterm's screen as a picture. The X window dump (<a href= |
| 1729 |
"https://www.x.org/archive/X11R7.5/doc/man/man1/xwd.1.html">xwd</a>) |
| 1730 |
and undump (<a href= |
| 1731 |
"https://www.x.org/archive/X11R7.5/doc/man/man1/xwud.1.html">xwud</a>) |
| 1732 |
utilities can do this. But one drawback of those is their |
| 1733 |
format:</p> |
| 1734 |
|
| 1735 |
<blockquote class="code-block"> |
| 1736 |
<p><em>Xwd</em> is an X Window System window dumping utility. |
| 1737 |
<em>Xwd</em> allows X users to store window images in a |
| 1738 |
<strong><em>specially formatted dump file</em></strong>. This |
| 1739 |
file can then be read by various other X utilities for |
| 1740 |
redisplay, printing, editing, formatting, archiving, image |
| 1741 |
processing, etc.</p> |
| 1742 |
</blockquote> |
| 1743 |
|
| 1744 |
<p>Alternatively, you can make screen dumps in XHTML or SVG |
| 1745 |
format, XTerm <a href="/xterm/xterm.log.html#xterm_323">patch |
| 1746 |
#323</a> added support for XHTML and SVG screen dumps to the Main |
| 1747 |
Options Menu. This optional feature is enabled by default since |
| 1748 |
<a href="/xterm/xterm.log.html#xterm_331">patch #331</a> in 2017. |
| 1749 |
Screen dumps may also be triggered by Media Copy control |
| 1750 |
sequences:</p> |
| 1751 |
|
| 1752 |
<ul> |
| 1753 |
<li><code>printf '\033[10i'</code> (<a href= |
| 1754 |
"/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps-i:Ps-=-1-0.1E59">XHTML</a>) |
| 1755 |
or</li> |
| 1756 |
|
| 1757 |
<li><code>printf '\033[11i'</code> (<a href= |
| 1758 |
"/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps-i:Ps-=-1-1.1E5A">SVG</a>).</li> |
| 1759 |
</ul> |
| 1760 |
|
| 1761 |
<h3 id="how2_fkeys-id"><a name="how2_fkeys" id="how2_fkeys">How |
| 1762 |
do I set up function keys?</a></h3> |
| 1763 |
|
| 1764 |
<p>With modern xterm, this is relatively simple. So I'll answer |
| 1765 |
that first.</p> |
| 1766 |
|
| 1767 |
<p>With X Consortium xterm, you had partial support for DEC VTxxx |
| 1768 |
function keys. Function keys F1 to F12 correspond to DEC's F1 to |
| 1769 |
F12 (sort of). Actually, DEC's VT220 terminals do not have codes |
| 1770 |
for F1 through F5. They are reserved for local functions. And the |
| 1771 |
VT220 (and up) terminals have 20 function keys. So you cannot do |
| 1772 |
anything with the F13 through F20 (i.e., DO, HELP and SELECT). |
| 1773 |
Finally, though xterm is reputed to be VT100-compatible, it has |
| 1774 |
no support for the VT100 keypad (PF1 to PF4, and the "," |
| 1775 |
key).</p> |
| 1776 |
|
| 1777 |
<p>Modern (XFree86) xterm changed the X Consortium codes for F1 |
| 1778 |
to F4 to match the VT100 PF1 to PF4, except when the emulation |
| 1779 |
level is VT220 and up. In this case, it generates the same F1 to |
| 1780 |
F4 codes as X Consortium xterm. Moreover, it adds a new resource |
| 1781 |
<code>sunKeyboard</code>, which tells the program whether it has |
| 1782 |
only 12 function keys (i.e., a Sun or PC keyboard). If so (this |
| 1783 |
is selectable from the popup menu), you can use the control key |
| 1784 |
with F1 to F12 to get F13 to F24, and use the "+" key on the |
| 1785 |
keypad as an alias for "," (comma).</p> |
| 1786 |
|
| 1787 |
<p>The emulation level for modern xterm is set via the resource |
| 1788 |
<code>decTerminalID</code>, e.g., to 220 for a VT220. Once set, |
| 1789 |
applications can set the emulation level up or down within that |
| 1790 |
limit. DEC's terminals are configured in much the same way by a |
| 1791 |
setup option.</p> |
| 1792 |
|
| 1793 |
<p>That is the simple way, using a couple of new resources. The |
| 1794 |
traditional way to get function keys involves translations. I |
| 1795 |
have seen a few postings on the newsgroups that do this. Here is |
| 1796 |
one from Bruce Momjian <[email protected]> for a |
| 1797 |
VT220:</p> |
| 1798 |
|
| 1799 |
<blockquote class="code-block"> |
| 1800 |
<!--{{atr2html--> |
| 1801 |
|
| 1802 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 1803 |
xterm <span class= |
| 1804 |
"ident2">$XTERMFLAGS</span> +rw +sb +ls <span class="ident2">$@</span> -tm <span class="literal">'erase ^? intr ^c'</span> \<br> |
| 1805 |
|
| 1806 |
-name vt220 -title vt220 -tn xterm-220 <span class="literal">"$@"</span> &<br> |
| 1807 |
|
| 1808 |
<!--atr2html}}--></p> |
| 1809 |
</blockquote> |
| 1810 |
|
| 1811 |
<p>with the corresponding resources:</p> |
| 1812 |
|
| 1813 |
<blockquote class="code-block"> |
| 1814 |
<!--{{atr2html--> |
| 1815 |
|
| 1816 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 1817 |
<span class="keyword">XTerm</span>*<span class= |
| 1818 |
"keyword">VT100</span>.<span class= |
| 1819 |
"ident2">translations</span>:<span class= |
| 1820 |
"literal"> #override \n\<br> |
| 1821 |
</span><span class="keyword"><Key></span><span class="literal">Home: string(</span><span class="number">0x1b</span><span class="literal">) string("[</span><span class="number">3</span><span class="literal">~") \n \<br> |
| 1822 |
|
| 1823 |
</span><span class="keyword"><Key></span><span class="literal">End: string(</span><span class="number">0x1b</span><span class="literal">) string("[</span><span class="number">4</span><span class="literal">~") \n</span><br> |
| 1824 |
|
| 1825 |
<span class="ident2">vt220</span>*<span class= |
| 1826 |
"keyword">VT100</span>.<span class= |
| 1827 |
"ident2">translations</span>:<span class= |
| 1828 |
"literal"> #override \n\<br> |
| 1829 |
~Shift </span><span class= |
| 1830 |
"keyword"><Key></span><span class= |
| 1831 |
"literal">F1: string(</span><span class= |
| 1832 |
"number">0x1b</span><span class= |
| 1833 |
"literal">) string("OP") \n \<br> |
| 1834 |
~Shift </span><span class= |
| 1835 |
"keyword"><Key></span><span class= |
| 1836 |
"literal">F2: string(</span><span class= |
| 1837 |
"number">0x1b</span><span class= |
| 1838 |
"literal">) string("OQ") \n \<br> |
| 1839 |
~Shift </span><span class= |
| 1840 |
"keyword"><Key></span><span class= |
| 1841 |
"literal">F3: string(</span><span class= |
| 1842 |
"number">0x1b</span><span class= |
| 1843 |
"literal">) string("OR") \n \<br> |
| 1844 |
~Shift </span><span class= |
| 1845 |
"keyword"><Key></span><span class= |
| 1846 |
"literal">F4: string(</span><span class= |
| 1847 |
"number">0x1b</span><span class= |
| 1848 |
"literal">) string("OS") \n \<br> |
| 1849 |
~Shift </span><span class= |
| 1850 |
"keyword"><Key></span><span class= |
| 1851 |
"literal">F5: string(</span><span class= |
| 1852 |
"number">0x1b</span><span class= |
| 1853 |
"literal">) string("[</span><span class= |
| 1854 |
"number">16</span><span class="literal">~") \n \<br> |
| 1855 |
~Shift </span><span class= |
| 1856 |
"keyword"><Key></span><span class= |
| 1857 |
"literal">F6: string(</span><span class= |
| 1858 |
"number">0x1b</span><span class= |
| 1859 |
"literal">) string("[</span><span class= |
| 1860 |
"number">17</span><span class="literal">~") \n \<br> |
| 1861 |
~Shift </span><span class= |
| 1862 |
"keyword"><Key></span><span class= |
| 1863 |
"literal">F7: string(</span><span class= |
| 1864 |
"number">0x1b</span><span class= |
| 1865 |
"literal">) string("[</span><span class= |
| 1866 |
"number">18</span><span class="literal">~") \n \<br> |
| 1867 |
~Shift </span><span class= |
| 1868 |
"keyword"><Key></span><span class= |
| 1869 |
"literal">F8: string(</span><span class= |
| 1870 |
"number">0x1b</span><span class= |
| 1871 |
"literal">) string("[</span><span class= |
| 1872 |
"number">19</span><span class="literal">~") \n \<br> |
| 1873 |
~Shift </span><span class= |
| 1874 |
"keyword"><Key></span><span class= |
| 1875 |
"literal">F9: string(</span><span class= |
| 1876 |
"number">0x1b</span><span class= |
| 1877 |
"literal">) string("[</span><span class= |
| 1878 |
"number">20</span><span class="literal">~") \n \<br> |
| 1879 |
~Shift </span><span class= |
| 1880 |
"keyword"><Key></span><span class= |
| 1881 |
"literal">F10: string(</span><span class= |
| 1882 |
"number">0x1b</span><span class= |
| 1883 |
"literal">) string("[</span><span class= |
| 1884 |
"number">21</span><span class="literal">~") \n \<br> |
| 1885 |
~Shift </span><span class= |
| 1886 |
"keyword"><Key></span><span class= |
| 1887 |
"literal">F11: string(</span><span class= |
| 1888 |
"number">0x1b</span><span class= |
| 1889 |
"literal">) string("[</span><span class= |
| 1890 |
"number">28</span><span class="literal">~") \n \<br> |
| 1891 |
~Shift </span><span class= |
| 1892 |
"keyword"><Key></span><span class= |
| 1893 |
"literal">F12: string(</span><span class= |
| 1894 |
"number">0x1b</span><span class= |
| 1895 |
"literal">) string("[</span><span class= |
| 1896 |
"number">29</span><span class="literal">~") \n \<br> |
| 1897 |
Shift </span><span class= |
| 1898 |
"keyword"><Key></span><span class= |
| 1899 |
"literal">F1: string(</span><span class= |
| 1900 |
"number">0x1b</span><span class= |
| 1901 |
"literal">) string("[</span><span class= |
| 1902 |
"number">23</span><span class="literal">~") \n \<br> |
| 1903 |
Shift </span><span class= |
| 1904 |
"keyword"><Key></span><span class= |
| 1905 |
"literal">F2: string(</span><span class= |
| 1906 |
"number">0x1b</span><span class= |
| 1907 |
"literal">) string("[</span><span class= |
| 1908 |
"number">24</span><span class="literal">~") \n \<br> |
| 1909 |
Shift </span><span class= |
| 1910 |
"keyword"><Key></span><span class= |
| 1911 |
"literal">F3: string(</span><span class= |
| 1912 |
"number">0x1b</span><span class= |
| 1913 |
"literal">) string("[</span><span class= |
| 1914 |
"number">25</span><span class="literal">~") \n \<br> |
| 1915 |
Shift </span><span class= |
| 1916 |
"keyword"><Key></span><span class= |
| 1917 |
"literal">F4: string(</span><span class= |
| 1918 |
"number">0x1b</span><span class= |
| 1919 |
"literal">) string("[</span><span class= |
| 1920 |
"number">26</span><span class="literal">~") \n \<br> |
| 1921 |
Shift </span><span class= |
| 1922 |
"keyword"><Key></span><span class= |
| 1923 |
"literal">F5: string(</span><span class= |
| 1924 |
"number">0x1b</span><span class= |
| 1925 |
"literal">) string("[K~") \n \<br> |
| 1926 |
Shift </span><span class= |
| 1927 |
"keyword"><Key></span><span class= |
| 1928 |
"literal">F6: string(</span><span class= |
| 1929 |
"number">0x1b</span><span class= |
| 1930 |
"literal">) string("[</span><span class= |
| 1931 |
"number">31</span><span class="literal">~") \n \<br> |
| 1932 |
Shift </span><span class= |
| 1933 |
"keyword"><Key></span><span class= |
| 1934 |
"literal">F7: string(</span><span class= |
| 1935 |
"number">0x1b</span><span class= |
| 1936 |
"literal">) string("[</span><span class= |
| 1937 |
"number">31</span><span class="literal">~") \n \<br> |
| 1938 |
Shift </span><span class= |
| 1939 |
"keyword"><Key></span><span class= |
| 1940 |
"literal">F8: string(</span><span class= |
| 1941 |
"number">0x1b</span><span class= |
| 1942 |
"literal">) string("[</span><span class= |
| 1943 |
"number">32</span><span class="literal">~") \n \<br> |
| 1944 |
Shift </span><span class= |
| 1945 |
"keyword"><Key></span><span class= |
| 1946 |
"literal">F9: string(</span><span class= |
| 1947 |
"number">0x1b</span><span class= |
| 1948 |
"literal">) string("[</span><span class= |
| 1949 |
"number">33</span><span class="literal">~") \n \<br> |
| 1950 |
Shift </span><span class= |
| 1951 |
"keyword"><Key></span><span class= |
| 1952 |
"literal">F10: string(</span><span class= |
| 1953 |
"number">0x1b</span><span class= |
| 1954 |
"literal">) string("[</span><span class= |
| 1955 |
"number">34</span><span class="literal">~") \n \<br> |
| 1956 |
Shift </span><span class= |
| 1957 |
"keyword"><Key></span><span class= |
| 1958 |
"literal">F11: string(</span><span class= |
| 1959 |
"number">0x1b</span><span class= |
| 1960 |
"literal">) string("[</span><span class= |
| 1961 |
"number">28</span><span class="literal">~") \n \<br> |
| 1962 |
Shift </span><span class= |
| 1963 |
"keyword"><Key></span><span class= |
| 1964 |
"literal">F12: string(</span><span class= |
| 1965 |
"number">0x1b</span><span class= |
| 1966 |
"literal">) string("[</span><span class= |
| 1967 |
"number">29</span><span class="literal">~") \n \<br> |
| 1968 |
</span><span class="keyword"><Key></span><span class="literal">Print: string(</span><span class="number">0x1b</span><span class="literal">) string("[</span><span class="number">32</span><span class="literal">~") \n\<br> |
| 1969 |
|
| 1970 |
</span><span class="keyword"><Key></span><span class="literal">Cancel: string(</span><span class="number">0x1b</span><span class="literal">) string("[</span><span class="number">33</span><span class="literal">~") \n\<br> |
| 1971 |
|
| 1972 |
</span><span class="keyword"><Key></span><span class="literal">Pause: string(</span><span class="number">0x1b</span><span class="literal">) string("[</span><span class="number">34</span><span class="literal">~") \n\<br> |
| 1973 |
|
| 1974 |
</span><span class="keyword"><Key></span><span class="literal">Insert: string(</span><span class="number">0x1b</span><span class="literal">) string("[</span><span class="number">2</span><span class="literal">~") \n\<br> |
| 1975 |
|
| 1976 |
</span><span class="keyword"><Key></span><span class="literal">Delete: string(</span><span class="number">0x1b</span><span class="literal">) string("[</span><span class="number">3</span><span class="literal">~") \n\<br> |
| 1977 |
|
| 1978 |
</span><span class="keyword"><Key></span><span class="literal">Home: string(</span><span class="number">0x1b</span><span class="literal">) string("[</span><span class="number">1</span><span class="literal">~") \n\<br> |
| 1979 |
|
| 1980 |
</span><span class="keyword"><Key></span><span class="literal">End: string(</span><span class="number">0x1b</span><span class="literal">) string("[</span><span class="number">4</span><span class="literal">~") \n\<br> |
| 1981 |
|
| 1982 |
</span><span class="keyword"><Key></span><span class="literal">Prior: string(</span><span class="number">0x1b</span><span class="literal">) string("[</span><span class="number">5</span><span class="literal">~") \n\<br> |
| 1983 |
|
| 1984 |
</span><span class="keyword"><Key></span><span class="literal">Next: string(</span><span class="number">0x1b</span><span class="literal">) string("[</span><span class="number">6</span><span class="literal">~") \n\<br> |
| 1985 |
|
| 1986 |
</span><span class="keyword"><Key></span><span class="literal">BackSpace: string(</span><span class="number">0x7f</span><span class="literal">) \n\<br> |
| 1987 |
|
| 1988 |
</span><span class="keyword"><Key></span><span class="literal">Num_Lock: string(</span><span class="number">0x1b</span><span class="literal">) string("OP") \n\<br> |
| 1989 |
|
| 1990 |
</span><span class="keyword"><Key></span><span class="literal">KP_Divide: string(</span><span class="number">0x1b</span><span class="literal">) string("Ol") \n\<br> |
| 1991 |
|
| 1992 |
</span><span class="keyword"><Key></span><span class="literal">KP_Multiply: string(</span><span class="number">0x1b</span><span class="literal">) string("Om") \n\<br> |
| 1993 |
|
| 1994 |
</span><span class="keyword"><Key></span><span class="literal">KP_Subtract: string(</span><span class="number">0x1b</span><span class="literal">) string("OS") \n\<br> |
| 1995 |
|
| 1996 |
</span><span class="keyword"><Key></span><span class="literal">KP_Add: string(</span><span class="number">0x1b</span><span class="literal">) string("OM") \n\<br> |
| 1997 |
|
| 1998 |
</span><span class="keyword"><Key></span><span class="literal">KP_Enter: string(</span><span class="number">0x1b</span><span class="literal">) string("OM") \n\<br> |
| 1999 |
|
| 2000 |
</span><span class="keyword"><Key></span><span class="literal">KP_Decimal: string(</span><span class="number">0x1b</span><span class="literal">) string("On") \n\<br> |
| 2001 |
|
| 2002 |
</span><span class="keyword"><Key></span><span class="literal">KP_0: string(</span><span class="number">0x1b</span><span class="literal">) string("Op") \n\<br> |
| 2003 |
|
| 2004 |
</span><span class="keyword"><Key></span><span class="literal">KP_1: string(</span><span class="number">0x1b</span><span class="literal">) string("Oq") \n\<br> |
| 2005 |
|
| 2006 |
</span><span class="keyword"><Key></span><span class="literal">KP_2: string(</span><span class="number">0x1b</span><span class="literal">) string("Or") \n\<br> |
| 2007 |
|
| 2008 |
</span><span class="keyword"><Key></span><span class="literal">KP_3: string(</span><span class="number">0x1b</span><span class="literal">) string("Os") \n\<br> |
| 2009 |
|
| 2010 |
</span><span class="keyword"><Key></span><span class="literal">KP_4: string(</span><span class="number">0x1b</span><span class="literal">) string("Ot") \n\<br> |
| 2011 |
|
| 2012 |
</span><span class="keyword"><Key></span><span class="literal">KP_5: string(</span><span class="number">0x1b</span><span class="literal">) string("Ou") \n\<br> |
| 2013 |
|
| 2014 |
</span><span class="keyword"><Key></span><span class="literal">KP_6: string(</span><span class="number">0x1b</span><span class="literal">) string("Ov") \n\<br> |
| 2015 |
|
| 2016 |
</span><span class="keyword"><Key></span><span class="literal">KP_7: string(</span><span class="number">0x1b</span><span class="literal">) string("Ow") \n\<br> |
| 2017 |
|
| 2018 |
</span><span class="keyword"><Key></span><span class="literal">KP_8: string(</span><span class="number">0x1b</span><span class="literal">) string("Ox") \n\<br> |
| 2019 |
|
| 2020 |
</span><span class="keyword"><Key></span><span class="literal">KP_9: string(</span><span class="number">0x1b</span><span class="literal">) string("Oy") \n</span><br> |
| 2021 |
|
| 2022 |
<br> |
| 2023 |
<span class= |
| 2024 |
"comment">! <Key>Up: string(0x1b) string("[A") \n\<br> |
| 2025 |
</span> <span class= |
| 2026 |
"comment">! <Key>Down: string(0x1b) string("[B") \n\<br> |
| 2027 |
</span> <span class= |
| 2028 |
"comment">! <Key>Right: string(0x1b) string("[C") \n\<br> |
| 2029 |
</span> <span class= |
| 2030 |
"comment">! <Key>Left: string(0x1b) string("[D") \n\<br> |
| 2031 |
</span> <br> |
| 2032 |
*<span class="ident2">visualBell</span>:<span class= |
| 2033 |
"literal"> </span><span class= |
| 2034 |
"keyword">true</span><br> |
| 2035 |
*<span class="ident2">saveLines</span>:<span class= |
| 2036 |
"literal"> </span><span class= |
| 2037 |
"number">1000</span><br> |
| 2038 |
*<span class="ident2">cursesemul</span>:<span class= |
| 2039 |
"literal"> </span><span class= |
| 2040 |
"keyword">true</span><br> |
| 2041 |
*<span class="ident2">scrollKey</span>:<span class= |
| 2042 |
"literal"> </span><span class="keyword">true</span><br> |
| 2043 |
*<span class="ident2">scrollBar</span>:<span class= |
| 2044 |
"literal"> </span><span class="keyword">true</span><br> |
| 2045 |
<!--atr2html}}--></p> |
| 2046 |
</blockquote> |
| 2047 |
|
| 2048 |
<p>Note that real VT220 terminals use shifted function keys to |
| 2049 |
mean something different: the user-programmable keys (i.e., |
| 2050 |
DECUDK). Modern xterm supports this, but the translations do not |
| 2051 |
(they're using shift to select F13 to F20).</p> |
| 2052 |
|
| 2053 |
<p>Here's another one, from Robert Ess |
| 2054 |
<[email protected]>:</p> |
| 2055 |
|
| 2056 |
<blockquote class="code-block"> |
| 2057 |
<!--{{atr2html--> |
| 2058 |
|
| 2059 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 2060 |
<span class="comment">#!/bin/sh</span><br> |
| 2061 |
<br> |
| 2062 |
<span class= |
| 2063 |
"comment"># vax</span><br> |
| 2064 |
|
| 2065 |
<span class= |
| 2066 |
"comment"># 09-17-96 Bob Ess - initial creation</span><br> |
| 2067 |
|
| 2068 |
<span class= |
| 2069 |
"comment"># 09-26-96 Shig Katada - Additional keybindings</span><br> |
| 2070 |
|
| 2071 |
<span class="comment">#</span><br> |
| 2072 |
<span class= |
| 2073 |
"comment"># Script file to incorporate keybindings and command line</span><br> |
| 2074 |
|
| 2075 |
<span class= |
| 2076 |
"comment"># options for connecting to a VAX node</span><br> |
| 2077 |
|
| 2078 |
<br> |
| 2079 |
<span class="comment"># Usage statement</span><br> |
| 2080 |
Usage()<span class="keyword2">{</span><br> |
| 2081 |
<span class= |
| 2082 |
"keyword">echo</span><br> |
| 2083 |
<span class= |
| 2084 |
"keyword">echo</span> <span class= |
| 2085 |
"literal">" Usage : vax -options"</span><br> |
| 2086 |
|
| 2087 |
<span class= |
| 2088 |
"keyword">echo</span><br> |
| 2089 |
<span class= |
| 2090 |
"keyword">echo</span> <span class= |
| 2091 |
"literal">" Options: -80 for 80 column terminal"</span><br> |
| 2092 |
|
| 2093 |
<span class= |
| 2094 |
"keyword">echo</span> <span class= |
| 2095 |
"literal">" -132 for 132 column terminal"</span><br> |
| 2096 |
|
| 2097 |
<span class= |
| 2098 |
"keyword">echo</span> <span class= |
| 2099 |
"literal">" -fg colorname"</span><br> |
| 2100 |
|
| 2101 |
<span class= |
| 2102 |
"keyword">echo</span> <span class= |
| 2103 |
"literal">" -bg colorname"</span><br> |
| 2104 |
|
| 2105 |
<span class= |
| 2106 |
"keyword">echo</span> <span class= |
| 2107 |
"literal">" -fn fontname"</span><br> |
| 2108 |
|
| 2109 |
<span class= |
| 2110 |
"keyword">echo</span> <span class= |
| 2111 |
"literal">" -fb bold fontname"</span><br> |
| 2112 |
|
| 2113 |
<span class= |
| 2114 |
"keyword">echo</span> <span class= |
| 2115 |
"literal">" -host [altair] [devel] [leonis] [castor]"</span><br> |
| 2116 |
|
| 2117 |
<span class= |
| 2118 |
"keyword">echo</span> <span class="literal">""</span><br> |
| 2119 |
<span class= |
| 2120 |
"keyword">echo</span> <span class= |
| 2121 |
"literal">" Example: </span><span class= |
| 2122 |
"keyword2">\</span><span class= |
| 2123 |
"literal">"vax -80 -fg white -bg black -fn 9x15 -fb 9x15b -host castor</span><span class="keyword2">\</span><span class="literal">""</span><br> |
| 2124 |
|
| 2125 |
<span class= |
| 2126 |
"keyword">echo</span> <span class= |
| 2127 |
"literal">" Starts a VAX session with an 80 column terminal"</span><br> |
| 2128 |
|
| 2129 |
<span class= |
| 2130 |
"keyword">echo</span> <span class= |
| 2131 |
"literal">" with a black background, white foreground, a normal"</span><br> |
| 2132 |
|
| 2133 |
<span class= |
| 2134 |
"keyword">echo</span> <span class= |
| 2135 |
"literal">" font of 9x15 and a bold font of 9x15b, and connects"</span><br> |
| 2136 |
|
| 2137 |
<span class= |
| 2138 |
"keyword">echo</span> <span class= |
| 2139 |
"literal">" to the node 'castor'"</span><br> |
| 2140 |
|
| 2141 |
<span class= |
| 2142 |
"keyword">echo</span><br> |
| 2143 |
<span class= |
| 2144 |
"keyword">echo</span> <span class= |
| 2145 |
"literal">" If you need additional help, please call Workstation"</span><br> |
| 2146 |
|
| 2147 |
<span class= |
| 2148 |
"keyword">echo</span> <span class= |
| 2149 |
"literal">" Services at x92396."</span><br> |
| 2150 |
|
| 2151 |
<span class= |
| 2152 |
"keyword">echo</span><br> |
| 2153 |
<span class= |
| 2154 |
"keyword">exit</span> <span class="number">1</span><br> |
| 2155 |
<span class="keyword2">}</span><br> |
| 2156 |
<br> |
| 2157 |
<span class= |
| 2158 |
"comment"># Default to a black foreground with a white background.</span><br> |
| 2159 |
|
| 2160 |
<span class= |
| 2161 |
"comment"># Use the 9x15 and 9x15bold fonts. Connect to castor by default.</span><br> |
| 2162 |
|
| 2163 |
<span class="comment">#</span><br> |
| 2164 |
<span class="ident2">FG</span>=black<br> |
| 2165 |
<span class="ident2">BG</span>=white<br> |
| 2166 |
<span class="ident2">HOST</span>=castor<br> |
| 2167 |
<span class="ident2">FONT</span>=<span class= |
| 2168 |
"number">9</span>x15<br> |
| 2169 |
<span class="ident2">BFONT</span>=<span class= |
| 2170 |
"number">9</span>x15bold<br> |
| 2171 |
<span class="ident2">COLS</span>=<span class= |
| 2172 |
"number">80</span><br> |
| 2173 |
<br> |
| 2174 |
<span class= |
| 2175 |
"comment"># Parse the command line arguments</span><br> |
| 2176 |
|
| 2177 |
<span class="comment">#</span><br> |
| 2178 |
<span class="keyword">while</span> [ <span class= |
| 2179 |
"ident2">$#</span> != <span class= |
| 2180 |
"number">0</span> ];<br> |
| 2181 |
<span class="keyword">do</span><br> |
| 2182 |
<span class= |
| 2183 |
"keyword">case</span> <span class= |
| 2184 |
"ident2">$1</span> <span class="keyword">in</span><br> |
| 2185 |
<span class="number">-80</span>) <span class="ident2">COLS</span>=<span class="number">80</span><br> |
| 2186 |
|
| 2187 |
<span class="ident2">FONT</span>=spc12x24c<br> |
| 2188 |
|
| 2189 |
<span class="ident2">BFONT</span>=spc12x24b<br> |
| 2190 |
|
| 2191 |
<span class="keyword">shift</span><br> |
| 2192 |
|
| 2193 |
;;<br> |
| 2194 |
|
| 2195 |
<span class="number">-132</span>) <span class="ident2">COLS</span>=<span class="number">132</span><br> |
| 2196 |
|
| 2197 |
<span class="ident2">FONT</span>=<span class="number">9</span>x15<br> |
| 2198 |
|
| 2199 |
<span class="ident2">BFONT</span>=<span class="number">9</span>x15b<br> |
| 2200 |
|
| 2201 |
<span class="keyword">shift</span><br> |
| 2202 |
|
| 2203 |
;;<br> |
| 2204 |
|
| 2205 |
-fg) <span class="keyword">shift</span><br> |
| 2206 |
|
| 2207 |
<span class="ident2">FG</span>=<span class="ident2">$1</span><br> |
| 2208 |
|
| 2209 |
<span class="keyword">shift</span>;;<br> |
| 2210 |
|
| 2211 |
-bg) <span class="keyword">shift</span><br> |
| 2212 |
|
| 2213 |
<span class="ident2">BG</span>=<span class="ident2">$1</span><br> |
| 2214 |
|
| 2215 |
<span class="keyword">shift</span>;;<br> |
| 2216 |
|
| 2217 |
-fn) <span class="keyword">shift</span><br> |
| 2218 |
|
| 2219 |
<span class="ident2">FONT</span>=<span class="ident2">$1</span><br> |
| 2220 |
|
| 2221 |
<span class="keyword">shift</span>;;<br> |
| 2222 |
|
| 2223 |
-fb) <span class="keyword">shift</span><br> |
| 2224 |
|
| 2225 |
<span class="ident2">BFONT</span>=<span class="ident2">$1</span><br> |
| 2226 |
|
| 2227 |
<span class="keyword">shift</span>;;<br> |
| 2228 |
|
| 2229 |
-host) <span class="keyword">shift</span><br> |
| 2230 |
|
| 2231 |
<span class="ident2">HOST</span>=<span class="ident2">$1</span><br> |
| 2232 |
|
| 2233 |
<span class="keyword">shift</span>;;<br> |
| 2234 |
|
| 2235 |
-help) Usage;;<br> |
| 2236 |
|
| 2237 |
*) Usage;;<br> |
| 2238 |
|
| 2239 |
<span class= |
| 2240 |
"keyword">esac</span><br> |
| 2241 |
<span class="keyword">done</span><br> |
| 2242 |
<br> |
| 2243 |
xterm -title <span class= |
| 2244 |
"literal">"VAX"</span> -sb -sl <span class= |
| 2245 |
"number">1200</span> -geo <span class= |
| 2246 |
"ident2">${COLS}</span>x24 -fg <span class= |
| 2247 |
"ident2">${FG}</span> -bg <span class= |
| 2248 |
"ident2">${BG}</span> \<br> |
| 2249 |
-cr red -fn <span class="ident2">${FONT}</span> -fb <span class="ident2">${BFONT}</span> -xrm \<br> |
| 2250 |
|
| 2251 |
<span class= |
| 2252 |
"literal">'XTerm*VT100.translations: #override \n\<br> |
| 2253 |
|
| 2254 |
<Key>Insert: string(\001) \n\<br> |
| 2255 |
|
| 2256 |
Shift <Key>Up: scroll-back(1,lines) \n\<br> |
| 2257 |
|
| 2258 |
Shift <Key>Down: scroll-forw(1,lines) \n\<br> |
| 2259 |
|
| 2260 |
Shift <Key>Right: string(0x1b) string("f") \n\<br> |
| 2261 |
|
| 2262 |
Shift <Key>Left: string(0x1b) string("b") \n\<br> |
| 2263 |
|
| 2264 |
Shift <Key>Delete: string(0x1b) string(0x08) \n\<br> |
| 2265 |
|
| 2266 |
Shift <Key>Tab: string(0x1b) string("*") \n\<br> |
| 2267 |
|
| 2268 |
<Key>0x1000FF0D: scroll-back(1,page) \n\<br> |
| 2269 |
|
| 2270 |
<Key>0x1000FF0E: scroll-forw(1,page) \n\<br> |
| 2271 |
|
| 2272 |
<Key>0x1000FF09: string(\010) \n\<br> |
| 2273 |
|
| 2274 |
<Key>0x1000FF0A: string(\005) \n\<br> |
| 2275 |
|
| 2276 |
<Key>BackSpace: string(0xff) \n\<br> |
| 2277 |
|
| 2278 |
<Key>Select: select-start() \n\<br> |
| 2279 |
|
| 2280 |
<Key>0x1000FF02: select-end(PRIMARY,CUT_BUFFER0) \n\<br> |
| 2281 |
|
| 2282 |
Meta <Key>0x1000FF02: select-end(CLIPBOARD) \n\<br> |
| 2283 |
|
| 2284 |
<Key>0x1000FF04: insert-selection(PRIMARY,CUT_BUFFER0) \n\<br> |
| 2285 |
|
| 2286 |
Meta <Key>0x1000FF04: insert-selection(CLIPBOARD) \n\<br> |
| 2287 |
|
| 2288 |
<Key>F1: string(0x1b) string("OP") \n\<br> |
| 2289 |
|
| 2290 |
<Key>F2: string(0x1b) string("OQ") \n\<br> |
| 2291 |
|
| 2292 |
<Key>F3: string(0x1b) string("OR") \n\<br> |
| 2293 |
|
| 2294 |
<Key>F4: string(0x1b) string("OS") \n\<br> |
| 2295 |
|
| 2296 |
<Key>F5: string(0x1b) string("OA") \n\<br> |
| 2297 |
|
| 2298 |
<Key>F11: string(0x1b) string("[23~") \n\<br> |
| 2299 |
|
| 2300 |
<Key>F12: string(0x1b) string("[24~") \n\<br> |
| 2301 |
|
| 2302 |
<Key>KP_0: string(0x1b) string("Op") \n\<br> |
| 2303 |
|
| 2304 |
<Key>KP_1: string(0x1b) string("Oq") \n\<br> |
| 2305 |
|
| 2306 |
<Key>KP_2: string(0x1b) string("Or") \n\<br> |
| 2307 |
|
| 2308 |
<Key>KP_3: string(0x1b) string("Os") \n\<br> |
| 2309 |
|
| 2310 |
<Key>KP_4: string(0x1b) string("Ot") \n\<br> |
| 2311 |
|
| 2312 |
<Key>KP_5: string(0x1b) string("Ou") \n\<br> |
| 2313 |
|
| 2314 |
<Key>KP_Divide: string(0x1b) string("OP") \n\<br> |
| 2315 |
|
| 2316 |
<Key>KP_Multiply: string(0x1b) string("[29~") \n\<br> |
| 2317 |
|
| 2318 |
<Key>KP_Enter: string(0x1b) string("OM") \n\<br> |
| 2319 |
|
| 2320 |
<Key>KP_Subtract: string(0x1b) string("Om") \n\<br> |
| 2321 |
|
| 2322 |
<Key>KP_Add: string(0x1b) string("Ol") \n\<br> |
| 2323 |
|
| 2324 |
<Key>KP_Decimal: string(0x1b) string("On") \n\<br> |
| 2325 |
|
| 2326 |
<Btn1Down>: select-start() \n\<br> |
| 2327 |
|
| 2328 |
<Btn1Motion>: select-extend() \n\<br> |
| 2329 |
|
| 2330 |
<Btn1Up>: select-end(PRIMARY,CUT_BUFFER0) \n\<br> |
| 2331 |
|
| 2332 |
Button1<Btn2Down>: select-end(CLIPBOARD) \n\<br> |
| 2333 |
|
| 2334 |
Button1<Btn2Up>: ignore()'</span> \<br> |
| 2335 |
|
| 2336 |
-e telnet <span class="ident2">$HOST</span> &<br> |
| 2337 |
|
| 2338 |
<!--atr2html}}--></p> |
| 2339 |
</blockquote> |
| 2340 |
|
| 2341 |
<p>Finally (for the moment) is a further modification of Robert |
| 2342 |
Ess's script by <a href= |
| 2343 |
"https://web.archive.org/web/20110411233005/http://www-personal.une.edu.au/~oahlefel/vmsterm.htm"> |
| 2344 |
Erik Ahlefeldt</a>, <[email protected]>. From his |
| 2345 |
readme file, for vmsterm:</p> |
| 2346 |
|
| 2347 |
<blockquote> |
| 2348 |
<p>This script is for people who wish to connect from a Linux |
| 2349 |
or Unix computer to a VMS computer using telnet and get a good |
| 2350 |
VT100 or VT220 emulation. The key mappings have been |
| 2351 |
specifically designed to emulate the VT terminal auxiliary |
| 2352 |
numeric keypad, so that you can use VMS EDT and TPU editors, as |
| 2353 |
well as the many VMS applications use keys PF1 to PF4. The |
| 2354 |
script should work with any recent version of Xterm using a |
| 2355 |
standard extended IBM PC keyboard or a Sun keyboard.</p> |
| 2356 |
|
| 2357 |
<p>About the keymappings. First the auxiliary numeric keypad. |
| 2358 |
My prime objective with these mappings was to produce a setup |
| 2359 |
that I could use with the EDT and TPU editors which make |
| 2360 |
extensive use of the numeric keypad. The top row of keys PC |
| 2361 |
numeric keypad (Num Lock, Divide, Multiply, Subtract) are where |
| 2362 |
you find PF1, PF2, PF3, PF4 on a VT keyboard, so I have mapped |
| 2363 |
them to PF1 thru PF4. The PC numeric keypad Add key (+) takes |
| 2364 |
up the space of two keys which are Minus and Comma on the VT |
| 2365 |
keyboard – I have mapped it to Comma (Delete Character in |
| 2366 |
the EDT editor). I have then used the PC Pause key to map to VT |
| 2367 |
key Minus (Delete Word in the EDT editor). The remaining keys |
| 2368 |
on the auxiliary numeric keypad are the same for PC and VT.</p> |
| 2369 |
|
| 2370 |
<p>The six keys between the main and numeric keypads on the PC |
| 2371 |
(Insert, Home, Page Up, Delete End, Page Down) are usually |
| 2372 |
mapped to the VT keys by either position or by (approximate) |
| 2373 |
function. As I rarely use these keys I have mapped them by |
| 2374 |
function as follows: PC key Insert to VT Insert Here, PC Home |
| 2375 |
to VT Find, PC Page Up to VT Prev, PC Delete to VT Remove, PC |
| 2376 |
End to VT Select, PC Page Down to VT Next.</p> |
| 2377 |
|
| 2378 |
<dl> |
| 2379 |
<dt>Function keys.</dt> |
| 2380 |
|
| 2381 |
<dd> |
| 2382 |
There are 12 function keys on the PC keyboard and 20 on the |
| 2383 |
VT keyboard, so I map PC F1 thru F12 to VT F1 thru F12 |
| 2384 |
(except for F1 thru F5 as noted below) and PC Shift F1 thru |
| 2385 |
Shift F10 to VT F11 thru F20. |
| 2386 |
<p>The VT keys F1 thru F5 are local hardware function keys |
| 2387 |
so there is nothing to emulate, however some PC to VT |
| 2388 |
emulations in the past have mapped PF1 thru PF4 here, so I |
| 2389 |
have done that too, even though they are already mapped on |
| 2390 |
the auxiliary numeric keypad.</p> |
| 2391 |
</dd> |
| 2392 |
|
| 2393 |
<dt>Xterm functionality.</dt> |
| 2394 |
|
| 2395 |
<dd>You lose some xterm functions when you remap the |
| 2396 |
keyboard, however this script implements a scroll back buffer |
| 2397 |
of 1000 lines which you scroll through using Shift and Up |
| 2398 |
(a.k.a. Up Arrow or Cursor Up key) or Shift and Down.</dd> |
| 2399 |
</dl> |
| 2400 |
</blockquote> |
| 2401 |
|
| 2402 |
<p>a summary of the keyboard mapping:</p> |
| 2403 |
|
| 2404 |
<blockquote> |
| 2405 |
<pre class="code-block"> |
| 2406 |
PC Key maps to VT Key. |
| 2407 |
------ ------ |
| 2408 |
F1 PF1 |
| 2409 |
F2 PF2 |
| 2410 |
F3 PF3 |
| 2411 |
F4 PF4 |
| 2412 |
F5 unused |
| 2413 |
F6 F6 |
| 2414 |
F7 F7 |
| 2415 |
F8 F8 |
| 2416 |
F9 F9 |
| 2417 |
F10 F10 |
| 2418 |
F11 F11 |
| 2419 |
F12 F12 |
| 2420 |
Shift F1 F11 |
| 2421 |
Shift F2 F12 |
| 2422 |
Shift F3 F13 |
| 2423 |
Shift F4 F14 |
| 2424 |
Shift F5 F15 (Help) |
| 2425 |
Shift F6 F16 (Do) |
| 2426 |
Shift F7 F17 |
| 2427 |
Shift F8 F18 |
| 2428 |
Shift F9 F19 |
| 2429 |
Shift F10 F20 |
| 2430 |
Shift F11 F11 |
| 2431 |
Shift F12 F12 |
| 2432 |
Print Help (F15) |
| 2433 |
Cancel Do (F16) |
| 2434 |
Pause Keypad Minus |
| 2435 |
|
| 2436 |
Insert Insert Here |
| 2437 |
Delete Remove |
| 2438 |
Home Find |
| 2439 |
End Select |
| 2440 |
Prior Prev |
| 2441 |
Next Next |
| 2442 |
BackSpace BackSpace (sends DEL - ascii 127) |
| 2443 |
|
| 2444 |
Num_Lock PF1 |
| 2445 |
KP_Divide PF2 |
| 2446 |
KP_Multiply PF3 |
| 2447 |
KP_Subtract PF4 |
| 2448 |
KP_Add Keypad Comma |
| 2449 |
KP_Enter Enter |
| 2450 |
KP_Decimal Period |
| 2451 |
KP_0 Keypad 0 |
| 2452 |
KP_1 Keypad 1 |
| 2453 |
KP_2 Keypad 2 |
| 2454 |
KP_3 Keypad 3 |
| 2455 |
KP_4 Keypad 4 |
| 2456 |
KP_5 Keypad 5 |
| 2457 |
KP_6 Keypad 6 |
| 2458 |
KP_7 Keypad 7 |
| 2459 |
KP_8 Keypad 8 |
| 2460 |
KP_9 Keypad 9 |
| 2461 |
Up Up |
| 2462 |
Shift Up Scroll Back |
| 2463 |
Down Down |
| 2464 |
Shift Down Scroll Forward |
| 2465 |
Right Right |
| 2466 |
Left Left |
| 2467 |
</pre> |
| 2468 |
</blockquote> |
| 2469 |
|
| 2470 |
<p>and the script:</p> |
| 2471 |
|
| 2472 |
<blockquote class="code-block"> |
| 2473 |
<!--{{atr2html--> |
| 2474 |
|
| 2475 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 2476 |
<span class="comment">#!/bin/sh</span><br> |
| 2477 |
<span class= |
| 2478 |
"comment"># vmsterm</span><br> |
| 2479 |
|
| 2480 |
<span class= |
| 2481 |
"comment"># from an original script by Bob Ess</span><br> |
| 2482 |
|
| 2483 |
<span class= |
| 2484 |
"comment"># key translations by Erik Ahlefeldt </span><br> |
| 2485 |
|
| 2486 |
<span class="comment">#</span><br> |
| 2487 |
<span class= |
| 2488 |
"comment"># Script file using Xterm and telnet to connect to a VMS host</span><br> |
| 2489 |
|
| 2490 |
<span class= |
| 2491 |
"comment"># and give a decent vt220 emulation.</span><br> |
| 2492 |
|
| 2493 |
<span class="comment">#</span><br> |
| 2494 |
<span class="comment"># Usage statement</span><br> |
| 2495 |
Usage()<strong><em><span class= |
| 2496 |
"comment">{</span></em></strong><br> |
| 2497 |
<span class= |
| 2498 |
"keyword">echo</span><br> |
| 2499 |
<span class= |
| 2500 |
"keyword">echo</span> <span class= |
| 2501 |
"literal">" Usage : vmsterm -options"</span><br> |
| 2502 |
|
| 2503 |
<span class= |
| 2504 |
"keyword">echo</span><br> |
| 2505 |
<span class= |
| 2506 |
"keyword">echo</span> <span class= |
| 2507 |
"literal">" Options: -80 for 80 column terminal"</span><br> |
| 2508 |
|
| 2509 |
<span class= |
| 2510 |
"keyword">echo</span> <span class= |
| 2511 |
"literal">" -132 for 132 column terminal"</span><br> |
| 2512 |
|
| 2513 |
<span class= |
| 2514 |
"keyword">echo</span> <span class= |
| 2515 |
"literal">" -bg colorname"</span><br> |
| 2516 |
|
| 2517 |
<span class= |
| 2518 |
"keyword">echo</span> <span class= |
| 2519 |
"literal">" -fg colorname"</span><br> |
| 2520 |
|
| 2521 |
<span class= |
| 2522 |
"keyword">echo</span> <span class= |
| 2523 |
"literal">" -fn fontname"</span><br> |
| 2524 |
|
| 2525 |
<span class= |
| 2526 |
"keyword">echo</span> <span class= |
| 2527 |
"literal">" -fb bold fontname"</span><br> |
| 2528 |
|
| 2529 |
<span class= |
| 2530 |
"keyword">echo</span> <span class= |
| 2531 |
"literal">" -host [crusher.saltmine.com] [earth] [192.168.7.7]"</span> <br> |
| 2532 |
|
| 2533 |
<span class= |
| 2534 |
"keyword">echo</span> <span class="literal">""</span><br> |
| 2535 |
<span class= |
| 2536 |
"keyword">echo</span> <span class= |
| 2537 |
"literal">" Example: </span><strong><em><span class= |
| 2538 |
"comment">\</span></em></strong><span class= |
| 2539 |
"literal">"vmsterm -80 -fg white -bg black -fn 9x15 -fb 9x15b -host earth</span><strong><em><span class="comment">\</span></em></strong><span class="literal">""</span><br> |
| 2540 |
|
| 2541 |
<span class= |
| 2542 |
"keyword">echo</span> <span class= |
| 2543 |
"literal">" Starts a VMS session with an 80 column terminal"</span><br> |
| 2544 |
|
| 2545 |
<span class= |
| 2546 |
"keyword">echo</span> <span class= |
| 2547 |
"literal">" with a black background, white foreground, a normal"</span><br> |
| 2548 |
|
| 2549 |
<span class= |
| 2550 |
"keyword">echo</span> <span class= |
| 2551 |
"literal">" font of 9x15 and a bold font of 9x15b, and connects"</span><br> |
| 2552 |
|
| 2553 |
<span class= |
| 2554 |
"keyword">echo</span> <span class= |
| 2555 |
"literal">" to the node 'earth'"</span><br> |
| 2556 |
|
| 2557 |
<span class= |
| 2558 |
"keyword">echo</span> <span class="literal">""</span><br> |
| 2559 |
<span class= |
| 2560 |
"keyword">echo</span> <span class= |
| 2561 |
"literal">" Example: </span><strong><em><span class= |
| 2562 |
"comment">\</span></em></strong><span class= |
| 2563 |
"literal">"vmsterm -host earth</span><strong><em><span class="comment">\</span></em></strong><span class="literal">""</span><br> |
| 2564 |
|
| 2565 |
<span class= |
| 2566 |
"keyword">echo</span> <span class= |
| 2567 |
"literal">" Starts a VMS session with default terminal settings "</span><br> |
| 2568 |
|
| 2569 |
<span class= |
| 2570 |
"keyword">echo</span> <span class="literal">""</span><br> |
| 2571 |
<span class= |
| 2572 |
"keyword">echo</span> <span class= |
| 2573 |
"literal">" Example: </span><strong><em><span class= |
| 2574 |
"comment">\</span></em></strong><span class= |
| 2575 |
"literal">"vmsterm -help</span><strong><em><span class= |
| 2576 |
"comment">\</span></em></strong><span class= |
| 2577 |
"literal">""</span><br> |
| 2578 |
<span class= |
| 2579 |
"keyword">echo</span> <span class= |
| 2580 |
"literal">" Displays vmsterm options "</span><br> |
| 2581 |
|
| 2582 |
<span class= |
| 2583 |
"keyword">echo</span><br> |
| 2584 |
<span class= |
| 2585 |
"keyword">exit</span> <span class="number">1</span><br> |
| 2586 |
<strong><em><span class="comment">}</span></em></strong><br> |
| 2587 |
<br> |
| 2588 |
<span class= |
| 2589 |
"comment"># Default to a black foreground with a white background.</span><br> |
| 2590 |
|
| 2591 |
<span class= |
| 2592 |
"comment"># Use the 9x15 and 9x15bold fonts. Connect to 192.168.3.3 by default.</span><br> |
| 2593 |
|
| 2594 |
<span class="comment">#</span><br> |
| 2595 |
<span class="ident2">FG</span>=black<br> |
| 2596 |
<span class="ident2">BG</span>=white<br> |
| 2597 |
<span class="ident2">HOST</span>=192.168.3.3<br> |
| 2598 |
<span class="ident2">FONT</span>=9x15<br> |
| 2599 |
<span class="ident2">BFONT</span>=9x15bold<br> |
| 2600 |
<span class="ident2">COLS</span>=<span class= |
| 2601 |
"number">80</span><br> |
| 2602 |
<br> |
| 2603 |
<span class= |
| 2604 |
"comment"># Parse the command line arguments</span><br> |
| 2605 |
|
| 2606 |
<span class="comment">#</span><br> |
| 2607 |
<span class="keyword">while</span> [ <span class= |
| 2608 |
"ident2">$#</span> != <span class= |
| 2609 |
"number">0</span> ];<br> |
| 2610 |
<span class="keyword">do</span><br> |
| 2611 |
<span class= |
| 2612 |
"keyword">case</span> <span class= |
| 2613 |
"ident2">$1</span> <span class="keyword">in</span><br> |
| 2614 |
<span class="number">-80</span>) <span class="ident2">COLS</span>=<span class="number">80</span><br> |
| 2615 |
|
| 2616 |
<span class="ident2">FONT</span>=spc12x24c<br> |
| 2617 |
|
| 2618 |
<span class="ident2">BFONT</span>=spc12x24b<br> |
| 2619 |
|
| 2620 |
<span class="keyword">shift</span><br> |
| 2621 |
|
| 2622 |
;;<br> |
| 2623 |
|
| 2624 |
<span class="number">-132</span>) <span class="ident2">COLS</span>=<span class="number">132</span><br> |
| 2625 |
|
| 2626 |
<span class="ident2">FONT</span>=9x15<br> |
| 2627 |
|
| 2628 |
<span class="ident2">BFONT</span>=9x15b<br> |
| 2629 |
|
| 2630 |
<span class="keyword">shift</span><br> |
| 2631 |
|
| 2632 |
;;<br> |
| 2633 |
|
| 2634 |
-fg) <span class="keyword">shift</span><br> |
| 2635 |
|
| 2636 |
<span class="ident2">FG</span>=<span class="ident2">$1</span><br> |
| 2637 |
|
| 2638 |
<span class="keyword">shift</span>;;<br> |
| 2639 |
|
| 2640 |
-bg) <span class="keyword">shift</span><br> |
| 2641 |
|
| 2642 |
<span class="ident2">BG</span>=<span class="ident2">$1</span><br> |
| 2643 |
|
| 2644 |
<span class="keyword">shift</span>;;<br> |
| 2645 |
|
| 2646 |
-fn) <span class="keyword">shift</span><br> |
| 2647 |
|
| 2648 |
<span class="ident2">FONT</span>=<span class="ident2">$1</span><br> |
| 2649 |
|
| 2650 |
<span class="keyword">shift</span>;;<br> |
| 2651 |
|
| 2652 |
-fb) <span class="keyword">shift</span><br> |
| 2653 |
|
| 2654 |
<span class="ident2">BFONT</span>=<span class="ident2">$1</span><br> |
| 2655 |
|
| 2656 |
<span class="keyword">shift</span>;;<br> |
| 2657 |
|
| 2658 |
-host) <span class="keyword">shift</span><br> |
| 2659 |
|
| 2660 |
<span class="ident2">HOST</span>=<span class="ident2">$1</span><br> |
| 2661 |
|
| 2662 |
<span class="keyword">shift</span>;;<br> |
| 2663 |
|
| 2664 |
-help) Usage;;<br> |
| 2665 |
|
| 2666 |
*) Usage;;<br> |
| 2667 |
|
| 2668 |
<span class= |
| 2669 |
"keyword">esac</span><br> |
| 2670 |
<span class="keyword">done</span><br> |
| 2671 |
<br> |
| 2672 |
xterm -title <span class= |
| 2673 |
"literal">"VMSTERM"</span> -sb -sl <span class= |
| 2674 |
"number">1000</span> -geo <span class= |
| 2675 |
"ident2">${COLS}</span>x24 -fg <span class= |
| 2676 |
"ident2">${FG}</span> -bg <span class= |
| 2677 |
"ident2">${BG}</span> \<br> |
| 2678 |
-cr blue -fn <span class="ident2">${FONT}</span> -fb <span class="ident2">${BFONT}</span> -xrm \<br> |
| 2679 |
|
| 2680 |
<span class= |
| 2681 |
"literal">"XTerm*vt100.translations: #override </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2682 |
|
| 2683 |
~Shift <Key>F1: string(0x1b) string("</span>OP<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2684 |
|
| 2685 |
~Shift <Key>F2: string(0x1b) string("</span>OQ<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2686 |
|
| 2687 |
~Shift <Key>F3: string(0x1b) string("</span>OR<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2688 |
|
| 2689 |
~Shift <Key>F4: string(0x1b) string("</span>OS<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2690 |
|
| 2691 |
~Shift <Key>F5: string("</span>Break<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2692 |
|
| 2693 |
~Shift <Key>F6: string(0x1b) string("</span>[<span class="number">17</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2694 |
|
| 2695 |
~Shift <Key>F7: string(0x1b) string("</span>[<span class="number">18</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2696 |
|
| 2697 |
~Shift <Key>F8: string(0x1b) string("</span>[<span class="number">19</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2698 |
|
| 2699 |
~Shift <Key>F9: string(0x1b) string("</span>[<span class="number">20</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2700 |
|
| 2701 |
~Shift <Key>F10: string(0x1b) string("</span>[<span class="number">21</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2702 |
|
| 2703 |
~Shift <Key>F11: string(0x1b) string("</span>[<span class="number">23</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2704 |
|
| 2705 |
~Shift <Key>F12: string(0x1b) string("</span>[<span class="number">24</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2706 |
|
| 2707 |
Shift <Key>F1: string(0x1b) string("</span>[<span class="number">23</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2708 |
|
| 2709 |
Shift <Key>F2: string(0x1b) string("</span>[<span class="number">24</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2710 |
|
| 2711 |
Shift <Key>F3: string(0x1b) string("</span>[<span class="number">25</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2712 |
|
| 2713 |
Shift <Key>F4: string(0x1b) string("</span>[<span class="number">26</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2714 |
|
| 2715 |
Shift <Key>F5: string(0x1b) string("</span>[<span class="number">28</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2716 |
|
| 2717 |
Shift <Key>F6: string(0x1b) string("</span>[<span class="number">29</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2718 |
|
| 2719 |
Shift <Key>F7: string(0x1b) string("</span>[<span class="number">31</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2720 |
|
| 2721 |
Shift <Key>F8: string(0x1b) string("</span>[<span class="number">32</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2722 |
|
| 2723 |
Shift <Key>F9: string(0x1b) string("</span>[<span class="number">33</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2724 |
|
| 2725 |
Shift <Key>F10: string(0x1b) string("</span>[<span class="number">34</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2726 |
|
| 2727 |
Shift <Key>F11: string(0x1b) string("</span>[<span class="number">28</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2728 |
|
| 2729 |
Shift <Key>F12: string(0x1b) string("</span>[<span class="number">29</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2730 |
|
| 2731 |
<Key>Print: string(0x1b) string("</span>[<span class="number">28</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2732 |
|
| 2733 |
<Key>Cancel: string(0x1b) string("</span>[<span class="number">29</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2734 |
|
| 2735 |
<Key>Pause: string(0x1b) string("</span>Om<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2736 |
|
| 2737 |
<Key>Insert: string(0x1b) string("</span>[<span class="number">2</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2738 |
|
| 2739 |
<Key>Delete: string(0x1b) string("</span>[<span class="number">3</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2740 |
|
| 2741 |
<Key>Home: string(0x1b) string("</span>[<span class="number">1</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2742 |
|
| 2743 |
<Key>End: string(0x1b) string("</span>[<span class="number">4</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2744 |
|
| 2745 |
<Key>Prior: string(0x1b) string("</span>[<span class="number">5</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2746 |
|
| 2747 |
<Key>Next: string(0x1b) string("</span>[<span class="number">6</span>~<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2748 |
|
| 2749 |
<Key>BackSpace: string(0x7f) </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2750 |
|
| 2751 |
<Key>Num_Lock: string(0x1b) string("</span>OP<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2752 |
|
| 2753 |
<Key>KP_Divide: string(0x1b) string("</span>OQ<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2754 |
|
| 2755 |
<Key>KP_Multiply: string(0x1b) string("</span>OR<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2756 |
|
| 2757 |
<Key>KP_Subtract: string(0x1b) string("</span>OS<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2758 |
|
| 2759 |
<Key>KP_Add: string(0x1b) string("</span>Ol<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2760 |
|
| 2761 |
<Key>KP_Enter: string(0x1b) string("</span>OM<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2762 |
|
| 2763 |
<Key>KP_Decimal: string(0x1b) string("</span>On<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2764 |
|
| 2765 |
<Key>KP_0: string(0x1b) string("</span>Op<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2766 |
|
| 2767 |
<Key>KP_1: string(0x1b) string("</span>Oq<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2768 |
|
| 2769 |
<Key>KP_2: string(0x1b) string("</span>Or<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2770 |
|
| 2771 |
<Key>KP_3: string(0x1b) string("</span>Os<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2772 |
|
| 2773 |
<Key>KP_4: string(0x1b) string("</span>Ot<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2774 |
|
| 2775 |
<Key>KP_5: string(0x1b) string("</span>Ou<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2776 |
|
| 2777 |
<Key>KP_6: string(0x1b) string("</span>Ov<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2778 |
|
| 2779 |
<Key>KP_7: string(0x1b) string("</span>Ow<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2780 |
|
| 2781 |
<Key>KP_8: string(0x1b) string("</span>Ox<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2782 |
|
| 2783 |
<Key>KP_9: string(0x1b) string("</span>Oy<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2784 |
|
| 2785 |
~Shift <Key>Up: string(0x1b) string("</span>[A<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2786 |
|
| 2787 |
Shift <Key>Up: scroll-back(1,lines) </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2788 |
|
| 2789 |
~Shift <Key>Down: string(0x1b) string("</span>[B<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2790 |
|
| 2791 |
Shift <Key>Down: scroll-forw(1,lines) </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2792 |
|
| 2793 |
<Key>Right: string(0x1b) string("</span>[C<span class="literal">") </span><strong><em><span class="comment">\</span></em></strong><span class="literal">n </span><strong><em><span class="comment">\</span></em></strong><span class="literal"><br> |
| 2794 |
|
| 2795 |
<Key>Left: string(0x1b) string("</span>[D<span class="literal">")"</span> \<br> |
| 2796 |
|
| 2797 |
-e telnet <span class="ident2">$HOST</span> <br> |
| 2798 |
|
| 2799 |
<!--atr2html}}--></p> |
| 2800 |
</blockquote> |
| 2801 |
|
| 2802 |
<h3 id="how2_title-id"><a name="how2_title" id="how2_title">How |
| 2803 |
do I set the title?</a></h3> |
| 2804 |
|
| 2805 |
<p>The control sequences for doing this are documented in |
| 2806 |
<a href="#ctlseqs_ms">ctlseqs.ms</a>.</p> |
| 2807 |
|
| 2808 |
<p>The usual context for this question is setting the title |
| 2809 |
according to the current working directory. People post answers |
| 2810 |
to this periodically on the newsgroups. Here is one that I have |
| 2811 |
seen, from Roy Wright <[email protected]>. In your |
| 2812 |
/etc/profile after:</p> |
| 2813 |
|
| 2814 |
<blockquote class="code-block"> |
| 2815 |
<!--{{atr2html--> |
| 2816 |
|
| 2817 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 2818 |
<span class="keyword">if</span> [ <span class= |
| 2819 |
"literal">"</span><span class= |
| 2820 |
"ident2">$SHELL</span><span class="literal">"</span> = <span class="literal">"/bin/pdksh"</span> -o <span class="literal">"</span><span class="ident2">$SHELL</span><span class="literal">"</span> = <span class="literal">"/bin/ksh"</span> ]; <span class="keyword">then</span><br> |
| 2821 |
|
| 2822 |
<span class= |
| 2823 |
"ident2">PS1</span>=<span class= |
| 2824 |
"literal">"! $ "</span><br> |
| 2825 |
<span class="keyword">elif</span> [ <span class= |
| 2826 |
"literal">"</span><span class= |
| 2827 |
"ident2">$SHELL</span><span class="literal">"</span> = <span class="literal">"/bin/zsh"</span> ]; <span class="keyword">then</span><br> |
| 2828 |
|
| 2829 |
<span class= |
| 2830 |
"ident2">PS1</span>=<span class= |
| 2831 |
"literal">"%m:%~%# "</span><br> |
| 2832 |
<span class="keyword">elif</span> [ <span class= |
| 2833 |
"literal">"</span><span class= |
| 2834 |
"ident2">$SHELL</span><span class="literal">"</span> = <span class="literal">"/bin/ash"</span> ]; <span class="keyword">then</span><br> |
| 2835 |
|
| 2836 |
<span class= |
| 2837 |
"ident2">PS1</span>=<span class="literal">"$ "</span><br> |
| 2838 |
<span class="keyword">else</span><br> |
| 2839 |
<span class= |
| 2840 |
"ident2">PS1</span>=<span class= |
| 2841 |
"literal">'\u@\h:\w\$ '</span><br> |
| 2842 |
<span class="keyword">fi</span><br> |
| 2843 |
<!--atr2html}}--></p> |
| 2844 |
</blockquote> |
| 2845 |
|
| 2846 |
<p>add:</p> |
| 2847 |
|
| 2848 |
<blockquote class="code-block"> |
| 2849 |
<!--{{atr2html--> |
| 2850 |
|
| 2851 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 2852 |
<span class="keyword">if</span> [ <span class= |
| 2853 |
"literal">"</span><span class="ident2">$TERM</span><span class= |
| 2854 |
"literal">"</span> = <span class= |
| 2855 |
"literal">"xterm"</span> ]; <span class= |
| 2856 |
"keyword">then</span><br> |
| 2857 |
<span class= |
| 2858 |
"ident2">PS1</span>=<span class="literal">"</span><span class= |
| 2859 |
"keyword2">\</span><span class= |
| 2860 |
"literal">033]2;</span><span class= |
| 2861 |
"keyword2">\</span><span class="literal">u@</span><span class= |
| 2862 |
"keyword2">\</span><span class="literal">h:</span><span class= |
| 2863 |
"keyword2">\</span><span class="literal">w</span><span class= |
| 2864 |
"keyword2">\</span><span class= |
| 2865 |
"literal">007bash$ "</span><br> |
| 2866 |
<span class="keyword">fi</span><br> |
| 2867 |
<!--atr2html}}--></p> |
| 2868 |
</blockquote> |
| 2869 |
|
| 2870 |
<p>The terminator "\007" is a problem area. |
| 2871 |
<strong>XTerm</strong> historically uses this character, though |
| 2872 |
it is non-ANSI. The “correct” character should be a |
| 2873 |
"\233" string terminator, or "\033\\", which is the 7-bit |
| 2874 |
equivalent. Modern xterm recognizes either (the "\007" or string |
| 2875 |
terminator); waiting for the first of these.</p> |
| 2876 |
|
| 2877 |
<p>You may have resource or environment problems that prevent you |
| 2878 |
from setting the title at all. Newer xterms (starting somewhere |
| 2879 |
in X11R5) use the $LANG variable. If your locale is incorrectly |
| 2880 |
installed, you will be unable to set the xterm's title. As noted |
| 2881 |
by Mikhail Teterin <[email protected]>: Make sure that |
| 2882 |
the locale (LANG and/or LOCALE environment variable) is known to |
| 2883 |
X Window System. Check ${X11ROOT}/lib/X11/locale.* for it. If it |
| 2884 |
is not listed in either one of the files, find the nearest match |
| 2885 |
and add an alias to it. Restart X if you have made changes.</p> |
| 2886 |
|
| 2887 |
<p>On a related note, some people want to know how to read the |
| 2888 |
title from an xterm. This works for modern xterm and dtterm, but |
| 2889 |
not for other variations:</p> |
| 2890 |
|
| 2891 |
<blockquote class="code-block"> |
| 2892 |
<!--{{atr2html--> |
| 2893 |
|
| 2894 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 2895 |
<span class="comment">#!/bin/ksh</span><br> |
| 2896 |
<span class= |
| 2897 |
"comment"># Echo the current X term title bar to standard output.</span><br> |
| 2898 |
|
| 2899 |
<span class= |
| 2900 |
"comment"># Written by Icarus Sparry <[email protected]> 11 Apr 1997</span><br> |
| 2901 |
|
| 2902 |
<span class="comment">#</span><br> |
| 2903 |
<span class="keyword">exec</span> </dev/tty<br> |
| 2904 |
<span class="ident2">old</span>=<span class= |
| 2905 |
"keyword2">$(</span>stty -g<span class= |
| 2906 |
"keyword2">)</span><br> |
| 2907 |
stty raw -echo min <span class= |
| 2908 |
"number">0</span> <span class= |
| 2909 |
"keyword">time</span> <span class= |
| 2910 |
"ident2">${1</span><span class= |
| 2911 |
"keyword2">-</span>10<span class="ident2">}</span><br> |
| 2912 |
<span class="keyword">print</span> <span class= |
| 2913 |
"literal">"</span><span class="keyword2">\</span><span class= |
| 2914 |
"literal">033[21t</span><span class= |
| 2915 |
"keyword2">\</span><span class= |
| 2916 |
"literal">c"</span> > /dev/tty<br> |
| 2917 |
<span class="ident2">IFS</span>=<span class= |
| 2918 |
"literal">''</span> <span class= |
| 2919 |
"keyword">read</span> -r a<br> |
| 2920 |
stty <span class="ident2">$old</span><br> |
| 2921 |
<span class="ident2">b</span>=<span class= |
| 2922 |
"ident2">${a</span><span class= |
| 2923 |
"keyword2">#</span>???<span class="ident2">}</span><br> |
| 2924 |
<span class="keyword">print</span> -R <span class= |
| 2925 |
"literal">"</span><span class="ident2">${b</span><span class= |
| 2926 |
"keyword2">%</span>??<span class="ident2">}</span><span class= |
| 2927 |
"literal">"</span><br> |
| 2928 |
<!--atr2html}}--></p> |
| 2929 |
</blockquote> |
| 2930 |
|
| 2931 |
<p>But it is possible to avoid escape sequences altogether (from |
| 2932 |
Hemant Shah <[email protected]>):</p> |
| 2933 |
|
| 2934 |
<blockquote> |
| 2935 |
<pre class="code-block"> |
| 2936 |
$ xprop -id $WINDOWID | grep WM_NAME |
| 2937 |
WM_NAME(STRING) = "this is my title" |
| 2938 |
current_title=$(xprop -id $WINDOWID | grep WM_NAME | cut -d= -f2) |
| 2939 |
</pre> |
| 2940 |
</blockquote> |
| 2941 |
|
| 2942 |
<p>Here's another source of information: <a href= |
| 2943 |
"https://tldp.org/HOWTO/Xterm-Title.html">Xterm-Title |
| 2944 |
HowTo</a></p> |
| 2945 |
|
| 2946 |
<h3 id="how2_blink-id"><a name="how2_blink" id="how2_blink">How |
| 2947 |
do I make the cursor blink?</a></h3> |
| 2948 |
|
| 2949 |
<p>Standard xterm does not implement a blinking cursor. Some of |
| 2950 |
the variations do: dtterm, GNOME Terminal, and modern xterm (from |
| 2951 |
mid 1999, <a href="/xterm/xterm.log.html#xterm_107">patch |
| 2952 |
107</a>).</p> |
| 2953 |
|
| 2954 |
<h2 id="frequent_problems-id"><a name="frequent_problems" id= |
| 2955 |
"frequent_problems">Frequent problems</a></h2> |
| 2956 |
|
| 2957 |
<ul> |
| 2958 |
<li> |
| 2959 |
<a href="#problems_starting">Starting xterm, or not</a> |
| 2960 |
<ul> |
| 2961 |
<li> |
| 2962 |
<p><a href="#no_ptys">Xterm does not run (no available |
| 2963 |
pty's)</a></p> |
| 2964 |
</li> |
| 2965 |
|
| 2966 |
<li> |
| 2967 |
<p><a href="#no_termcap">I need /etc/termcap</a></p> |
| 2968 |
</li> |
| 2969 |
|
| 2970 |
<li> |
| 2971 |
<p><a href="#no_libpath">Why does $LD_LIBRARY_PATH get |
| 2972 |
reset?</a></p> |
| 2973 |
</li> |
| 2974 |
|
| 2975 |
<li> |
| 2976 |
<p><a href="#no_ls_and_e">Why do the -e and -ls options |
| 2977 |
not work together?</a></p> |
| 2978 |
</li> |
| 2979 |
|
| 2980 |
<li> |
| 2981 |
<p><a href="#setup_resize">Why is my screen size not |
| 2982 |
set?</a></p> |
| 2983 |
</li> |
| 2984 |
|
| 2985 |
<li> |
| 2986 |
<p><a href="#tiny_menus">Why are the menus tiny?</a></p> |
| 2987 |
</li> |
| 2988 |
</ul> |
| 2989 |
</li> |
| 2990 |
|
| 2991 |
<li> |
| 2992 |
<a href="#problems_fonts">Font problems</a> |
| 2993 |
<ul> |
| 2994 |
<li> |
| 2995 |
<p><a href="#no_altchar">My terminal doesn't show box |
| 2996 |
characters</a></p> |
| 2997 |
</li> |
| 2998 |
|
| 2999 |
<li> |
| 3000 |
<p><a href="#scaled_font">The bold font is ugly</a></p> |
| 3001 |
</li> |
| 3002 |
|
| 3003 |
<li> |
| 3004 |
<p><a href="#little_dot">I see little dots on the |
| 3005 |
screen</a></p> |
| 3006 |
</li> |
| 3007 |
|
| 3008 |
<li> |
| 3009 |
<p><a href="#no_russian">My terminal doesn't display |
| 3010 |
Cyrillic characters</a></p> |
| 3011 |
</li> |
| 3012 |
|
| 3013 |
<li> |
| 3014 |
<p><a href="#utf8_fonts">I see boxes instead of |
| 3015 |
characters in uxterm</a></p> |
| 3016 |
</li> |
| 3017 |
|
| 3018 |
<li> |
| 3019 |
<p><a href="#utf8_badcode">I see question-marks instead |
| 3020 |
of characters in uxterm</a></p> |
| 3021 |
</li> |
| 3022 |
|
| 3023 |
<li> |
| 3024 |
<p><a href="#slow_menus">The first popup menu is very |
| 3025 |
slow</a></p> |
| 3026 |
</li> |
| 3027 |
</ul> |
| 3028 |
</li> |
| 3029 |
|
| 3030 |
<li> |
| 3031 |
<a href="#problems_keyboard">Keyboard problems</a> |
| 3032 |
<ul> |
| 3033 |
<li> |
| 3034 |
<p><a href="#xterm_8bits">Why can't I input 8-bit |
| 3035 |
characters?</a></p> |
| 3036 |
</li> |
| 3037 |
|
| 3038 |
<li> |
| 3039 |
<p><a href="#xterm_erase">Why doesn't my delete key |
| 3040 |
work?</a></p> |
| 3041 |
</li> |
| 3042 |
|
| 3043 |
<li> |
| 3044 |
<p><a href="#xterm_erased">Why did my delete key stop |
| 3045 |
working?</a></p> |
| 3046 |
</li> |
| 3047 |
|
| 3048 |
<li> |
| 3049 |
<p><a href="#xterm_xmodmap">Well, how can I set my delete |
| 3050 |
key?</a></p> |
| 3051 |
</li> |
| 3052 |
|
| 3053 |
<li> |
| 3054 |
<p><a href="#xterm_keypad">Why doesn't my keypad |
| 3055 |
work?</a></p> |
| 3056 |
</li> |
| 3057 |
|
| 3058 |
<li> |
| 3059 |
<p><a href="#xterm_modother">How can my program |
| 3060 |
distinguish control-I from tab?</a></p> |
| 3061 |
</li> |
| 3062 |
|
| 3063 |
<li> |
| 3064 |
<p><a href="#xterm_pageup">Why can't I use the |
| 3065 |
pageup/pagedown keys?</a></p> |
| 3066 |
</li> |
| 3067 |
|
| 3068 |
<li> |
| 3069 |
<p><a href="#xterm_pc_style">Why can't I use the home/end |
| 3070 |
keys?</a></p> |
| 3071 |
</li> |
| 3072 |
|
| 3073 |
<li> |
| 3074 |
<p><a href="#xterm_arrows">Why can't I use the cursor |
| 3075 |
keys in (whatever) shell?</a></p> |
| 3076 |
</li> |
| 3077 |
|
| 3078 |
<li> |
| 3079 |
<p><a href="#bash_meta_mode">Alt-keys do not work in |
| 3080 |
bash</a></p> |
| 3081 |
</li> |
| 3082 |
</ul> |
| 3083 |
</li> |
| 3084 |
|
| 3085 |
<li> |
| 3086 |
<a href="#problems_colors">Colors and other graphic |
| 3087 |
rendition</a> |
| 3088 |
<ul> |
| 3089 |
<li> |
| 3090 |
<p><a href="#no_color">My terminal doesn't recognize |
| 3091 |
color</a></p> |
| 3092 |
</li> |
| 3093 |
|
| 3094 |
<li> |
| 3095 |
<p><a href="#xterm_terminfo">What $TERM should I use?</a></p> |
| 3096 |
</li> |
| 3097 |
|
| 3098 |
<li> |
| 3099 |
<p><a href="#xterm_hilite">Reverse video is not reset</a></p> |
| 3100 |
</li> |
| 3101 |
|
| 3102 |
<li> |
| 3103 |
<p><a href="#vim_16colors">My colors changed in vim</a></p> |
| 3104 |
</li> |
| 3105 |
|
| 3106 |
<li> |
| 3107 |
<p><a href="#bold_vs_16colors">Aren't bright colors the |
| 3108 |
same as bold?</a></p> |
| 3109 |
</li> |
| 3110 |
|
| 3111 |
<li> |
| 3112 |
<p><a href="#color_by_number">Can I set a color by its |
| 3113 |
number?</a></p> |
| 3114 |
</li> |
| 3115 |
|
| 3116 |
<li> |
| 3117 |
<p><a href="#dont_like_blue">I don't like that shade of |
| 3118 |
blue</a></p> |
| 3119 |
</li> |
| 3120 |
|
| 3121 |
<li> |
| 3122 |
<p><a href="#what_256colors">What is the 256-color |
| 3123 |
palette?</a></p> |
| 3124 |
</li> |
| 3125 |
|
| 3126 |
<li> |
| 3127 |
<p><a href="#why_no_italics">Why doesn't xterm support |
| 3128 |
italics?</a></p> |
| 3129 |
</li> |
| 3130 |
|
| 3131 |
<li> |
| 3132 |
<p><a href="#grep_colors">"grep --color" does not show |
| 3133 |
the right output</a></p> |
| 3134 |
</li> |
| 3135 |
|
| 3136 |
<li> |
| 3137 |
<p><a href="#vt100_wrapping">That description of wrapping |
| 3138 |
is odd, say more?</a></p> |
| 3139 |
</li> |
| 3140 |
|
| 3141 |
<li> |
| 3142 |
<p><a href="#bce_oddness">That color scheme is odd, say |
| 3143 |
more?</a></p> |
| 3144 |
</li> |
| 3145 |
</ul> |
| 3146 |
</li> |
| 3147 |
|
| 3148 |
<li> |
| 3149 |
<a href="#problems_weird">Odd behavior</a> |
| 3150 |
<ul> |
| 3151 |
<li> |
| 3152 |
<p><a href="#xterm_paste">Why can't I select/paste in |
| 3153 |
xterm?</a></p> |
| 3154 |
</li> |
| 3155 |
|
| 3156 |
<li> |
| 3157 |
<p><a href="#xterm_select_clipboard">Why can't I |
| 3158 |
select/paste to/from other programs?</a></p> |
| 3159 |
</li> |
| 3160 |
|
| 3161 |
<li> |
| 3162 |
<p><a href="#xterm_tabs">Why can't I select |
| 3163 |
tab-characters in xterm?</a></p> |
| 3164 |
</li> |
| 3165 |
|
| 3166 |
<li> |
| 3167 |
<p><a href="#xterm_paste_nl">Can bracketed-paste solve my |
| 3168 |
problems?</a></p> |
| 3169 |
</li> |
| 3170 |
|
| 3171 |
<li> |
| 3172 |
<p><a href="#xterm_resize">FVWM does weird things when I |
| 3173 |
try to resize xterm</a></p> |
| 3174 |
</li> |
| 3175 |
|
| 3176 |
<li> |
| 3177 |
<p><a href="#xterm_tite">Why doesn't the screen clear |
| 3178 |
when running vi?</a></p> |
| 3179 |
</li> |
| 3180 |
|
| 3181 |
<li> |
| 3182 |
<p><a href="#xterm_form_feed">Why doesn't the screen |
| 3183 |
clear when I type control/L?</a></p> |
| 3184 |
</li> |
| 3185 |
|
| 3186 |
<li> |
| 3187 |
<p><a href="#xterm_vite">Why is the cursor misplaced |
| 3188 |
after running vi?</a></p> |
| 3189 |
</li> |
| 3190 |
|
| 3191 |
<li> |
| 3192 |
<p><a href="#narrowproto">Why doesn't the scrollbar |
| 3193 |
work?</a></p> |
| 3194 |
</li> |
| 3195 |
|
| 3196 |
<li> |
| 3197 |
<p><a href="#xaw_scrollbars">Can I improve the |
| 3198 |
scrollbars?</a></p> |
| 3199 |
</li> |
| 3200 |
|
| 3201 |
<li> |
| 3202 |
<p><a href="#scroll_speed">Can I improve the scrolling |
| 3203 |
speed?</a></p> |
| 3204 |
</li> |
| 3205 |
|
| 3206 |
<li> |
| 3207 |
<p><a href="#window_ops">Why can't my program read the |
| 3208 |
window title?</a></p> |
| 3209 |
</li> |
| 3210 |
|
| 3211 |
<li> |
| 3212 |
<p><a href="#window_ops2">Why can't my program set the |
| 3213 |
window size?</a></p> |
| 3214 |
</li> |
| 3215 |
|
| 3216 |
<li> |
| 3217 |
<p><a href="#compiz_bugs">Why is the text in the wrong |
| 3218 |
place?</a></p> |
| 3219 |
</li> |
| 3220 |
</ul> |
| 3221 |
</li> |
| 3222 |
|
| 3223 |
<li> |
| 3224 |
<p><a href="#my_xdefaults">Sample .Xdefaults Color-Settings |
| 3225 |
for XTerm</a></p> |
| 3226 |
</li> |
| 3227 |
|
| 3228 |
<li> |
| 3229 |
<p><a href="#warning_msg">What is this warning message?</a></p> |
| 3230 |
</li> |
| 3231 |
</ul> |
| 3232 |
|
| 3233 |
<h3 id="problems_starting-id"><a name="problems_starting" id= |
| 3234 |
"problems_starting">Starting xterm, or not</a></h3> |
| 3235 |
|
| 3236 |
<h4 id="no_ptys-id"><a name="no_ptys" id= |
| 3237 |
"no_ptys"><strong>XTerm</strong> does not run (no available |
| 3238 |
pty's)</a></h4> |
| 3239 |
|
| 3240 |
<p>Your copy of xterm may not have enough permissions to use |
| 3241 |
existing pty's:</p> |
| 3242 |
|
| 3243 |
<ul> |
| 3244 |
<li> |
| 3245 |
<p>you may have to make xterm run setuid to root (though |
| 3246 |
newer systems have wrappers that make this unnecessary).</p> |
| 3247 |
</li> |
| 3248 |
|
| 3249 |
<li> |
| 3250 |
<p>the pty's permissions may be restrictive (that is ok, but |
| 3251 |
you have to make xterm agree with it). Usually this is done |
| 3252 |
by making the group ownership of the pty's “tty”, |
| 3253 |
and requiring that xterm run setgid to “tty”. |
| 3254 |
This is done rather than make xterm run setuid to root, since |
| 3255 |
that presents problems with security.</p> |
| 3256 |
</li> |
| 3257 |
|
| 3258 |
<li> |
| 3259 |
<p>newer systems (with Unix98 pty's) have a single entry |
| 3260 |
under /dev which has to have the right permissions. For |
| 3261 |
example:</p> |
| 3262 |
|
| 3263 |
<blockquote> |
| 3264 |
<pre class="code-block"> |
| 3265 |
# ls -l /dev/ptmx |
| 3266 |
crw-rw---- 1 root tty 5, 2 Aug 21 20:19 /dev/ptmx |
| 3267 |
</pre> |
| 3268 |
</blockquote> |
| 3269 |
</li> |
| 3270 |
</ul> |
| 3271 |
|
| 3272 |
<p>Perhaps your system does not have enough pty's, or (problems |
| 3273 |
reported with newer Linux kernels supporting Unix98 pty's, |
| 3274 |
beginning with RedHat 6.0) the major device numbers of the pty's |
| 3275 |
may have changed during a kernel upgrade. (This is described in |
| 3276 |
<code>/usr/src/linux/Documentation</code>).</p> |
| 3277 |
|
| 3278 |
<p>See also the MAKEDEV script, which usually exists under |
| 3279 |
/dev.</p> |
| 3280 |
|
| 3281 |
<h4 id="no_termcap-id"><a name="no_termcap" id="no_termcap">I |
| 3282 |
need /etc/termcap</a></h4> |
| 3283 |
|
| 3284 |
<p>If you have a termcap version of xterm on a system with no |
| 3285 |
termcap libraries, you may also be missing /etc/termcap.</p> |
| 3286 |
|
| 3287 |
<p>A workaround is to copy /usr/X11R6/lib/X11/etc/xterm.termcap |
| 3288 |
to /etc/termcap.</p> |
| 3289 |
|
| 3290 |
<p>This is fixed another way starting with XFree86 3.3.1. If |
| 3291 |
xterm cannot find the terminal description, it will accept that, |
| 3292 |
though it will print a warning. If xterm does not find the |
| 3293 |
termcap entry, it will not set the $TERMCAP variable.</p> |
| 3294 |
|
| 3295 |
<h4 id="no_libpath-id"><a name="no_libpath" id="no_libpath">Why |
| 3296 |
does $LD_LIBRARY_PATH get reset?</a></h4> |
| 3297 |
|
| 3298 |
<p>If xterm is running setuid (which is needed on some systems |
| 3299 |
which have no wrappers for opening pty's and updating utmp), |
| 3300 |
newer systems automatically set or reset environment variables |
| 3301 |
which are considered security problems. These include |
| 3302 |
<code>$PATH</code> and <code>$LD_LIBRARY_PATH</code>, since they |
| 3303 |
affect the choice of which programs are run if not specified via |
| 3304 |
a full pathname.</p> |
| 3305 |
|
| 3306 |
<p>This means, for example, that if you attempt to run</p> |
| 3307 |
|
| 3308 |
<blockquote> |
| 3309 |
<pre class="code-block"> |
| 3310 |
xterm -e foo |
| 3311 |
</pre> |
| 3312 |
</blockquote> |
| 3313 |
|
| 3314 |
<p>where <code>foo</code> is a program that uses shared libraries |
| 3315 |
in <code>/usr/local/lib</code>, then the command will fail, |
| 3316 |
because <code>/usr/local/lib</code> is not considered part of |
| 3317 |
<code>root</code>'s environment.</p> |
| 3318 |
|
| 3319 |
<p>Modern Unix systems (such as recent Solaris and HPUX versions) |
| 3320 |
do not require you to run xterm setuid. Some will result in odd |
| 3321 |
malfunctions if you do this.</p> |
| 3322 |
|
| 3323 |
<h4 id="no_ls_and_e-id"><a name="no_ls_and_e" id= |
| 3324 |
"no_ls_and_e">Why do the -e and -ls options not work |
| 3325 |
together?</a></h4> |
| 3326 |
|
| 3327 |
<p><strong>XTerm</strong> has two useful options for controlling |
| 3328 |
the shell that is run:</p> |
| 3329 |
|
| 3330 |
<dl> |
| 3331 |
<dt>-e</dt> |
| 3332 |
|
| 3333 |
<dd>tells xterm to execute a command using the remaining |
| 3334 |
parameters after this option.</dd> |
| 3335 |
|
| 3336 |
<dt>-ls</dt> |
| 3337 |
|
| 3338 |
<dd>tells xterm to invoke a login shell, making it read your |
| 3339 |
<code>.login</code> file, for instance.</dd> |
| 3340 |
</dl> |
| 3341 |
|
| 3342 |
<p>The two are not compatible. If you specify both, xterm uses |
| 3343 |
<code>-e</code>, and if that fails for whatever reason will fall |
| 3344 |
through to the <code>-ls</code> option. It cannot (in general) |
| 3345 |
combine the two, since some shells permit this (e.g., bash), and |
| 3346 |
others do not (e.g., tcsh).</p> |
| 3347 |
|
| 3348 |
<h4 id="setup_resize-id"><a name="setup_resize" id= |
| 3349 |
"setup_resize">Why is my screen size not set?</a></h4> |
| 3350 |
|
| 3351 |
<p>Well, it may be set, but not correctly. You may notice these |
| 3352 |
symptoms:</p> |
| 3353 |
|
| 3354 |
<ul> |
| 3355 |
<li> |
| 3356 |
<p>When editing with vi, you cannot see the beginning of the |
| 3357 |
file, or</p> |
| 3358 |
</li> |
| 3359 |
|
| 3360 |
<li> |
| 3361 |
<p>Running</p> |
| 3362 |
|
| 3363 |
<blockquote> |
| 3364 |
<pre class="code-block"> |
| 3365 |
stty -a |
| 3366 |
</pre> |
| 3367 |
</blockquote> |
| 3368 |
|
| 3369 |
<p>shows the rows and/or columns values as 0, or some other |
| 3370 |
value (such as 65) which has nothing to do with the actual |
| 3371 |
window size.</p> |
| 3372 |
</li> |
| 3373 |
</ul> |
| 3374 |
|
| 3375 |
<p><strong>XTerm</strong> knows how big the screen is (of |
| 3376 |
course), and tries to tell your applications (e.g., by invoking |
| 3377 |
ioctl's and sending SIGWINCH). But sometimes it cannot:</p> |
| 3378 |
|
| 3379 |
<ul> |
| 3380 |
<li> |
| 3381 |
<p><strong>XTerm</strong> itself may have been built |
| 3382 |
incorrectly (the #ifdef's that make the logic work are |
| 3383 |
inactive).</p> |
| 3384 |
</li> |
| 3385 |
|
| 3386 |
<li> |
| 3387 |
<p>You may be running xterm via a remote connection which |
| 3388 |
refuses to pass that information. This can happen even on |
| 3389 |
“modern” networks where the connection crosses |
| 3390 |
domain boundaries.</p> |
| 3391 |
</li> |
| 3392 |
|
| 3393 |
<li> |
| 3394 |
<p>You may be running su'd to another account. SIGWINCH is |
| 3395 |
just another signal; signals do not propagate for security |
| 3396 |
reasons.</p> |
| 3397 |
</li> |
| 3398 |
</ul> |
| 3399 |
|
| 3400 |
<p>Most full-screen applications such as vi are designed to use |
| 3401 |
the ioctl calls that return the screen size. When they fail, the |
| 3402 |
applications use the size defined in the terminal's terminfo or |
| 3403 |
termcap description.</p> |
| 3404 |
|
| 3405 |
<p>You may be able to use the <em>resize</em> program to issue |
| 3406 |
the ioctl's that will notify your application of the actual |
| 3407 |
screen size. This does not always work for the reasons just |
| 3408 |
mentioned. Newer versions of stty let you specify the screen |
| 3409 |
size, though it will not be updated if you resize the xterm |
| 3410 |
window:</p> |
| 3411 |
|
| 3412 |
<blockquote> |
| 3413 |
<pre class="code-block"> |
| 3414 |
stty rows 24 columns 80 |
| 3415 |
</pre> |
| 3416 |
</blockquote> |
| 3417 |
|
| 3418 |
<p>Most full-screen applications also check if the $LINES and |
| 3419 |
$COLUMNS variables are set, using those values to override the |
| 3420 |
terminal description:</p> |
| 3421 |
|
| 3422 |
<blockquote> |
| 3423 |
<pre class="code-block"> |
| 3424 |
setenv LINES 24 |
| 3425 |
setenv COLUMNS 80 |
| 3426 |
</pre> |
| 3427 |
</blockquote> |
| 3428 |
|
| 3429 |
<p>Why 65 lines? The standard xterm terminfo description |
| 3430 |
specifies 65 lines, perhaps because someone liked it that way. |
| 3431 |
Real VT100's are 24 lines. I once used (and wrote applications |
| 3432 |
for) a Bitgraph terminal, which emulated VT100, but displayed 65 |
| 3433 |
lines.</p> |
| 3434 |
|
| 3435 |
<h4 id="tiny_menus-id"><a name="tiny_menus" id="tiny_menus">Why |
| 3436 |
are the menus tiny?</a></h4> |
| 3437 |
|
| 3438 |
<p>Everything seems to work, except that the xterm menus (VT |
| 3439 |
options, fonts, etc.) do not display properly; the menus pop up, |
| 3440 |
but only with a tiny display area in which none of the options |
| 3441 |
are visible (and only part of the menu title is visible).</p> |
| 3442 |
|
| 3443 |
<p>You have specified the geometry for xterm too high in the |
| 3444 |
hierarchy, and that 24x80 (or whatever the -geometry parameter |
| 3445 |
happens to be) is applying to the menus in pixels. This resource |
| 3446 |
makes the geometry apply to the menus as well as the VT100 |
| 3447 |
widget:</p> |
| 3448 |
|
| 3449 |
<blockquote class="code-block"> |
| 3450 |
<!--{{atr2html--> |
| 3451 |
|
| 3452 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 3453 |
<span class="keyword">XTerm</span>*<span class= |
| 3454 |
"ident2">geometry</span>:<span class= |
| 3455 |
"literal"> 80x24</span><br> |
| 3456 |
<!--atr2html}}--></p> |
| 3457 |
</blockquote> |
| 3458 |
|
| 3459 |
<p>while this applies only to the VT100 widget (which is probably |
| 3460 |
what you intended):</p> |
| 3461 |
|
| 3462 |
<blockquote class="code-block"> |
| 3463 |
<!--{{atr2html--> |
| 3464 |
|
| 3465 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 3466 |
<span class="keyword">XTerm</span>.<span class= |
| 3467 |
"keyword">VT100</span>.<span class= |
| 3468 |
"ident2">geometry</span>:<span class= |
| 3469 |
"literal"> 80x24</span><br> |
| 3470 |
<!--atr2html}}--></p> |
| 3471 |
</blockquote> |
| 3472 |
|
| 3473 |
<p>or better yet (to allow for the toolbar option, which uses a |
| 3474 |
level of widget hierarchy):</p> |
| 3475 |
|
| 3476 |
<blockquote class="code-block"> |
| 3477 |
<!--{{atr2html--> |
| 3478 |
|
| 3479 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 3480 |
<span class="keyword">XTerm</span>*<span class= |
| 3481 |
"keyword">VT100</span>.<span class= |
| 3482 |
"ident2">geometry</span>:<span class= |
| 3483 |
"literal"> 80x24</span><br> |
| 3484 |
<!--atr2html}}--></p> |
| 3485 |
</blockquote> |
| 3486 |
|
| 3487 |
<h3 id="problems_fonts-id"><a name="problems_fonts" id= |
| 3488 |
"problems_fonts">Font problems</a></h3> |
| 3489 |
|
| 3490 |
<h4 id="no_altchar-id"><a name="no_altchar" id="no_altchar">My |
| 3491 |
terminal doesn't show box characters</a></h4> |
| 3492 |
|
| 3493 |
<p><strong>XTerm</strong> displays the 7-bit ASCII and VT100 |
| 3494 |
graphic characters (including box corners) using specially |
| 3495 |
arranged fixed-pitch fonts. The first 32 glyph positions (which |
| 3496 |
would correspond to nonprinting control characters) are used to |
| 3497 |
hold the VT100 graphic characters. Some fonts that otherwise look |
| 3498 |
fine (such as courier) do not have glyphs defined for these |
| 3499 |
positions. So they display as blanks. Use <em>xfd</em> to display |
| 3500 |
the font.</p> |
| 3501 |
|
| 3502 |
<p>Modern xterm can form its own line-drawing characters (see |
| 3503 |
<a href="/xterm/xterm.log.html#xterm_90">patch 90</a>, for |
| 3504 |
example). It does not draw all of the graphic characters, only |
| 3505 |
those that may be done with straight lines. But those are the |
| 3506 |
most used, making most of the fixed-pitch fonts useful for |
| 3507 |
xterm.</p> |
| 3508 |
|
| 3509 |
<p>You may also have a problem with the terminfo description. As |
| 3510 |
distributed, the X11R6 terminfo for xterm does not have the |
| 3511 |
<em>acsc</em> string defined, so most implementations of curses |
| 3512 |
do not try to use the alternate character set.</p> |
| 3513 |
|
| 3514 |
<p>Finally, some people confuse the VT100 graphic characters with |
| 3515 |
the VT220 support for DEC technical character set. These are |
| 3516 |
distinct (7-bit) character sets. Xterm currently does not support |
| 3517 |
this.</p> |
| 3518 |
|
| 3519 |
<h4 id="scaled_font-id"><a name="scaled_font" id= |
| 3520 |
"scaled_font">The bold font is ugly</a></h4> |
| 3521 |
|
| 3522 |
<p><strong>XTerm</strong> lets you directly specify one bold |
| 3523 |
font, which is assumed to correspond to the default font. Older |
| 3524 |
versions of xterm make a fake bold font for the other choices via |
| 3525 |
the fonts menu by drawing the characters offset by one pixel. I |
| 3526 |
modified xterm to ask the font server for a bold font that |
| 3527 |
corresponds to each font (other than the default one). Usually |
| 3528 |
that works well. However, sometimes the font server gives a poor |
| 3529 |
match. Xterm checks for differences in the alignment and size, |
| 3530 |
but the font server may give incorrect information about the font |
| 3531 |
size. The scaled bitmap font feature gives poor results for the |
| 3532 |
smaller fonts. In your X server configuration file, that can be |
| 3533 |
fixed by disabling the feature, e.g., by appending ":unscaled" to |
| 3534 |
the path:</p> |
| 3535 |
|
| 3536 |
<blockquote class="code-block"> |
| 3537 |
<!--{{atr2html--> |
| 3538 |
|
| 3539 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 3540 |
FontPath "<span class="literal">/usr/lib/X11/fonts/100dpi/:unscaled</span>"<br> |
| 3541 |
|
| 3542 |
FontPath "<span class="literal">/usr/lib/X11/fonts/75dpi/:unscaled</span>"<br> |
| 3543 |
|
| 3544 |
FontPath "<span class="literal">/usr/lib/X11/fonts/misc/:unscaled</span>"<br> |
| 3545 |
|
| 3546 |
<!--atr2html}}--></p> |
| 3547 |
</blockquote> |
| 3548 |
|
| 3549 |
<p>You can suppress xterm's overstriking for bold fonts using the |
| 3550 |
<code>alwaysBoldMode</code> and related resources. However, |
| 3551 |
rendering ugly bold fonts is a "feature" of the font server. In |
| 3552 |
particular, the TrueType interface provides less ability to the |
| 3553 |
client for determining if a particular font supports a bold |
| 3554 |
form.</p> |
| 3555 |
|
| 3556 |
<h4 id="little_dot-id"><a name="little_dot" id="little_dot">I see |
| 3557 |
little dots on the screen</a></h4> |
| 3558 |
|
| 3559 |
<p>Well, I do. Perhaps you do not. It depends on the fonts you |
| 3560 |
choose, and how you use them.</p> |
| 3561 |
|
| 3562 |
<p>Standard xterm has a “normal” font for which a |
| 3563 |
bold font can be chosen, and several alternative fonts, useful |
| 3564 |
for changing the font size. The alternative fonts do not have |
| 3565 |
corresponding bold fonts. Xterm simulates bold fonts in this case |
| 3566 |
by overstriking the character one pixel offset. That can make an |
| 3567 |
bold character extend into the area that another character |
| 3568 |
occupies. When erasing a bold character from the screen, xterm |
| 3569 |
does not erase the extra pixel. This is corrected in modern |
| 3570 |
xterm, subject to the available fonts (from late 1998, <a href= |
| 3571 |
"xterm.log.html#xterm_85">patch 85</a>). For each font, it asks |
| 3572 |
the font server for a corresponding bold font. Your font server |
| 3573 |
may not have the bold font (or it may incorrectly report that it |
| 3574 |
does). But it usually works.</p> |
| 3575 |
|
| 3576 |
<h4 id="no_russian-id"><a name="no_russian" id="no_russian">My |
| 3577 |
terminal doesn't display Cyrillic characters</a></h4> |
| 3578 |
|
| 3579 |
<p>Cyrillic encodings typically use characters in the range |
| 3580 |
128-159. For a VT220 (or any terminal that follows ISO 6429), |
| 3581 |
those are treated as control characters. Still, some people want |
| 3582 |
to use KOI8-R, etc. I modified xterm in <a href= |
| 3583 |
"xterm.log.html#xterm_175">patch 175</a> to add an option |
| 3584 |
(<code>-k8</code>) and corresponding resource settings to allow |
| 3585 |
them to customize their environment. Here is a <a href= |
| 3586 |
"/archives/xterm/koi8-term">sample script</a> and <a href= |
| 3587 |
"/archives/xterm/KOI8Term">resource file</a> which I use for |
| 3588 |
testing this configuration.</p> |
| 3589 |
|
| 3590 |
<h4 id="utf8_fonts-id"><a name="utf8_fonts" id="utf8_fonts">I see |
| 3591 |
boxes instead of characters in uxterm</a></h4> |
| 3592 |
|
| 3593 |
<p><strong>XTerm</strong> may show boxes instead of characters if |
| 3594 |
the font that you have selected does not contain those |
| 3595 |
characters. Normally you can fix most of that using the UTF-8 |
| 3596 |
feature, with <code>uxterm</code>. However, your X resource |
| 3597 |
settings may be the source of the problem.</p> |
| 3598 |
|
| 3599 |
<p>One pitfall to setting X resources is that they allow you to |
| 3600 |
specify wildcards, e.g., the "*" character. When you give a |
| 3601 |
wildcard, the X resource matches any number of levels in the |
| 3602 |
widget hierarchy.</p> |
| 3603 |
|
| 3604 |
<p><strong>XTerm</strong> has more than one widget matching |
| 3605 |
“font” at different levels of the hierarchy. There |
| 3606 |
are the popup menus, and there are the fonts used for |
| 3607 |
<code>uxterm</code>. The latter is where an overbroad pattern can |
| 3608 |
cause xterm to use a different font than you expect.</p> |
| 3609 |
|
| 3610 |
<p>Suppose your resource setting includes this pattern</p> |
| 3611 |
|
| 3612 |
<blockquote class="code-block"> |
| 3613 |
<!--{{atr2html--> |
| 3614 |
|
| 3615 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 3616 |
*<span class="keyword">VT100</span>*<span class= |
| 3617 |
"ident2">font</span>:<span class= |
| 3618 |
"literal"> fixed</span><br> |
| 3619 |
<!--atr2html}}--></p> |
| 3620 |
</blockquote> |
| 3621 |
|
| 3622 |
<p>It could be interpreted as this:</p> |
| 3623 |
|
| 3624 |
<blockquote class="code-block"> |
| 3625 |
<!--{{atr2html--> |
| 3626 |
|
| 3627 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 3628 |
*<span class="keyword">VT100</span>.<span class= |
| 3629 |
"ident2">font</span>:<span class= |
| 3630 |
"literal"> fixed</span><br> |
| 3631 |
*<span class="keyword">VT100</span>.<span class= |
| 3632 |
"ident2">utf8Fonts</span>.<span class= |
| 3633 |
"ident2">font</span>:<span class= |
| 3634 |
"literal"> fixed</span><br> |
| 3635 |
<!--atr2html}}--></p> |
| 3636 |
</blockquote> |
| 3637 |
|
| 3638 |
<p><strong>XTerm</strong> uses the <code>utf8Fonts</code> |
| 3639 |
subresources to provide runtime-switchable fonts between |
| 3640 |
IS0-8859-1 (Latin-1) and ISO-10646 (Unicode). Modifying the |
| 3641 |
Unicode font to “fixed” will make most of the |
| 3642 |
characters unavailable (i.e., shown as boxes). If instead your |
| 3643 |
resource looks like</p> |
| 3644 |
|
| 3645 |
<blockquote class="code-block"> |
| 3646 |
<!--{{atr2html--> |
| 3647 |
|
| 3648 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 3649 |
*<span class="keyword">VT100</span>.<span class= |
| 3650 |
"ident2">font</span>:<span class= |
| 3651 |
"literal"> fixed</span><br> |
| 3652 |
<!--atr2html}}--></p> |
| 3653 |
</blockquote> |
| 3654 |
|
| 3655 |
<p>it would be unambiguous, and not modify the |
| 3656 |
<code>utf8Fonts</code> value.</p> |
| 3657 |
|
| 3658 |
<h4><a name="utf8_badcode" id="utf8_badcode">I see question-marks |
| 3659 |
instead of characters in uxterm</a></h4> |
| 3660 |
|
| 3661 |
<p>You may be seeing a question mark in a black diamond, like |
| 3662 |
this:</p> |
| 3663 |
|
| 3664 |
<blockquote> |
| 3665 |
<p>�</p> |
| 3666 |
</blockquote> |
| 3667 |
|
| 3668 |
<p>That is called the Unicode <em>replacement character</em>. It |
| 3669 |
is used when a program is told to display a character which is |
| 3670 |
not in the Unicode system. The program <em>replaces</em> the |
| 3671 |
illegal/invalid character with this symbol. That is different |
| 3672 |
from <em>boxes</em>, which xterm displays when it has nothing in |
| 3673 |
the current font for a valid Unicode character.</p> |
| 3674 |
|
| 3675 |
<p>Unicode's rules are oriented toward handling <em>input</em> in |
| 3676 |
different encodings, and <em>displaying</em> the corresponding |
| 3677 |
Unicode value. Although Unicode has rules and a definition for |
| 3678 |
the valid characters, different programs may handle invalid input |
| 3679 |
in different ways. <a href="bad-utf8/">This page</a> gives an |
| 3680 |
overview of how xterm may differ from other programs in that |
| 3681 |
regard.</p> |
| 3682 |
|
| 3683 |
<h4 id="slow_menus-id"><a name="slow_menus" id="slow_menus">The |
| 3684 |
first popup menu is very slow</a></h4> |
| 3685 |
|
| 3686 |
<p>Some users report that when starting xterm, it is very slow, |
| 3687 |
that their computer's CPU time increases, etc.</p> |
| 3688 |
|
| 3689 |
<p>This is a longstanding bug in the X libraries. There is a |
| 3690 |
workaround using a resource setting for xterm.</p> |
| 3691 |
|
| 3692 |
<h5 id="slow_menus_details-id">Details</h5> |
| 3693 |
|
| 3694 |
<p><strong>XTerm</strong> uses the Athena (Xaw) widgets to |
| 3695 |
display popup menus. In the normal case, those are initialized |
| 3696 |
one-by-one as they are first used. If you have configured xterm |
| 3697 |
to use its toolbar configuration, they are all initialized on |
| 3698 |
startup. In the latter, performance problems are more |
| 3699 |
noticeable.</p> |
| 3700 |
|
| 3701 |
<p>The Athena widgets <code>XawInitializeWidgetSet</code> |
| 3702 |
function goes through several levels down to the X library |
| 3703 |
<code>_XlcAddUtf8LocaleConverters</code> function to call |
| 3704 |
<code>create_tocs_conv</code> and related functions to make a |
| 3705 |
list of character sets from the locale, which is used in menus to |
| 3706 |
get all possible fonts needed for a fontset.</p> |
| 3707 |
|
| 3708 |
<p>If your current locale uses <em>UTF-8</em> encoding, this will |
| 3709 |
read a long list of bitmap fonts—everything whose |
| 3710 |
<em>encoding</em> might be useful for displaying the menus. For |
| 3711 |
example, this list (from <code>lcUTF8.c</code>) which dates from |
| 3712 |
around 2000 is the core of the problem:</p> |
| 3713 |
|
| 3714 |
<blockquote class="code-block"> |
| 3715 |
<p>ISO10646-1, ISO8859-1, ISO8859-2, ISO8859-3, ISO8859-4, |
| 3716 |
ISO8859-5, ISO8859-6, ISO8859-7, ISO8859-8, ISO8859-9, |
| 3717 |
ISO8859-10, ISO8859-11, ISO8859-13, ISO8859-14, ISO8859-15, |
| 3718 |
ISO8859-16, JISX0201.1976-0, TIS620-0, GB2312.1980-0, |
| 3719 |
JISX0208.1983-0, JISX0208.1990-0, JISX0212.1990-0, |
| 3720 |
KSC5601.1987-0, KOI8-R, KOI8-U, KOI8-C, TATAR-CYR, ARMSCII-8, |
| 3721 |
IBM-CP1133, MULELAO-1, VISCII1.1-1, TCVN-5712, |
| 3722 |
GEORGIAN-ACADEMY, GEORGIAN-PS, ISO8859-9E, MICROSOFT-CP1251, |
| 3723 |
MICROSOFT-CP1255, MICROSOFT-CP1256, BIG5-0, BIG5-E0, BIG5-E1, |
| 3724 |
ISO10646-1, ISO10646-1</p> |
| 3725 |
</blockquote> |
| 3726 |
|
| 3727 |
<p>However, xterm is going to use only the characters shown in |
| 3728 |
the popup menus. It is unlikely that you need Chinese fonts for |
| 3729 |
that.</p> |
| 3730 |
|
| 3731 |
<h5 id="slow_menus_solution-id">Solution</h5> |
| 3732 |
|
| 3733 |
<p><strong>XTerm</strong>'s <code>menuLocale</code> resource can |
| 3734 |
be set to an explicit value, e.g., “C” to override |
| 3735 |
the current locale as seen by this initialization debacle.</p> |
| 3736 |
|
| 3737 |
<h5 id="slow_menus_limits-id">Limitations</h5> |
| 3738 |
|
| 3739 |
<p>The workaround does not prevent some hacker from |
| 3740 |
“improving” the X libraries still further.</p> |
| 3741 |
|
| 3742 |
<h3 id="problems_keyboard-id"><a name="problems_keyboard" id= |
| 3743 |
"problems_keyboard">Keyboard problems</a></h3> |
| 3744 |
|
| 3745 |
<h4 id="xterm_8bits-id"><a name="xterm_8bits" id= |
| 3746 |
"xterm_8bits">Why can't I input 8-bit characters?</a></h4> |
| 3747 |
|
| 3748 |
<p>You must have the <code>eightBitInput</code> resource set to |
| 3749 |
do this.</p> |
| 3750 |
|
| 3751 |
<h4 id="xterm_erase-id"><a name="xterm_erase" id= |
| 3752 |
"xterm_erase">Why doesn't my delete key work?</a></h4> |
| 3753 |
|
| 3754 |
<p>This seems to have begun as a problem with the older XFree86 |
| 3755 |
release (3.1.2). I have picked up pieces of the story (xterm and |
| 3756 |
the keyboard work as designed under XFree86 3.2 and up).</p> |
| 3757 |
|
| 3758 |
<p>The underlying problem is that we've accumulated three things |
| 3759 |
that are being equated as “Delete”:</p> |
| 3760 |
|
| 3761 |
<blockquote> |
| 3762 |
<pre class="code-block"> |
| 3763 |
ASCII BS (backspace, code 8) |
| 3764 |
ASCII DEL (delete. code 127) |
| 3765 |
VT220 "remove" aka "delete" (ESC [ 3 ~) |
| 3766 |
</pre> |
| 3767 |
</blockquote> |
| 3768 |
|
| 3769 |
<p>You are probably talking about the <strong>backarrow</strong> |
| 3770 |
key (on my keyboard, at the upper right of the QWERTY block), or |
| 3771 |
the key labeled <strong>delete</strong> which is on the 6-key |
| 3772 |
"editing keypad". Since xterm is emulating a VT100/VT220, the |
| 3773 |
backarrow key should generate a 127 (often displayed as |
| 3774 |
<code>^?</code>). You would use a control/H to obtain a backspace |
| 3775 |
on a real VT220.</p> |
| 3776 |
|
| 3777 |
<p>The reason why <code>BS</code> and <code>DEL</code> are of |
| 3778 |
special interest is that on Unix, the <code>stty</code> command |
| 3779 |
and the underlying termios/termio system calls allow only |
| 3780 |
single-byte codes to be assigned to special functions such as |
| 3781 |
<code>erase</code>. For instance, you could see something like |
| 3782 |
this on your terminal:</p> |
| 3783 |
|
| 3784 |
<blockquote> |
| 3785 |
<pre class="code-block"> |
| 3786 |
$ stty -a |
| 3787 |
speed 38400 baud; rows 40; columns 80; line = 0; |
| 3788 |
intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = <undef>; |
| 3789 |
eol2 = <undef>; swtch = <undef>; start = <undef>; stop = <undef>; susp = <undef>; |
| 3790 |
rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; |
| 3791 |
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts |
| 3792 |
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl ixon -ixoff |
| 3793 |
-iuclc -ixany -imaxbel -iutf8 |
| 3794 |
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 |
| 3795 |
isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt |
| 3796 |
-echoctl -echoke |
| 3797 |
</pre> |
| 3798 |
</blockquote> |
| 3799 |
|
| 3800 |
<p>Tastes differ. On Unix, people expect the backarrow key to |
| 3801 |
generate a backspace (or not). As I understand it, at one point, |
| 3802 |
XFree86 picked up the sense of the erase character during |
| 3803 |
initialization, so that xterm would in effect use the same erase |
| 3804 |
character as the console. The current scheme (X11R6) uses |
| 3805 |
keyboard mapping tables that are independent of the |
| 3806 |
environment.</p> |
| 3807 |
|
| 3808 |
<p>Modern xterm (since <a href= |
| 3809 |
"/xterm/xterm.log.html#xterm_83">patch #83</a> in 1998) provides |
| 3810 |
a resource toggle <em>backarrowKey</em> (and an escape sequence |
| 3811 |
from VT320) that changes this key between the two styles |
| 3812 |
(backspace or delete).</p> |
| 3813 |
|
| 3814 |
<p>With modern xterm <a href= |
| 3815 |
"/xterm/xterm.log.html#xterm_95">patch 95</a> (also in the stable |
| 3816 |
version as “88c”), you may have an xterm which can |
| 3817 |
automatically initialize the backarrow key to backspace or delete |
| 3818 |
depending on the pseudo terminal's sense, or based on the termcap |
| 3819 |
setting of <em>kbs</em> (backspace key). This feature is |
| 3820 |
controlled by the resource setting <em>ptyInitialErase</em>.</p> |
| 3821 |
|
| 3822 |
<h4 id="xterm_erased-id"><a name="xterm_erased" id= |
| 3823 |
"xterm_erased">Why did my delete key stop working?</a></h4> |
| 3824 |
|
| 3825 |
<p>Well, something changed. You have to determine what did.</p> |
| 3826 |
|
| 3827 |
<p>This may be because an upgrade introduced different X resource |
| 3828 |
settings, or because you are using the newer xterm with the |
| 3829 |
<em>ptyInitialErase</em> resource (or perhaps both). Use</p> |
| 3830 |
|
| 3831 |
<blockquote> |
| 3832 |
<pre class="code-block"> |
| 3833 |
appres XTerm |
| 3834 |
</pre> |
| 3835 |
</blockquote> |
| 3836 |
|
| 3837 |
<p>to see the X resources that you are using, in particular the |
| 3838 |
<code>translation</code> (or <code>Translation</code>) resource |
| 3839 |
for the vt100 widget.</p> |
| 3840 |
|
| 3841 |
<p>One unexpected scenario came out of hiding when I was |
| 3842 |
implementing the <em>ptyInitialErase</em> resource. When xterm is |
| 3843 |
(by default) built to support this, it sets the pty's erase |
| 3844 |
character to match the termcap entry. Xterm also sets the |
| 3845 |
$TERMCAP environment variable to match. So everything is |
| 3846 |
consistent, and everything defined. The <code>stty erase</code> |
| 3847 |
character is either backspace (^H) or delete (^?).</p> |
| 3848 |
|
| 3849 |
<p>The problem arises because there are two things called |
| 3850 |
“delete”, which were not well-defined: ASCII delete |
| 3851 |
(127) and the PC-style adaptation of VT220 <kbd>remove</kbd> |
| 3852 |
assigned to the key Delete.</p> |
| 3853 |
|
| 3854 |
<p>However, the <em>screen</em> program prefers to make the |
| 3855 |
termcap delete (<code>kD</code>) an <escape>[3~, which |
| 3856 |
corresponds to the VT220 <kbd>remove</kbd> key. If $TERMCAP is |
| 3857 |
set when starting <em>screen</em>, it will translate stty's erase |
| 3858 |
character into the <escape>[3~, making most curses and |
| 3859 |
termcap applications work. But stty still has the original erase |
| 3860 |
character. So low-level applications which check stty will not |
| 3861 |
work. I found that unsetting $TERMCAP before running would work, |
| 3862 |
but this was not a good solution. Someone pointed out (see |
| 3863 |
<a href="/xterm/xterm.log.html#xterm_129">patch 129</a>), that |
| 3864 |
the problem really was because termcap <code>kD</code> should |
| 3865 |
delete the character at the current position. So it cannot be the |
| 3866 |
same as <code>stty erase</code>.</p> |
| 3867 |
|
| 3868 |
<p>As a matter of fact, <code>stty erase</code> has to be a |
| 3869 |
single character, so <escape>[3~ would not work anyway.</p> |
| 3870 |
|
| 3871 |
<h4 id="xterm_xmodmap-id"><a name="xterm_xmodmap" id= |
| 3872 |
"xterm_xmodmap">Well, how can I set my delete key?</a></h4> |
| 3873 |
|
| 3874 |
<p>When people first started asking this question in 1995-1996, |
| 3875 |
it appeared in the context of making Netscape work. Netscape's |
| 3876 |
use of the delete key running in X did not match user's |
| 3877 |
expectations when compared to that other platform. They were |
| 3878 |
commonly advised to use <em>xmodmap</em>, e.g.,</p> |
| 3879 |
|
| 3880 |
<blockquote> |
| 3881 |
<pre class="code-block"> |
| 3882 |
keysym BackSpace = Delete |
| 3883 |
</pre> |
| 3884 |
</blockquote> |
| 3885 |
|
| 3886 |
<p>or</p> |
| 3887 |
|
| 3888 |
<blockquote> |
| 3889 |
<pre class="code-block"> |
| 3890 |
keycode 22 = 0xff08 |
| 3891 |
</pre> |
| 3892 |
</blockquote> |
| 3893 |
|
| 3894 |
<p>Either way is a bad technical solution – it works for |
| 3895 |
some people but not others (on my keyboard at work, keycode 22 is |
| 3896 |
the numeric keypad '9').</p> |
| 3897 |
|
| 3898 |
<p>Alternatively, you can set resources. This works reasonably |
| 3899 |
well for environments where you have different versions of xterm, |
| 3900 |
e.g.,</p> |
| 3901 |
|
| 3902 |
<blockquote class="code-block"> |
| 3903 |
<!--{{atr2html--> |
| 3904 |
|
| 3905 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 3906 |
<span class="keyword">XTerm</span>*<span class= |
| 3907 |
"keyword">VT100</span>.<span class= |
| 3908 |
"ident2">translations</span>:<span class= |
| 3909 |
"literal"> #override \n\<br> |
| 3910 |
<Key>Delete: string(</span><span class="number">0x7f</span><span class="literal">)</span><br> |
| 3911 |
|
| 3912 |
<!--atr2html}}--></p> |
| 3913 |
</blockquote> |
| 3914 |
|
| 3915 |
<p>I do not do that either, because it is not flexible. Not all |
| 3916 |
programs use the same sense of <code>stty erase</code>; some use |
| 3917 |
termcap or terminfo, and some are hardcoded. So I prefer to be |
| 3918 |
able to switch the xterm's keyboard at runtime. You cannot do |
| 3919 |
that with resources. (Or not really – xterm has a |
| 3920 |
<code>keymap()</code> action which could support this if you |
| 3921 |
provided a rather complex resource settings, but the X library |
| 3922 |
support for that is broken in X11R6). Instead, I have added to |
| 3923 |
xterm a set of resources (and popup menu entries) to allow simple |
| 3924 |
switching between the different styles of keyboard, in particular |
| 3925 |
for the backspace/delete issues. See the manual page for |
| 3926 |
<code>backarrowKey</code> <code>backarrowKeyIsErase</code> and |
| 3927 |
<code>deleteIsDEL</code> as well as <code>sunKeyboard</code>.</p> |
| 3928 |
|
| 3929 |
<h4 id="xterm_keypad-id"><a name="xterm_keypad" id= |
| 3930 |
"xterm_keypad">Why doesn't my keypad work?</a></h4> |
| 3931 |
|
| 3932 |
<p>A few people have commented that the keypad does not work |
| 3933 |
properly. Aside from bugs (I have fixed a few), the most common |
| 3934 |
problem seems to be misconception.</p> |
| 3935 |
|
| 3936 |
<p>Here's a picture of the VT100 numeric keypad:</p> |
| 3937 |
|
| 3938 |
<blockquote> |
| 3939 |
<pre class="code-block"> |
| 3940 |
+-----+-----+-----+-----+ |
| 3941 |
| PF1 | PF2 | PF3 | PF4 | |
| 3942 |
+-----+-----+-----+-----+ |
| 3943 |
| 7 | 8 | 9 | - | |
| 3944 |
+-----+-----+-----+-----+ |
| 3945 |
| 4 | 5 | 6 | , | |
| 3946 |
+-----+-----+-----+-----+ |
| 3947 |
| 1 | 2 | 3 | | |
| 3948 |
+-----+-----+-----+ ENT + |
| 3949 |
| 0 | . | | |
| 3950 |
+-----+-----+-----+-----+ |
| 3951 |
</pre> |
| 3952 |
</blockquote> |
| 3953 |
|
| 3954 |
<p>and the similar Sun and PC keypads:</p> |
| 3955 |
|
| 3956 |
<blockquote> |
| 3957 |
<pre class="code-block"> |
| 3958 |
+-----+-----+-----+-----+ |
| 3959 |
| NUM | / | * | - | |
| 3960 |
+-----+-----+-----+-----+ |
| 3961 |
| 7 | 8 | 9 | | |
| 3962 |
+-----+-----+-----+ + + |
| 3963 |
| 4 | 5 | 6 | | |
| 3964 |
+-----+-----+-----+-----+ |
| 3965 |
| 1 | 2 | 3 | | |
| 3966 |
+-----+-----+-----+ ENT + |
| 3967 |
| 0 | . | | |
| 3968 |
+-----+-----+-----+-----+ |
| 3969 |
</pre> |
| 3970 |
</blockquote> |
| 3971 |
|
| 3972 |
<p>Working in X11, the NUM (NumLock) key has better uses than an |
| 3973 |
alias for PF1 (and is sometimes reserved). I use the F1 through |
| 3974 |
F4 on the keyboard to implement PF1 through PF4, alias the keypad |
| 3975 |
"+" to "," and use the existing "-" key.</p> |
| 3976 |
|
| 3977 |
<p>VT220 emulation uses the VT100 numeric keypad as well as a |
| 3978 |
6-key editing keypad. Here's a picture of the VT220 editing |
| 3979 |
keypad:</p> |
| 3980 |
|
| 3981 |
<blockquote> |
| 3982 |
<pre class="code-block"> |
| 3983 |
+--------+--------+--------+ |
| 3984 |
| Find | Insert | Remove | |
| 3985 |
+--------+--------+--------+ |
| 3986 |
| Select | Prev | Next | |
| 3987 |
+--------+--------+--------+ |
| 3988 |
</pre> |
| 3989 |
</blockquote> |
| 3990 |
|
| 3991 |
<p>and the similar Sun and PC keypads:</p> |
| 3992 |
|
| 3993 |
<blockquote> |
| 3994 |
<pre class="code-block"> |
| 3995 |
+--------+--------+--------+ |
| 3996 |
| Insert | Home | PageUp | |
| 3997 |
+--------+--------+--------+ |
| 3998 |
| Delete | End | PageDn | |
| 3999 |
+--------+--------+--------+ |
| 4000 |
</pre> |
| 4001 |
</blockquote> |
| 4002 |
|
| 4003 |
<p>I chose to use keys that are mnemonic rather than in the |
| 4004 |
“same” positions, though some emulators (e.g., Tera |
| 4005 |
Term) use the same positions:</p> |
| 4006 |
|
| 4007 |
<blockquote> |
| 4008 |
<pre class="code-block"> |
| 4009 |
+--------+--------+--------+ |
| 4010 |
| Insert | Find | Prev | |
| 4011 |
+--------+--------+--------+ |
| 4012 |
| Remove | Select | Next | |
| 4013 |
+--------+--------+--------+ |
| 4014 |
</pre> |
| 4015 |
</blockquote> |
| 4016 |
|
| 4017 |
<p>I test the keyboard (for VT52/VT100/VT220) using <a href= |
| 4018 |
"/vttest/vttest.html">vttest</a>. If you find (or think that you |
| 4019 |
have found) a problem with the keyboard handling of xterm, please |
| 4020 |
test it with vttest first.</p> |
| 4021 |
|
| 4022 |
<p>Other arrangements of the keyboard are possible of course. If |
| 4023 |
you prefer to use the top row of the numeric keypad as PF1 |
| 4024 |
through PF4, you should do this using xterm's X resources.</p> |
| 4025 |
|
| 4026 |
<p>In 2014, I noticed <a href= |
| 4027 |
"https://www.neilvandyke.org/racket-charterm/">a comment</a>, |
| 4028 |
which relates to the PF1-PF4 assignment, but also to the use of |
| 4029 |
function-key modifiers.<br> |
| 4030 |
Because that is a digression, I have expanded it in a <a href= |
| 4031 |
"/xterm/xterm-function-keys.html">separate page</a>.</p> |
| 4032 |
|
| 4033 |
<h4 id="xterm_modother-id"><a name="xterm_modother" id= |
| 4034 |
"xterm_modother">How can my program distinguish control-I from |
| 4035 |
tab?</a></h4> |
| 4036 |
|
| 4037 |
<p>Your program can use xterm's <a href= |
| 4038 |
"manpage/xterm.html#VT100-Widget-Resources:modifyOtherKeys">modifyOtherKeys</a> |
| 4039 |
feature, e.g., using a <a name= |
| 4040 |
"h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-gt-Pp;Pv-m.1EB3" |
| 4041 |
id= |
| 4042 |
"h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-gt-Pp;Pv-m.1EB3"> |
| 4043 |
control sequence</a> such as</p> |
| 4044 |
|
| 4045 |
<blockquote> |
| 4046 |
<pre class="code-block"> |
| 4047 |
\033 [ > 4 ; 2 m |
| 4048 |
</pre> |
| 4049 |
</blockquote> |
| 4050 |
|
| 4051 |
<p>to temporarily switch into a mode where shift, alt, control |
| 4052 |
and meta modifiers applied to a key tell xterm to send an escape |
| 4053 |
sequence which encodes all of that information. The <tt>tab</tt> |
| 4054 |
key would send a <em>tab</em>, but |
| 4055 |
<em>control-<strong>i</strong></em> would send</p> |
| 4056 |
|
| 4057 |
<blockquote> |
| 4058 |
<pre class="code-block"> |
| 4059 |
\033 [ 2 7 ; 5 ; 1 0 5 ~ |
| 4060 |
</pre> |
| 4061 |
</blockquote> |
| 4062 |
|
| 4063 |
<p>while <em>control-shift-<strong>i</strong></em> would send</p> |
| 4064 |
|
| 4065 |
<blockquote> |
| 4066 |
<pre class="code-block"> |
| 4067 |
\033 [ 2 7 ; 6 ; 7 3 ~ |
| 4068 |
</pre> |
| 4069 |
</blockquote> |
| 4070 |
|
| 4071 |
<p>Your program should turn that off when it is not needed; it is |
| 4072 |
a real nuisance when you cannot type control-characters as they |
| 4073 |
were meant to be used:</p> |
| 4074 |
|
| 4075 |
<blockquote> |
| 4076 |
<pre class="code-block"> |
| 4077 |
\033 [ > 4 m |
| 4078 |
</pre> |
| 4079 |
</blockquote> |
| 4080 |
|
| 4081 |
<p>In 2019, Bram Moolenaar asked for more details about modifying |
| 4082 |
<em>other keys</em>; I have expanded that in a <a href= |
| 4083 |
"/xterm/modified-keys.html">separate page</a>.</p> |
| 4084 |
|
| 4085 |
<h4 id="xterm_pageup-id"><a name="xterm_pageup" id= |
| 4086 |
"xterm_pageup">Why can't I use the pageup/pagedown keys?</a></h4> |
| 4087 |
|
| 4088 |
<p>Some vendors, e.g,. Sun, added key translations which make the |
| 4089 |
pageup and pagedown keys talk to the xterm's scrollbar instead of |
| 4090 |
your application. They did the same thing for the home and end |
| 4091 |
keys, thereby obscuring a bug in <a href= |
| 4092 |
"xterm.faq.html#bug_xterm_r6">xterm</a>.</p> |
| 4093 |
|
| 4094 |
<p>You can override this by specifying your own translations in |
| 4095 |
your resource file. The issue was first noted with Solaris 2.5, |
| 4096 |
with the file given in two locations:</p> |
| 4097 |
|
| 4098 |
<blockquote> |
| 4099 |
<pre class="code-block"> |
| 4100 |
/usr/lib/X11/app-defaults/XTerm |
| 4101 |
/usr/openwin/lib/app-defaults |
| 4102 |
</pre> |
| 4103 |
</blockquote> |
| 4104 |
|
| 4105 |
<p>using a symbolic link to relate the two. Later releases of |
| 4106 |
Solaris, e.g., 8-10 omitted the former location.<br> |
| 4107 |
Solaris 11 provides modern xterm (<a href= |
| 4108 |
"/xterm/xterm.log.html#xterm_271">patch #271</a>), and does not |
| 4109 |
have this problem.</p> |
| 4110 |
|
| 4111 |
<p>As of February 2014, I was able to verify that AIX and HPUX |
| 4112 |
have updated to modern xterm, e.g.,</p> |
| 4113 |
|
| 4114 |
<ul> |
| 4115 |
<li> |
| 4116 |
<p><a href="/xterm/xterm.log.html#xterm_180">patch #180</a> |
| 4117 |
on HPUX 11.31,</p> |
| 4118 |
</li> |
| 4119 |
|
| 4120 |
<li> |
| 4121 |
<p><a href="/xterm/xterm.log.html#xterm_222">patch #222</a> |
| 4122 |
on AIX 6.1 and 7.1,</p> |
| 4123 |
</li> |
| 4124 |
</ul> |
| 4125 |
|
| 4126 |
<p>Older AIX and HPUX releases distributed the X Consortium |
| 4127 |
(1994) app-defaults file.</p> |
| 4128 |
|
| 4129 |
<blockquote> |
| 4130 |
<p style="font-variant:small-caps">In updating this question in |
| 4131 |
February 2014, I noticed that IBM added their copyright notice |
| 4132 |
in AIX's copy of the app-defaults file in</p> |
| 4133 |
|
| 4134 |
<blockquote> |
| 4135 |
<pre class="code-block"> |
| 4136 |
/usr/lpp/X11/lib/X11/app-defaults |
| 4137 |
</pre> |
| 4138 |
</blockquote> |
| 4139 |
|
| 4140 |
<p style="font-variant:small-caps">There were no other changes |
| 4141 |
to the file. Someone at IBM blundered.<br> |
| 4142 |
In patch #252, I ensured that my copyright notice is on those |
| 4143 |
files (I am the sole author, and can do that).</p> |
| 4144 |
</blockquote> |
| 4145 |
|
| 4146 |
<p>Use the translations in the system's app-defaults file as a |
| 4147 |
guide. The relevant section of the app-default file looks |
| 4148 |
like</p> |
| 4149 |
|
| 4150 |
<blockquote class="code-block"> |
| 4151 |
<!--{{atr2html--> |
| 4152 |
|
| 4153 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 4154 |
*<span class="keyword">VT100</span>.<span class= |
| 4155 |
"ident2">translations</span>:<span class= |
| 4156 |
"literal"> #override \<br> |
| 4157 |
@Num_Lock</span><span class="keyword"><Key></span><span class="literal">KP_0: string(</span><span class="number">0</span><span class="literal">)\n\<br> |
| 4158 |
|
| 4159 |
@Num_Lock</span><span class="keyword"><Key></span><span class="literal">KP_1: string(</span><span class="number">1</span><span class="literal">)\n\<br> |
| 4160 |
|
| 4161 |
@Num_Lock</span><span class="keyword"><Key></span><span class="literal">KP_2: string(</span><span class="number">2</span><span class="literal">)\n\<br> |
| 4162 |
|
| 4163 |
@Num_Lock</span><span class="keyword"><Key></span><span class="literal">KP_3: string(</span><span class="number">3</span><span class="literal">)\n\<br> |
| 4164 |
|
| 4165 |
@Num_Lock</span><span class="keyword"><Key></span><span class="literal">KP_4: string(</span><span class="number">4</span><span class="literal">)\n\<br> |
| 4166 |
|
| 4167 |
@Num_Lock</span><span class="keyword"><Key></span><span class="literal">KP_5: string(</span><span class="number">5</span><span class="literal">)\n\<br> |
| 4168 |
|
| 4169 |
@Num_Lock</span><span class="keyword"><Key></span><span class="literal">KP_6: string(</span><span class="number">6</span><span class="literal">)\n\<br> |
| 4170 |
|
| 4171 |
@Num_Lock</span><span class="keyword"><Key></span><span class="literal">KP_7: string(</span><span class="number">7</span><span class="literal">)\n\<br> |
| 4172 |
|
| 4173 |
@Num_Lock</span><span class="keyword"><Key></span><span class="literal">KP_8: string(</span><span class="number">8</span><span class="literal">)\n\<br> |
| 4174 |
|
| 4175 |
@Num_Lock</span><span class="keyword"><Key></span><span class="literal">KP_9: string(</span><span class="number">9</span><span class="literal">)\n\<br> |
| 4176 |
|
| 4177 |
@Num_Lock</span><span class="keyword"><Key></span><span class="literal">KP_Add: string(+)\n\<br> |
| 4178 |
|
| 4179 |
@Num_Lock</span><span class="keyword"><Key></span><span class="literal">KP_Decimal: string(.)\n\<br> |
| 4180 |
|
| 4181 |
@Num_Lock</span><span class="keyword"><Key></span><span class="literal">KP_Divide: string(/)\n\<br> |
| 4182 |
|
| 4183 |
@Num_Lock</span><span class="keyword"><Key></span><span class="literal">KP_Enter: string(\015)\n\<br> |
| 4184 |
|
| 4185 |
@Num_Lock</span><span class="keyword"><Key></span><span class="literal">KP_Equal: string(=)\n\<br> |
| 4186 |
|
| 4187 |
@Num_Lock</span><span class="keyword"><Key></span><span class="literal">KP_Multiply: string(*)\n\<br> |
| 4188 |
|
| 4189 |
@Num_Lock</span><span class="keyword"><Key></span><span class="literal">KP_Subtract: string(-)\n\<br> |
| 4190 |
|
| 4191 |
</span><span class="keyword"><Key></span><span class="literal">Prior:scroll-back(</span><span class="number">1</span><span class="literal">,page)\n\<br> |
| 4192 |
|
| 4193 |
</span><span class="keyword"><Key></span><span class="literal">Next:scroll-forw(</span><span class="number">1</span><span class="literal">,page)\n\<br> |
| 4194 |
|
| 4195 |
</span><span class="keyword"><Key></span><span class="literal">F16: start-extend() select-end(PRIMARY, CUT_BUFFER0, CLIPBOARD) \n\<br> |
| 4196 |
|
| 4197 |
</span><span class="keyword"><Key></span><span class="literal">F18: insert-selection(PRIMARY, CLIPBOARD) \n\<br> |
| 4198 |
|
| 4199 |
</span><span class="keyword"><Key></span><span class="literal">F27: scroll-back(</span><span class="number">100</span><span class="literal">,page) \n\<br> |
| 4200 |
|
| 4201 |
</span><span class="keyword"><Key></span><span class="literal">R13: scroll-forw(</span><span class="number">100</span><span class="literal">,page) \n\<br> |
| 4202 |
|
| 4203 |
</span><span class="keyword"><Key></span><span class="literal">Home: scroll-back(</span><span class="number">100</span><span class="literal">,page) \n\<br> |
| 4204 |
|
| 4205 |
</span><span class="keyword"><Key></span><span class="literal">End: scroll-forw(</span><span class="number">100</span><span class="literal">,page) \n</span><br> |
| 4206 |
|
| 4207 |
<!--atr2html}}--></p> |
| 4208 |
</blockquote> |
| 4209 |
|
| 4210 |
<p>For example, a more-specific pattern for the resource name |
| 4211 |
lets you override:</p> |
| 4212 |
|
| 4213 |
<blockquote class="code-block"> |
| 4214 |
<!--{{atr2html--> |
| 4215 |
|
| 4216 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 4217 |
<span class="keyword">XTerm</span>*<span class= |
| 4218 |
"keyword">VT100</span>.<span class= |
| 4219 |
"ident2">translations</span>:<span class= |
| 4220 |
"literal"> #override \n\<br> |
| 4221 |
|
| 4222 |
~Shift</span><span class="keyword"><Key></span><span class="literal">Home: string(\033[</span><span class="number">1</span><span class="literal">~)\n\<br> |
| 4223 |
|
| 4224 |
~Shift</span><span class="keyword"><Key></span><span class="literal">End: string(\033[</span><span class="number">4</span><span class="literal">~)\n\<br> |
| 4225 |
|
| 4226 |
~Shift</span><span class="keyword"><Key></span><span class="literal">Prior: string(\033[</span><span class="number">5</span><span class="literal">~)\n\<br> |
| 4227 |
|
| 4228 |
~Shift</span><span class="keyword"><Key></span><span class="literal">Next: string(\033[</span><span class="number">6</span><span class="literal">~)\n\<br> |
| 4229 |
|
| 4230 |
Shift</span><span class="keyword"><Key></span><span class="literal">Prior: scroll-back(</span><span class="number">1</span><span class="literal">,page) \n\<br> |
| 4231 |
|
| 4232 |
Shift</span><span class="keyword"><Key></span><span class="literal">Next: scroll-forw(</span><span class="number">1</span><span class="literal">,page) \n\<br> |
| 4233 |
|
| 4234 |
Shift</span><span class="keyword"><Key></span><span class="literal">Home: scroll-back(</span><span class="number">100</span><span class="literal">,page) \n\<br> |
| 4235 |
|
| 4236 |
Shift</span><span class="keyword"><Key></span><span class="literal">End: scroll-forw(</span><span class="number">100</span><span class="literal">,page) \n</span><br> |
| 4237 |
|
| 4238 |
<!--atr2html}}--></p> |
| 4239 |
</blockquote> |
| 4240 |
|
| 4241 |
<p>makes the home/end and pageup/pagedown keys usable by your |
| 4242 |
editor, while leaving their shifted equivalents available for the |
| 4243 |
scrollbar.</p> |
| 4244 |
|
| 4245 |
<h4 id="xterm_pc_style-id"><a name="xterm_pc_style" id= |
| 4246 |
"xterm_pc_style">Why can't I use the home/end keys?</a></h4> |
| 4247 |
|
| 4248 |
<p>This is a long story, unless you are referring to X Consortium |
| 4249 |
<a href="#bug_xterm_r6">xterm</a>. That program is simply broken |
| 4250 |
in this respect.</p> |
| 4251 |
|
| 4252 |
<p>At the beginning, when the home/end keys were fixed for modern |
| 4253 |
xterm (in early 1996), there was some discussion regarding what |
| 4254 |
the escape sequences should be for those keys (for the 6-key |
| 4255 |
editing keypad). Those were chosen as "PC-style" codes (like SCO |
| 4256 |
“ansi”), i.e.,</p> |
| 4257 |
|
| 4258 |
<blockquote> |
| 4259 |
<pre class="code-block"> |
| 4260 |
ESC [ H |
| 4261 |
ESC [ F |
| 4262 |
</pre> |
| 4263 |
</blockquote> |
| 4264 |
|
| 4265 |
<p>for normal mode, and</p> |
| 4266 |
|
| 4267 |
<blockquote> |
| 4268 |
<pre class="code-block"> |
| 4269 |
ESC O H |
| 4270 |
ESC O F |
| 4271 |
</pre> |
| 4272 |
</blockquote> |
| 4273 |
|
| 4274 |
<p>for cursor application mode.</p> |
| 4275 |
|
| 4276 |
<p>That style of coding fit easily into the existing logic of |
| 4277 |
xterm. It was not my change, and (because xterm should be based |
| 4278 |
upon standards), I did question this, and asked the opinion of |
| 4279 |
the person who was at that time developing rxvt. He had chosen a |
| 4280 |
layout based on DEC's VT220 terminals, though the key labels on |
| 4281 |
the typical PC keyboard did not <a href= |
| 4282 |
"xterm.faq.html#xterm_keypad">match</a>. At that point, neither |
| 4283 |
of us knew enough to make a good case for this.</p> |
| 4284 |
|
| 4285 |
<p>Somewhat later I could see that xterm had a number of |
| 4286 |
undocumented extensions to support the VT220-style (pre-ISO 2022) |
| 4287 |
character sets. I decided to complete the functionality by making |
| 4288 |
xterm a VT220 emulator. This would require that it provide the |
| 4289 |
same escape sequences for the editing and numeric keypads. I |
| 4290 |
could not simply change the escape sequences from "PC-style" to |
| 4291 |
"VT220-style", since a number of users “knew” that |
| 4292 |
the keypad "ought to" send home, end, cursor keys, etc., because |
| 4293 |
they had labels indicating that use. To retain compatibility (but |
| 4294 |
allow easy reconfiguration to make a VT220 emulator), I added |
| 4295 |
popup-menu items to switch between the modes. With minor |
| 4296 |
refinements, this was the approach for about two years, |
| 4297 |
culminating with the <a href= |
| 4298 |
"/xterm/xterm.log.html#xterm_88">“stable” patch |
| 4299 |
#88</a>, which is essentially the version distributed with |
| 4300 |
XFree86 3.3.x.</p> |
| 4301 |
|
| 4302 |
<dl> |
| 4303 |
<dt><em>NOTE</em>:</dt> |
| 4304 |
|
| 4305 |
<dd> |
| 4306 |
the terminfo distributed with xterm patch #88 is incorrect: |
| 4307 |
the escape sequences given for home/end keys are the |
| 4308 |
VT220-style, rather than the default PC-style. Too accustomed |
| 4309 |
to switching modes on the fly, I overlooked a line in my |
| 4310 |
.Xdefaults file: |
| 4311 |
<blockquote class="code-block"> |
| 4312 |
<!--{{atr2html--> |
| 4313 |
|
| 4314 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 4315 |
*<span class="ident2">sunKeyboard</span>:<span class= |
| 4316 |
"literal"> </span><span class= |
| 4317 |
"keyword">true</span><br> |
| 4318 |
<!--atr2html}}--></p> |
| 4319 |
</blockquote> |
| 4320 |
|
| 4321 |
<p>Downstream packagers (when they noticed this) accommodated |
| 4322 |
the bug by modifying the VT100 translations resource which is |
| 4323 |
not a good technical solution since it interferes with the |
| 4324 |
users' ability to modify that resource. For example, Red Hat |
| 4325 |
bug <a href= |
| 4326 |
"https://bugzilla.redhat.com/show_bug.cgi?id=100695">#100695</a> |
| 4327 |
quoted a suggested <a href= |
| 4328 |
"https://bugzilla.redhat.com/attachment.cgi?id=93107&action=diff"> |
| 4329 |
patch</a> which shows that the package had overridden the |
| 4330 |
xterm behavior for shifted function keys. See <a href= |
| 4331 |
"xterm.faq.html#xterm_xmodmap">this</a> for more |
| 4332 |
discussion.</p> |
| 4333 |
</dd> |
| 4334 |
</dl> |
| 4335 |
|
| 4336 |
<p>But xterm continues to evolve past the stable patch #88. The |
| 4337 |
keyboard support was still unsatisfactory for two reasons:</p> |
| 4338 |
|
| 4339 |
<ul> |
| 4340 |
<li> |
| 4341 |
<p>some users wanted to be able to use applications that |
| 4342 |
detected whether the control key was pressed (e.g., |
| 4343 |
control/F1).</p> |
| 4344 |
</li> |
| 4345 |
|
| 4346 |
<li> |
| 4347 |
<p>the compromises made for <code>xkb</code> with X11R6 |
| 4348 |
interfered with xterm's use of the NumLock key for the |
| 4349 |
numeric keypad.</p> |
| 4350 |
</li> |
| 4351 |
</ul> |
| 4352 |
|
| 4353 |
<p>The former could be addressed by expanding the escape |
| 4354 |
sequences sent by the PC-style function keys, while the latter |
| 4355 |
was a VT100/VT220 design issue. I decided to redesign |
| 4356 |
function-key support to separate the two styles of function keys |
| 4357 |
better, but leaving the choice still controlled by the |
| 4358 |
<code>sunKeyboard</code> resource. Partway through that, I was |
| 4359 |
asked to do similar cleanup and redesign of the backspace and |
| 4360 |
delete key handling, e.g., the <a href= |
| 4361 |
"xterm.faq.html#xterm_erased">ptyInitialErase</a> resource. |
| 4362 |
Because it is a redesign, I chose to not make the keyboard |
| 4363 |
differences between the old and new xterms completely compatible. |
| 4364 |
If you were to run both on the same system, one or the other |
| 4365 |
would have some problems with the editing keypad or the |
| 4366 |
backspace/delete keys which would be addressed by the popup-menu |
| 4367 |
selections.</p> |
| 4368 |
|
| 4369 |
<p>For example, at this time (2001/9/4):</p> |
| 4370 |
|
| 4371 |
<ul> |
| 4372 |
<li> |
| 4373 |
<p>Debian stable is xterm-88c, which should be identical to |
| 4374 |
the XFree86 3.3.6 version, but is not (there are some label |
| 4375 |
differences in the resource-file, but nothing interesting |
| 4376 |
relative to home/end keys). And of course, Debian changes the |
| 4377 |
terminfo <code>kbs</code> from <code>^H</code> to |
| 4378 |
<code>^?</code>. As noted, the terminfo I wrote for XFree86 |
| 4379 |
3.3.x has an error. Setting</p> |
| 4380 |
|
| 4381 |
<blockquote class="code-block"> |
| 4382 |
<!--{{atr2html--> |
| 4383 |
|
| 4384 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 4385 |
*<span class="ident2">sunKeyboard</span>:<span class= |
| 4386 |
"literal"> </span><span class= |
| 4387 |
"keyword">true</span><br> |
| 4388 |
<!--atr2html}}--></p> |
| 4389 |
</blockquote> |
| 4390 |
|
| 4391 |
<p>in the app-defaults file fixes the problem with xterm-88, |
| 4392 |
which was that I documented in the terminfo the behavior |
| 4393 |
<em>with</em> that resource set. Similarly, setting</p> |
| 4394 |
|
| 4395 |
<blockquote class="code-block"> |
| 4396 |
<!--{{atr2html--> |
| 4397 |
|
| 4398 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 4399 |
*<span class="ident2">backarrowKey</span>:<span class= |
| 4400 |
"literal"> </span><span class= |
| 4401 |
"keyword">false</span><br> |
| 4402 |
<!--atr2html}}--></p> |
| 4403 |
</blockquote> |
| 4404 |
|
| 4405 |
<p>is one way to address Debian's change to |
| 4406 |
<code>kbs</code>.</p> |
| 4407 |
</li> |
| 4408 |
|
| 4409 |
<li> |
| 4410 |
<p>Debian unstable is xterm-149. Other than omitting the |
| 4411 |
color resources from the app-defaults file, I see that it |
| 4412 |
sets</p> |
| 4413 |
|
| 4414 |
<blockquote class="code-block"> |
| 4415 |
<!--{{atr2html--> |
| 4416 |
|
| 4417 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 4418 |
*<span class= |
| 4419 |
"ident2">backarrowKeyIsErase</span>:<span class= |
| 4420 |
"literal"> </span><span class= |
| 4421 |
"keyword">true</span><br> |
| 4422 |
<!--atr2html}}--></p> |
| 4423 |
</blockquote> |
| 4424 |
|
| 4425 |
<p>which would not affect the home/end keys. (The color |
| 4426 |
resources are redundant, so that is not a problem |
| 4427 |
either).</p> |
| 4428 |
</li> |
| 4429 |
</ul> |
| 4430 |
|
| 4431 |
<p><a href="/xterm/XTerm-debian-88c">Here is a resource file</a> |
| 4432 |
which I tested with xterm-88c, xterm-149 and xterm-158, using |
| 4433 |
$TERM set to xterm-debian:</p> |
| 4434 |
|
| 4435 |
<blockquote class="code-block"> |
| 4436 |
<!--{{atr2html--> |
| 4437 |
|
| 4438 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 4439 |
<span class="comment">! $Id: xterm.faq.html,v 1.169 |
| 4440 |
2012/02/05 11:58:56 tom Exp $<br></span><span class= |
| 4441 |
"comment">! Settings to make xterm-88c work as expected for Debian.<br> |
| 4442 |
</span> <span class="comment">!<br></span><span class= |
| 4443 |
"comment">! Patch #88 was the basis for XFree86 3.3.1 xterm. There were a few additions<br> |
| 4444 |
</span> <span class= |
| 4445 |
"comment">! through patch 88c, to incorporate the ptyInitialErase resource. Debian uses<br> |
| 4446 |
</span> <span class= |
| 4447 |
"comment">! the VT220-style keyboard, which at #88 was the xterm-xfree86 terminfo entry,<br> |
| 4448 |
</span> <span class= |
| 4449 |
"comment">! with one change: kbs changed from ^H to ^?.<br> |
| 4450 |
</span> <span class="comment">!<br></span><span class= |
| 4451 |
"comment">! After patch 88, I started work on keyboard changes. The result was that the<br> |
| 4452 |
</span> <span class= |
| 4453 |
"comment">! xterm-xfree86 terminfo entry was set to the PC-style keyboard, and I added<br> |
| 4454 |
</span> <span class= |
| 4455 |
"comment">! xterm-vt220, which corresponded mostly to the older (patch-88) version of the<br> |
| 4456 |
</span> <span class= |
| 4457 |
"comment">! xterm-xfree86 terminfo entry.<br></span> <br> |
| 4458 |
|
| 4459 |
<span class= |
| 4460 |
"comment">! The terminfo with patch #88 assumed sunKeyboard was set (actually a bug, but<br> |
| 4461 |
</span> <span class= |
| 4462 |
"comment">! also assumed in Debian).<br></span><span class="comment">!<br> |
| 4463 |
</span> <span class= |
| 4464 |
"comment">! A different problem (addressed after patch #88) is that if you wanted to use<br> |
| 4465 |
</span> <span class= |
| 4466 |
"comment">! a VT100/VT220-style numeric keypad's escape sequences, you had to have<br> |
| 4467 |
</span> <span class= |
| 4468 |
"comment">! NumLock set. Otherwise, in keypad application mode, the keys would transmit<br> |
| 4469 |
</span> <span class= |
| 4470 |
"comment">! only the PC-style escape sequences corresponding to the key labels, e.g., the<br> |
| 4471 |
</span> <span class= |
| 4472 |
"comment">! page-up string rather than the escape sequence for keypad-9.<br> |
| 4473 |
</span> <span class="keyword">XTerm</span>*<span class= |
| 4474 |
"ident2">sunKeyboard</span>:<span class= |
| 4475 |
"literal"> </span><span class="keyword">true</span><br> |
| 4476 |
<br> |
| 4477 |
<span class= |
| 4478 |
"comment">! These settings overlap to some extent (backarrowKeys says to send a 127 for<br> |
| 4479 |
</span> <span class= |
| 4480 |
"comment">! the "backspace" key, and ptyInitialErase says to use the pty's initial sense<br> |
| 4481 |
</span> <span class= |
| 4482 |
"comment">! of the erase character, which is reported to be the same on Linux).<br> |
| 4483 |
</span> <span class="keyword">XTerm</span>*<span class= |
| 4484 |
"ident2">backarrowKey</span>:<span class= |
| 4485 |
"literal"> </span><span class="keyword">false</span><br> |
| 4486 |
<span class="keyword">XTerm</span>*<span class= |
| 4487 |
"ident2">ptyInitialErase</span>:<span class= |
| 4488 |
"literal"> </span><span class="keyword">true</span><br> |
| 4489 |
<!--atr2html}}--></p> |
| 4490 |
</blockquote> |
| 4491 |
|
| 4492 |
<h4 id="xterm_arrows-id"><a name="xterm_arrows" id= |
| 4493 |
"xterm_arrows">Why can't I use the cursor keys in (whatever) |
| 4494 |
shell?</a></h4> |
| 4495 |
|
| 4496 |
<p>VTxxx (VT100 and up) terminals may send different escape |
| 4497 |
sequences for the cursor (arrow) keys depending on how they are |
| 4498 |
set up. The choices are referred to as the normal and application |
| 4499 |
modes. Initially, the terminal is in normal mode.</p> |
| 4500 |
|
| 4501 |
<p>VTxxx terminals are usually set up so that full-screen |
| 4502 |
applications will use the cursor application mode strings. This |
| 4503 |
is good for full-screen applications, including legacy |
| 4504 |
applications which may have hard-coded behavior, but bad for |
| 4505 |
interactive shells (e.g., ksh, tcsh, bash) which use arrow keys |
| 4506 |
to scroll through a history of command strings.</p> |
| 4507 |
|
| 4508 |
<p>To see the difference between normal/application modes, |
| 4509 |
consider this example:</p> |
| 4510 |
|
| 4511 |
<ul> |
| 4512 |
<li> |
| 4513 |
<p>In normal (non-application) mode, the terminal transmits a |
| 4514 |
down-arrow as \E[C, which happens to echo as a |
| 4515 |
down-arrow.</p> |
| 4516 |
</li> |
| 4517 |
|
| 4518 |
<li> |
| 4519 |
<p>In application mode the terminal transmits \EOC, which |
| 4520 |
echoes as C. That is because the \EO is the SS3 control, |
| 4521 |
which says to use the character from the G3 character set for |
| 4522 |
the next cell.</p> |
| 4523 |
</li> |
| 4524 |
</ul> |
| 4525 |
|
| 4526 |
<p>Since termcaps and terminfo descriptions are written for |
| 4527 |
full-screen applications, shells and similar programs often rely |
| 4528 |
on built-in tables of escape sequences which they use instead. |
| 4529 |
Defining keys in terms of the termcap/terminfo entry (e.g., by |
| 4530 |
capturing the string sent by tputs) is apt to confuse the |
| 4531 |
shell.</p> |
| 4532 |
|
| 4533 |
<p>Depending on the terminal type, the keypad(s) on the keyboard |
| 4534 |
may switch modes along with the cursor keys, or have their own |
| 4535 |
independent modes. The control sequences for these are |
| 4536 |
independent of the ones used for cursor-addressing, but are |
| 4537 |
grouped together, e.g., as the terminfo <code>smkx</code> and |
| 4538 |
<code>rmkx</code> capabilities. Terminfo entries are written |
| 4539 |
assuming that the application has initialized the terminal using |
| 4540 |
the <code>smkx</code> string before it is able to match the codes |
| 4541 |
given for the cursor or keypad keys.</p> |
| 4542 |
|
| 4543 |
<h4 id="bash_meta_mode-id"><a name="bash_meta_mode" id= |
| 4544 |
"bash_meta_mode">Alt-keys do not work in bash</a></h4> |
| 4545 |
|
| 4546 |
<p>See <a href= |
| 4547 |
"/ncurses/ncurses.faq.html#bash_meta_mode">Alt-keys do not work |
| 4548 |
in bash</a>.</p> |
| 4549 |
|
| 4550 |
<h3 id="problems_colors-id"><a name="problems_colors" id= |
| 4551 |
"problems_colors">Colors and other graphic rendition</a></h3> |
| 4552 |
|
| 4553 |
<h4 id="no_color-id"><a name="no_color" id="no_color">My terminal |
| 4554 |
doesn't recognize color</a></h4> |
| 4555 |
|
| 4556 |
<p>First, ensure that you have set up xterm to render color. |
| 4557 |
Modern xterm renders color only if you have set resources to do |
| 4558 |
this; the default behavior is monochrome to maintain |
| 4559 |
compatibility with older applications. The manual page describes |
| 4560 |
these resources. I set them in my <a href= |
| 4561 |
"xterm.faq.html#my_xdefaults">.Xdefaults</a> file.</p> |
| 4562 |
|
| 4563 |
<p>Even if you set the resources properly, there may be another |
| 4564 |
application running which prevents xterm from allocating the |
| 4565 |
colors you have specified. But you should see a <a href= |
| 4566 |
"xterm.faq.html#alloc_color">warning message</a> for this.</p> |
| 4567 |
|
| 4568 |
<p>Check the terminal description, to see if it is installed |
| 4569 |
properly, e.g., for <a href= |
| 4570 |
"/ncurses/ncurses.faq.html#no_color">ncurses</a>, which uses |
| 4571 |
terminfo.</p> |
| 4572 |
|
| 4573 |
<p>Finally, some applications (that do not interface properly |
| 4574 |
with terminfo or termcap) may need the environment variable |
| 4575 |
<a href="/ncurses/ncurses.faq.html#no_colorterm">$COLORTERM</a> |
| 4576 |
to be set.</p> |
| 4577 |
|
| 4578 |
<h4 id="xterm_terminfo-id"><a name="xterm_terminfo" id= |
| 4579 |
"xterm_terminfo">What $TERM should I use?</a></h4> |
| 4580 |
|
| 4581 |
<p><strong>XTerm</strong> provides in its sources both <a href= |
| 4582 |
"terminfo.html">terminfo</a> and <a href= |
| 4583 |
"termcap.html">termcap</a> files. They are designed to allow |
| 4584 |
scripting to override the most common choices, e.g., the |
| 4585 |
backspace key.</p> |
| 4586 |
|
| 4587 |
<p>The <code>xterm-color</code> value for $TERM is a bad choice |
| 4588 |
for modern xterm because it is commonly used for a terminfo entry |
| 4589 |
which happens to not support <code>bce</code>. Complicating |
| 4590 |
matters, FreeBSD (after dithering for a few years on the matter) |
| 4591 |
introduced a bastardized version which implies the opposite sense |
| 4592 |
of <code>bce</code>, (because it uses SGR 39 and 49), but does |
| 4593 |
not set it. After lengthy discussion, FreeBSD began using the |
| 4594 |
terminal descriptions which I've written.</p> |
| 4595 |
|
| 4596 |
<p>The most recent XFree86 version's terminal description |
| 4597 |
corresponds to <code>xterm-xfree86</code> (also distributed with |
| 4598 |
ncurses). I have continued to make changes; the most recent |
| 4599 |
version is simply named <code>xterm-new</code> (also distributed |
| 4600 |
with ncurses).</p> |
| 4601 |
|
| 4602 |
<p>The term "<code>bce</code>" stands for "back color erase". |
| 4603 |
Terminals such as modern xterm and rxvt implement back color |
| 4604 |
erase, others such as dtterm do not. (Roughly half of the |
| 4605 |
emulators that I know about implement bce). When an application |
| 4606 |
clears the screen, a terminal that implements back color erase |
| 4607 |
will retain the last-set background color. A terminal that does |
| 4608 |
not implement back color erase will reset the background color to |
| 4609 |
the default or initial colors. Applications that paint most of |
| 4610 |
the screen in a single color are more efficient on terminals that |
| 4611 |
support back color erase. Inevitably, there are tradeoffs and |
| 4612 |
issues with standardization of the feature as noted in the |
| 4613 |
<a href="/ncurses/ncurses.faq.html#bce_mismatches">ncurses |
| 4614 |
FAQ</a>. Unsurprisingly, ncurses supports xterm's behavior.</p> |
| 4615 |
|
| 4616 |
<p>Curses libraries that support color know about |
| 4617 |
<code>bce</code> and do the right thing – provided that you |
| 4618 |
tell them what the terminal does. That is the whole point of |
| 4619 |
setting $TERM. The "xterm-color" description distributed with |
| 4620 |
ncurses does not list <code>bce</code>, because it was applied |
| 4621 |
originally to a terminal type which does not implement back color |
| 4622 |
erase. It will “work” for modern xterm, though less |
| 4623 |
efficient. Some other applications such as the slang library have |
| 4624 |
hardcoded support for terminals that implement back color erase. |
| 4625 |
Given the "xterm-color" description, those will be efficient |
| 4626 |
– and fortuitously work. However, slang (through version |
| 4627 |
1.4.0) did not work properly for the terminals that xterm-color |
| 4628 |
was designed for. See this <a href= |
| 4629 |
"/lynx/lynx-ncurses.html">page</a> for an example of (n)curses |
| 4630 |
and slang running on dtterm. That bug in slang is reported to be |
| 4631 |
fixed for succeeding versions, though your application may |
| 4632 |
require changes to use this fix. (The demo which comes with slang |
| 4633 |
to illustrate the use of <code>bce</code> does not work properly, |
| 4634 |
for instance).</p> |
| 4635 |
|
| 4636 |
<p>The <code>xterm-color</code> value for $TERM is also (for the |
| 4637 |
same reason) a bad choice for rxvt, but “works” due |
| 4638 |
to the large number of hard-coded applications that override |
| 4639 |
this.</p> |
| 4640 |
|
| 4641 |
<p>Some people recommend using <a href= |
| 4642 |
"/ncurses/terminfo.src.html#tic-xtermc"><code>xtermc</code></a>. |
| 4643 |
That is installed on Solaris. However, it does not match any |
| 4644 |
xterm in current use. (Apparently it was written for an obsolete |
| 4645 |
version on Unixware). The colors work, true, but the mouse will |
| 4646 |
not, nor will the function keys.</p> |
| 4647 |
|
| 4648 |
<h4 id="xterm_hilite-id"><a name="xterm_hilite" id= |
| 4649 |
"xterm_hilite">Reverse video is not reset</a></h4> |
| 4650 |
|
| 4651 |
<p>When running <em>less</em> or other programs that do |
| 4652 |
highlighting, you see the highlighting not turned off |
| 4653 |
properly.</p> |
| 4654 |
|
| 4655 |
<p>This may be due to incompatible terminal descriptions for |
| 4656 |
xterm. With XFree86 3.2, I modified the terminal description for |
| 4657 |
XFree86 xterm to use the VT220 (aka ISO 6429) controls that allow |
| 4658 |
an application to turn off highlighting (or bold, underline) |
| 4659 |
without modifying the other attributes. The X Consortium xterm |
| 4660 |
does not recognize these controls.</p> |
| 4661 |
|
| 4662 |
<p>If, for example, you are running an older xterm and rlogin to |
| 4663 |
a system where the newer xterm has been installed, you will have |
| 4664 |
this problem, because both programs default to $TERM set to |
| 4665 |
xterm. The solution for mixed systems is to install the newer |
| 4666 |
terminal description as as a different name (e.g., |
| 4667 |
<code>xterm-color</code>) and set the <code>termName</code> |
| 4668 |
resource accordingly in the app-defaults file for the system |
| 4669 |
which has the newer xterm.</p> |
| 4670 |
|
| 4671 |
<p>However – see <a href= |
| 4672 |
"xterm.faq.html#xterm_terminfo">above</a>.</p> |
| 4673 |
|
| 4674 |
<h4 id="vim_16colors-id"><a name="vim_16colors" id= |
| 4675 |
"vim_16colors">My colors changed in vim</a></h4> |
| 4676 |
|
| 4677 |
<p>Some <code>vim</code> users may notice their colors change |
| 4678 |
after updating to <a href="/xterm/xterm.log.html#xterm_238">patch |
| 4679 |
238</a>. Before, some text would display in a dark color using a |
| 4680 |
bold font. Now, it displays in a bright color and normal |
| 4681 |
font.</p> |
| 4682 |
|
| 4683 |
<p>This is not a bug, but the result of a feature |
| 4684 |
<em>tcap-query</em> which was added for vim in 2000. Several vim |
| 4685 |
users requested that it be enabled by default in the configure |
| 4686 |
script. It allows vim to ask what characters the different |
| 4687 |
function keys actually send, eliminating the chance that the |
| 4688 |
termcap does not match.</p> |
| 4689 |
|
| 4690 |
<p>Vim also asks how many colors the terminal supports. Since |
| 4691 |
<a href="/xterm/xterm.log.html#xterm_148">patch 148</a>, xterm |
| 4692 |
has responded with the number of distinct colors that it can |
| 4693 |
display. By default, that is 16 (8 ANSI colors with bright |
| 4694 |
counterparts for displaying PC-style “bold” |
| 4695 |
text).</p> |
| 4696 |
|
| 4697 |
<p>The interpretation of this depends on the application: |
| 4698 |
termcaps do not tell how to display more than 8 colors. But vim |
| 4699 |
understands how to tell xterm to display using 16 colors. It |
| 4700 |
makes a difference when displaying bright colors. Vim has a table |
| 4701 |
of 16 color names ("dos-colors"), which one can use to define |
| 4702 |
parts of the color scheme. If the terminal supports only 8 colors |
| 4703 |
(colors 0-7), vim uses the bold attribute to simulate colors |
| 4704 |
8-15.</p> |
| 4705 |
|
| 4706 |
<p>Changing the color scheme to use bold where it is wanted will |
| 4707 |
make the colors work as before – and work consistently with |
| 4708 |
other terminals.</p> |
| 4709 |
|
| 4710 |
<h4 id="bold_vs_16colors-id"><a name="bold_vs_16colors" id= |
| 4711 |
"bold_vs_16colors">Aren't bright colors the same as bold?</a></h4> |
| 4712 |
|
| 4713 |
<p>No.</p> |
| 4714 |
|
| 4715 |
<p>Actually, “bold” happens to be whatever the |
| 4716 |
terminal shows when it is sent the control-string that says "show |
| 4717 |
bold".</p> |
| 4718 |
|
| 4719 |
<p>The standard (ANSI aka ISO-6429 or ECMA-48) says no more than |
| 4720 |
that. ANSI specified eight (8) colors. In fact, ANSI did not |
| 4721 |
specify the appearance. That is an implementation detail.</p> |
| 4722 |
|
| 4723 |
<p>XTerm can be configured to use colors 8-15 for displaying bold |
| 4724 |
text. Or it can be configured to use those colors as part of a |
| 4725 |
16-color scheme (a feature of aixterm). They use different |
| 4726 |
control strings. When xterm is configured to use the 16-color |
| 4727 |
scheme, it displays bold text by relying on the font to show |
| 4728 |
“bold” (usually thicker characters).</p> |
| 4729 |
|
| 4730 |
<p>By default, colors 8-15 are brighter versions of colors 0-7 |
| 4731 |
(with some special handling for blue). But again, xterm is |
| 4732 |
configurable and you can use anything that you like for the |
| 4733 |
numbered colors.</p> |
| 4734 |
|
| 4735 |
<h4 id="color_by_number-id"><a name="color_by_number" id= |
| 4736 |
"color_by_number">Can I set a color by its number?</a></h4> |
| 4737 |
|
| 4738 |
<p>Well, yes: you can set a color in several ways:</p> |
| 4739 |
|
| 4740 |
<ul> |
| 4741 |
<li> |
| 4742 |
<p>using the color <em>name</em></p> |
| 4743 |
</li> |
| 4744 |
|
| 4745 |
<li> |
| 4746 |
<p>using an RGB <em>value</em></p> |
| 4747 |
</li> |
| 4748 |
|
| 4749 |
<li> |
| 4750 |
<p>selecting an <em>index</em> from the color palette</p> |
| 4751 |
</li> |
| 4752 |
</ul> |
| 4753 |
|
| 4754 |
<p>That last (an <em>index</em>) is what some people think of as |
| 4755 |
the <em>color number</em>. The short answer is that you can find |
| 4756 |
on the web tables of colors and match them up to the “color |
| 4757 |
number”. But the number itself has no meaning.</p> |
| 4758 |
|
| 4759 |
<p>In my reply to <em><a href= |
| 4760 |
"https://unix.stackexchange.com/questions/269077/tput-setaf-color-table-how-to-determine-color-codes"> |
| 4761 |
tput setaf color table? How to determine color codes?</a></em>, I |
| 4762 |
noted</p> |
| 4763 |
|
| 4764 |
<blockquote> |
| 4765 |
<p>You may find this question/answer helpful as well: |
| 4766 |
<em><a href= |
| 4767 |
"https://stackoverflow.com/questions/27159322/rgb-values-of-the-colors-in-the-ansi-extended-colors-index-17-255"> |
| 4768 |
RGB values of the colors in the Ansi extended colors index |
| 4769 |
(17-255)</a></em></p> |
| 4770 |
</blockquote> |
| 4771 |
|
| 4772 |
<p>although both question and answer raise additional questions. |
| 4773 |
This FAQ is the logical place to answer those questions.</p> |
| 4774 |
|
| 4775 |
<p>Presumably you are reading this to better understand how xterm |
| 4776 |
works. But you may be interested in the way in which other |
| 4777 |
terminals emulate xterm. If so, this explanation may help as |
| 4778 |
well.</p> |
| 4779 |
|
| 4780 |
<p>The long answer is that the correct mapping depends on the |
| 4781 |
terminal — other terminals do not necessarily match |
| 4782 |
xterm.</p> |
| 4783 |
|
| 4784 |
<p>From a shell script, you might use <a href= |
| 4785 |
"/ncurses/man/tput.1.html">tput</a> with a parameter to an escape |
| 4786 |
sequence referred to as <code>setaf</code> in the terminal |
| 4787 |
description. <code>tput</code> attaches no particular meaning to |
| 4788 |
the number. That actually depends upon the particular terminal |
| 4789 |
emulator.</p> |
| 4790 |
|
| 4791 |
<p>A while back, ANSI defined codes for 8 colors, and there were |
| 4792 |
two schemes for numbering those. The two are seen in some |
| 4793 |
terminal descriptions as the pairs <code>setf/setb</code> or |
| 4794 |
<code>setaf/setab</code>. Since the latter has the connotation of |
| 4795 |
"ANSI colors", you will see that used more often. The former |
| 4796 |
(<code>setf/setb</code>) switched the order for red/blue as noted |
| 4797 |
in <em><a href= |
| 4798 |
"/ncurses/ncurses.faq.html#interchanged_colors">Why are red/blue |
| 4799 |
interchanged?</a></em>, but in either case, the scheme was |
| 4800 |
established for just numbering the colors. There is no predefined |
| 4801 |
relationship between those numbers and RGB content.</p> |
| 4802 |
|
| 4803 |
<p>For specific terminal emulators, there are predefined color |
| 4804 |
palettes which can be enumerated easily enough — and can be |
| 4805 |
programmed using these escape sequences. There are no relevant |
| 4806 |
standards, and you will see differences between terminal |
| 4807 |
emulators, as noted in <em><a href="#dont_like_blue">I don't like |
| 4808 |
that shade of blue</a></em>.</p> |
| 4809 |
|
| 4810 |
<p>However, convention is often confused with standards. Because |
| 4811 |
xterm has been around a while, it is regarded as a standard by |
| 4812 |
some.</p> |
| 4813 |
|
| 4814 |
<p>XTerm had color support before I began working on it at the |
| 4815 |
<a href="/xterm/xterm.html#history">end of 1995</a>. Some of this |
| 4816 |
was mentioned in XFree86's changelog:</p> |
| 4817 |
|
| 4818 |
<blockquote> |
| 4819 |
<pre class="code-block"> |
| 4820 |
XFree86 3.1.2Be (10 January 1996) |
| 4821 |
203. Major xterm cleanup (including prototyping), and fixes to the colour |
| 4822 |
code (Thomas E. Dickey). |
| 4823 |
XFree86 3.1.2a (23 September 1995) |
| 4824 |
14. Colour support for xterm (David Wexelblat). |
| 4825 |
13. Fix usage of $LINES and $COLUMNS by xterm on SVR4 (David Wexelblat). |
| 4826 |
</pre> |
| 4827 |
</blockquote> |
| 4828 |
|
| 4829 |
<p>and some was not:</p> |
| 4830 |
|
| 4831 |
<ul> |
| 4832 |
<li> |
| 4833 |
<p>The “dynamic colors” feature came from a patch |
| 4834 |
written by Erik Fortune (at SGI). Someone applied this to the |
| 4835 |
XFree86 sources (probably early 1995).</p> |
| 4836 |
|
| 4837 |
<p>Since X11R4, xterm had colors for foreground and |
| 4838 |
background in the VT100 and Tek4014 widgets, as well as |
| 4839 |
cursor- and mouse-colors which could be set via resources. |
| 4840 |
But those were <em>static</em>. The <em>dynamic colors</em> |
| 4841 |
feature allowed those colors to be set via escape |
| 4842 |
sequences.</p> |
| 4843 |
</li> |
| 4844 |
|
| 4845 |
<li> |
| 4846 |
<p>“Colour support” was a set of changes for ANSI |
| 4847 |
color. It might have been based on a patch (said to be of |
| 4848 |
unknown authorship) for X11R5 xterm incorporated into a |
| 4849 |
program called <em>color_xterm</em>. Raymond's <a href= |
| 4850 |
"/ncurses/terminfo.src.html#tic-color_xterm">comment</a> in |
| 4851 |
terminfo.src implies that this program was distributed |
| 4852 |
earlier; however the copy of <code>color_xterm-alpha4</code> |
| 4853 |
which I have at hand has file modification dates starting in |
| 4854 |
December 1995. Wexelblat's commit is an earlier |
| 4855 |
<em>non-patch</em> use of the feature for xterm.</p> |
| 4856 |
|
| 4857 |
<p>Both were probably due to Tom Weinstein (also at SGI) in |
| 4858 |
1992, which you can find in the <a href= |
| 4859 |
"https://www.ibiblio.org/pub/historic-linux/ftp-archives/tsx-11.mit.edu/Oct-07-1996/sources/usr.bin.X11/"> |
| 4860 |
historic Linux</a> archive. The <code>README.color</code> |
| 4861 |
file in this earlier <a href= |
| 4862 |
"https://www.ibiblio.org/pub/historic-linux/ftp-archives/tsx-11.mit.edu/Oct-07-1996/sources/usr.bin.X11/color_xterm.tar.gz"> |
| 4863 |
color_xterm</a> says</p> |
| 4864 |
|
| 4865 |
<blockquote> |
| 4866 |
<pre class="code-block"> |
| 4867 |
2) Added ISO 6429 support for color text. You can set the foreground |
| 4868 |
and background color for text using SGR. For example, to make the |
| 4869 |
foreground red, you do: "^[[31m". The values from 30 to 37 set |
| 4870 |
foreground, those from 40 to 47 set background. The default colors |
| 4871 |
are: |
| 4872 |
0) black 1) red 2) green 3) yellow 4) blue 5) magenta |
| 4873 |
6) cyan 7) white |
| 4874 |
|
| 4875 |
These are settable with the resources "color0" to "color1" |
| 4876 |
</pre> |
| 4877 |
</blockquote> |
| 4878 |
|
| 4879 |
<p>Aside from <code>README.color</code>, there was no |
| 4880 |
documentation. The terminal description was unmodified.</p> |
| 4881 |
</li> |
| 4882 |
</ul> |
| 4883 |
|
| 4884 |
<p>Thus, from the start there were two types of color support in |
| 4885 |
xterm. ANSI colors treats the available colors as an array (its |
| 4886 |
palette) which can be programmed, while dynamic colors applies a |
| 4887 |
single color to a feature.</p> |
| 4888 |
|
| 4889 |
<p id="ANSI_colors_before_and_now">There have been some changes |
| 4890 |
since the <em>color_xterm</em> in 1992:</p> |
| 4891 |
|
| 4892 |
<blockquote> |
| 4893 |
<table border="1" summary="ANSI colors before and now"> |
| 4894 |
<tr> |
| 4895 |
<th>Resource</th> |
| 4896 |
<th>1992</th> |
| 4897 |
<th>1995</th> |
| 4898 |
<th>2016</th> |
| 4899 |
</tr> |
| 4900 |
|
| 4901 |
<tr> |
| 4902 |
<td><code>color0</code> |
| 4903 |
</td> |
| 4904 |
<td><code>Black</code> |
| 4905 |
</td> |
| 4906 |
<td><code>black</code> |
| 4907 |
</td> |
| 4908 |
<td><code>black</code> |
| 4909 |
</td> |
| 4910 |
</tr> |
| 4911 |
|
| 4912 |
<tr> |
| 4913 |
<td><code>color1</code> |
| 4914 |
</td> |
| 4915 |
<td><code>Red</code> |
| 4916 |
</td> |
| 4917 |
<td><code>red3</code> |
| 4918 |
</td> |
| 4919 |
<td><code>red3</code> |
| 4920 |
</td> |
| 4921 |
</tr> |
| 4922 |
|
| 4923 |
<tr> |
| 4924 |
<td><code>color2</code> |
| 4925 |
</td> |
| 4926 |
<td><code>Green</code> |
| 4927 |
</td> |
| 4928 |
<td><code>green3</code> |
| 4929 |
</td> |
| 4930 |
<td><code>green3</code> |
| 4931 |
</td> |
| 4932 |
</tr> |
| 4933 |
|
| 4934 |
<tr> |
| 4935 |
<td><code>color3</code> |
| 4936 |
</td> |
| 4937 |
<td><code>Yellow</code> |
| 4938 |
</td> |
| 4939 |
<td><code>yellow3</code> |
| 4940 |
</td> |
| 4941 |
<td><code>yellow3</code> |
| 4942 |
</td> |
| 4943 |
</tr> |
| 4944 |
|
| 4945 |
<tr> |
| 4946 |
<td><code>color4</code> |
| 4947 |
</td> |
| 4948 |
<td><code>Blue</code> |
| 4949 |
</td> |
| 4950 |
<td><code>blue3</code> |
| 4951 |
</td> |
| 4952 |
<td><code>blue2</code> |
| 4953 |
</td> |
| 4954 |
</tr> |
| 4955 |
|
| 4956 |
<tr> |
| 4957 |
<td><code>color5</code> |
| 4958 |
</td> |
| 4959 |
<td><code>Magenta</code> |
| 4960 |
</td> |
| 4961 |
<td><code>magenta3</code> |
| 4962 |
</td> |
| 4963 |
<td><code>magenta3</code> |
| 4964 |
</td> |
| 4965 |
</tr> |
| 4966 |
|
| 4967 |
<tr> |
| 4968 |
<td><code>color6</code> |
| 4969 |
</td> |
| 4970 |
<td><code>Cyan</code> |
| 4971 |
</td> |
| 4972 |
<td><code>cyan3</code> |
| 4973 |
</td> |
| 4974 |
<td><code>cyan3</code> |
| 4975 |
</td> |
| 4976 |
</tr> |
| 4977 |
|
| 4978 |
<tr> |
| 4979 |
<td><code>color7</code> |
| 4980 |
</td> |
| 4981 |
<td><code>White</code> |
| 4982 |
</td> |
| 4983 |
<td><code>gray90</code> |
| 4984 |
</td> |
| 4985 |
<td><code>gray90</code> |
| 4986 |
</td> |
| 4987 |
</tr> |
| 4988 |
|
| 4989 |
<tr> |
| 4990 |
<td><code>color8</code> |
| 4991 |
</td> |
| 4992 |
<td> </td> |
| 4993 |
<td><code>gray30</code> |
| 4994 |
</td> |
| 4995 |
<td><code>gray50</code> |
| 4996 |
</td> |
| 4997 |
</tr> |
| 4998 |
|
| 4999 |
<tr> |
| 5000 |
<td><code>color9</code> |
| 5001 |
</td> |
| 5002 |
<td> </td> |
| 5003 |
<td><code>red</code> |
| 5004 |
</td> |
| 5005 |
<td><code>red</code> |
| 5006 |
</td> |
| 5007 |
</tr> |
| 5008 |
|
| 5009 |
<tr> |
| 5010 |
<td><code>color10</code> |
| 5011 |
</td> |
| 5012 |
<td> </td> |
| 5013 |
<td><code>green</code> |
| 5014 |
</td> |
| 5015 |
<td><code>green</code> |
| 5016 |
</td> |
| 5017 |
</tr> |
| 5018 |
|
| 5019 |
<tr> |
| 5020 |
<td><code>color11</code> |
| 5021 |
</td> |
| 5022 |
<td> </td> |
| 5023 |
<td><code>yellow</code> |
| 5024 |
</td> |
| 5025 |
<td><code>yellow</code> |
| 5026 |
</td> |
| 5027 |
</tr> |
| 5028 |
|
| 5029 |
<tr> |
| 5030 |
<td><code>color12</code> |
| 5031 |
</td> |
| 5032 |
<td> </td> |
| 5033 |
<td><code>blue</code> |
| 5034 |
</td> |
| 5035 |
<td><code>rgb:5c/5c/ff</code> |
| 5036 |
</td> |
| 5037 |
</tr> |
| 5038 |
|
| 5039 |
<tr> |
| 5040 |
<td><code>color13</code> |
| 5041 |
</td> |
| 5042 |
<td> </td> |
| 5043 |
<td><code>magenta</code> |
| 5044 |
</td> |
| 5045 |
<td><code>magenta</code> |
| 5046 |
</td> |
| 5047 |
</tr> |
| 5048 |
|
| 5049 |
<tr> |
| 5050 |
<td><code>color14</code> |
| 5051 |
</td> |
| 5052 |
<td> </td> |
| 5053 |
<td><code>cyan</code> |
| 5054 |
</td> |
| 5055 |
<td><code>cyan</code> |
| 5056 |
</td> |
| 5057 |
</tr> |
| 5058 |
|
| 5059 |
<tr> |
| 5060 |
<td><code>color15</code> |
| 5061 |
</td> |
| 5062 |
<td> </td> |
| 5063 |
<td><code>white</code> |
| 5064 |
</td> |
| 5065 |
<td><code>white</code> |
| 5066 |
</td> |
| 5067 |
</tr> |
| 5068 |
|
| 5069 |
<tr> |
| 5070 |
<td><code>colorUL</code> |
| 5071 |
</td> |
| 5072 |
<td> </td> |
| 5073 |
<td><code>yellow</code> |
| 5074 |
</td> |
| 5075 |
<td><code>foreground</code> |
| 5076 |
</td> |
| 5077 |
</tr> |
| 5078 |
|
| 5079 |
<tr> |
| 5080 |
<td><code>colorBD</code> |
| 5081 |
</td> |
| 5082 |
<td> </td> |
| 5083 |
<td><code>white</code> |
| 5084 |
</td> |
| 5085 |
<td><code>foreground</code> |
| 5086 |
</td> |
| 5087 |
</tr> |
| 5088 |
|
| 5089 |
<tr> |
| 5090 |
<td><code>colorRV</code> |
| 5091 |
</td> |
| 5092 |
<td> </td> |
| 5093 |
<td> </td> |
| 5094 |
<td><code>foreground</code> |
| 5095 |
</td> |
| 5096 |
</tr> |
| 5097 |
|
| 5098 |
<tr> |
| 5099 |
<td><code>colorIT</code> |
| 5100 |
</td> |
| 5101 |
<td> </td> |
| 5102 |
<td> </td> |
| 5103 |
<td><code>foreground</code> |
| 5104 |
</td> |
| 5105 |
</tr> |
| 5106 |
</table> |
| 5107 |
</blockquote> |
| 5108 |
|
| 5109 |
<p>In development of xterm over the past 20 years, we</p> |
| 5110 |
|
| 5111 |
<ul> |
| 5112 |
<li> |
| 5113 |
<p>incorporated ANSI (8) colors,</p> |
| 5114 |
</li> |
| 5115 |
|
| 5116 |
<li> |
| 5117 |
<p>adapted the aixterm feature (16) colors,</p> |
| 5118 |
</li> |
| 5119 |
|
| 5120 |
<li> |
| 5121 |
<p>added extensions for 88- and 256-colors.</p> |
| 5122 |
</li> |
| 5123 |
</ul> |
| 5124 |
|
| 5125 |
<p>Much of that has been adopted by other developers for |
| 5126 |
different terminal emulators. That is summarized in <a href= |
| 5127 |
"/ncurses/ncurses.faq.html#xterm_256color">Why not make |
| 5128 |
“xterm” equated to |
| 5129 |
“xterm-256color”?</a>.</p> |
| 5130 |
|
| 5131 |
<p>As hinted by the table, the 16-color extension was partly |
| 5132 |
implemented in xterm by late 1995, using the scheme of Linux |
| 5133 |
console: <em>bold</em> fonts are shown as <em>brighter</em> |
| 5134 |
equivalents of the ANSI 8 colors. Unlike the Linux console, xterm |
| 5135 |
can use bold fonts and (aside from providing similar appearance |
| 5136 |
to the Linux console for programs such as <a href= |
| 5137 |
"/dialog/dialog.html">dialog</a>) there was no reason to pretend |
| 5138 |
that <a href="#bold_vs_16colors">bold and bright were |
| 5139 |
synonymous</a>.</p> |
| 5140 |
|
| 5141 |
<p>The <code>colorUL</code> and <code>colorBD</code> features are |
| 5142 |
part of this discussion because I incorporated those into the |
| 5143 |
indexing scheme for colors. More on that later.</p> |
| 5144 |
|
| 5145 |
<p>First, deal with the 256- and 88-color extensions.</p> |
| 5146 |
|
| 5147 |
<p>The reason for <em>256</em> colors is that the index would fit |
| 5148 |
in a byte. Larason's scheme was simple enough:</p> |
| 5149 |
|
| 5150 |
<ul> |
| 5151 |
<li> |
| 5152 |
<p>the existing 16 colors</p> |
| 5153 |
</li> |
| 5154 |
|
| 5155 |
<li> |
| 5156 |
<p>a color cube (6x6x6 is 216, which is the largest cube no |
| 5157 |
larger than 256).</p> |
| 5158 |
</li> |
| 5159 |
|
| 5160 |
<li> |
| 5161 |
<p>a grayscale “ramp”, using the remaining 24 |
| 5162 |
entries.</p> |
| 5163 |
</li> |
| 5164 |
</ul> |
| 5165 |
|
| 5166 |
<p>The xterm source-code includes scripts for demonstrating the |
| 5167 |
colors, e.g., using the same escape sequences that |
| 5168 |
<code>tput</code> would use:</p> |
| 5169 |
|
| 5170 |
<ul> |
| 5171 |
<li> |
| 5172 |
<p><a href="/xterm/xterm.log.html#xterm_94">patch #94</a> |
| 5173 |
(1999/03/27) added <code>8colors.sh, 16colors.sh</code></p> |
| 5174 |
</li> |
| 5175 |
|
| 5176 |
<li> |
| 5177 |
<p><a href="/xterm/xterm.log.html#xterm_111">patch #111</a> |
| 5178 |
(1999/07/10) added <code>256colors.pl and |
| 5179 |
256colors2.pl</code></p> |
| 5180 |
</li> |
| 5181 |
|
| 5182 |
<li> |
| 5183 |
<p><a href="/xterm/xterm.log.html#xterm_115">patch #115</a> |
| 5184 |
(1999/07/18) added <code>88colors.pl and |
| 5185 |
88colors2.pl</code></p> |
| 5186 |
</li> |
| 5187 |
</ul> |
| 5188 |
|
| 5189 |
<p>I added the scripts in patch #94 because of some user comments |
| 5190 |
that there were scripts of that sort available, that there were |
| 5191 |
some deficiencies in those, and and it would be nice to have some |
| 5192 |
good examples in xterm's source. Coincidentally, that gave Todd |
| 5193 |
Larason and Stephen P Wall a starting point for the changes to |
| 5194 |
support 256- and 88-colors.</p> |
| 5195 |
|
| 5196 |
<p>The 256-color extension came first. 88-colors (using the same |
| 5197 |
control sequence) came next, to reduce the amount of memory |
| 5198 |
needed. XTerm stores both foreground and background color indexes |
| 5199 |
for each cell on the screen. That is two bytes, which doubled the |
| 5200 |
amount of memory used by xterm for the scrollback. More |
| 5201 |
important, however, was the number of entries in the |
| 5202 |
<em>colormap</em>. With 256 colors, 65536 entries might be used, |
| 5203 |
but 88 colors use at most 7744 entries. In the late 1990s, |
| 5204 |
inexpensive displays were far less capable, requiring workarounds |
| 5205 |
to get acceptable performance.</p> |
| 5206 |
|
| 5207 |
<p id="Allocation_of_colors_for_88/157/256_schemes">The 256- and |
| 5208 |
88-color schemes (a 16-color table of <em>ANSI</em> (or |
| 5209 |
<em>aixterm</em>) colors, followed by a cube and then a grayscale |
| 5210 |
“ramp”) are similar. An intermediate <a href= |
| 5211 |
"https://lists.gnu.org/archive/html/bug-ncurses/2020-03/msg00025.html"> |
| 5212 |
157-color scheme</a> could have been provided,</p> |
| 5213 |
|
| 5214 |
<table border="1" summary= |
| 5215 |
"Allocation of colors for 88/157/256 schemes"> |
| 5216 |
<tr> |
| 5217 |
<th>88</th> |
| 5218 |
<th>157</th> |
| 5219 |
<th>256</th> |
| 5220 |
<th>Usage</th> |
| 5221 |
</tr> |
| 5222 |
|
| 5223 |
<tr> |
| 5224 |
<td align="right">16</td> |
| 5225 |
<td align="right">16</td> |
| 5226 |
<td align="right">16</td> |
| 5227 |
<td>ANSI/AIX</td> |
| 5228 |
</tr> |
| 5229 |
|
| 5230 |
<tr> |
| 5231 |
<td align="right">64</td> |
| 5232 |
<td align="right">125</td> |
| 5233 |
<td align="right">216</td> |
| 5234 |
<td>cube</td> |
| 5235 |
</tr> |
| 5236 |
|
| 5237 |
<tr> |
| 5238 |
<td align="right">8</td> |
| 5239 |
<td align="right">16</td> |
| 5240 |
<td align="right">24</td> |
| 5241 |
<td>grayscale "ramp"</td> |
| 5242 |
</tr> |
| 5243 |
</table> |
| 5244 |
|
| 5245 |
<p>but the savings in the colormap would be less compelling:</p> |
| 5246 |
|
| 5247 |
<table border="1" summary= |
| 5248 |
"Size of colormap for 88/157/256 schemes"> |
| 5249 |
<tr> |
| 5250 |
<th>Colors</th> |
| 5251 |
<th>Size</th> |
| 5252 |
<th>Bits</th> |
| 5253 |
</tr> |
| 5254 |
|
| 5255 |
<tr> |
| 5256 |
<td align="right">88</td> |
| 5257 |
<td align="right">7744</td> |
| 5258 |
<td align="right">13</td> |
| 5259 |
</tr> |
| 5260 |
|
| 5261 |
<tr> |
| 5262 |
<td align="right">157</td> |
| 5263 |
<td align="right">24649</td> |
| 5264 |
<td align="right">15</td> |
| 5265 |
</tr> |
| 5266 |
|
| 5267 |
<tr> |
| 5268 |
<td align="right">256</td> |
| 5269 |
<td align="right">65536</td> |
| 5270 |
<td align="right">16</td> |
| 5271 |
</tr> |
| 5272 |
</table> |
| 5273 |
|
| 5274 |
<p id="semicolon_vs_colon">Like the aixterm 16-color extension, |
| 5275 |
these colors are stored in an array. Unlike aixterm (whose |
| 5276 |
developers invented a new set of escape sequences not found in |
| 5277 |
ANSI or ECMA-48), we used sequences found in ECMA-48: SGR codes |
| 5278 |
38 and 48. However, the feature evolved:</p> |
| 5279 |
|
| 5280 |
<ul> |
| 5281 |
<li> |
| 5282 |
<p>The default color palette for xterm uses header-files |
| 5283 |
generated using scripts similar to the ones provided for |
| 5284 |
demonstrations (<a href= |
| 5285 |
"/xterm/xterm.log.html#xterm_112">patch #112</a>).</p> |
| 5286 |
|
| 5287 |
<p>The first 16 colors (except for blue) use names in the X |
| 5288 |
<code>rgb.txt</code>.</p> |
| 5289 |
</li> |
| 5290 |
|
| 5291 |
<li> |
| 5292 |
<p>The X libraries cannot handle enough resources to specify |
| 5293 |
all of the 256 colors as well as other features in xterm.</p> |
| 5294 |
|
| 5295 |
<p>Starting with <a href= |
| 5296 |
"/xterm/xterm.log.html#xterm_129">patch #129</a>, I made the |
| 5297 |
<em>resource</em> settings for colors past the first 16 a |
| 5298 |
compile-time option. If you prefer to have the colors as X |
| 5299 |
resource values, you lose UTF-8. Since xterm accepted escape |
| 5300 |
sequences for setting the palette, this was not a |
| 5301 |
problem.</p> |
| 5302 |
</li> |
| 5303 |
|
| 5304 |
<li> |
| 5305 |
<p>Steve Wall modified the palette in 2002 (<a href= |
| 5306 |
"/xterm/xterm.log.html#xterm_166">patch #166</a>), making it |
| 5307 |
a little brighter.</p> |
| 5308 |
</li> |
| 5309 |
|
| 5310 |
<li> |
| 5311 |
<p>We used semicolon (like other SGR parameters) for |
| 5312 |
separating the R/G/B values in the escape sequence, since a |
| 5313 |
copy of ITU T.416 (ISO-8613-6) which presumably clarified the |
| 5314 |
use of colon for this feature was costly.</p> |
| 5315 |
|
| 5316 |
<p>Using semicolon was incorrect because some applications |
| 5317 |
could expect their parameters to be order-independent. As |
| 5318 |
used for the R/G/B values, that <em>was</em> order-dependent. |
| 5319 |
The relevant information, by the way, is part of ECMA-48 (not |
| 5320 |
ITU T.416, as mentioned in <a href= |
| 5321 |
"/ncurses/ncurses.faq.html#xterm_16MegaColors"><em>Why only |
| 5322 |
16 (or 256) colors?</em></a>). Quoting from <a href= |
| 5323 |
"https://ecma-international.org/publications-and-standards/standards/ecma-48/"> |
| 5324 |
section 5.4.2 of ECMA-48, page 12</a>, and adding emphasis |
| 5325 |
(not in the standard):</p> |
| 5326 |
|
| 5327 |
<blockquote> |
| 5328 |
<p class="code-block">Each parameter sub-string consists of |
| 5329 |
one or more bit combinations from 03/00 to |
| 5330 |
<strong>03/10</strong>; the bit combinations from 03/00 to |
| 5331 |
03/09 represent the digits <em>ZERO</em> to <em>NINE</em>; |
| 5332 |
bit combination <strong>03/10</strong> may be used as a |
| 5333 |
separator in a <em>parameter sub-string</em>, for example, |
| 5334 |
to separate the fractional part of a decimal number from |
| 5335 |
the integer part of that number.</p> |
| 5336 |
</blockquote> |
| 5337 |
|
| 5338 |
<p>and later on page 78, in 8.3.117 <em>SGR – SELECT |
| 5339 |
GRAPHIC RENDITION</em>, the description of SGR 38:</p> |
| 5340 |
|
| 5341 |
<blockquote> |
| 5342 |
<p class="code-block">(reserved for future standardization; |
| 5343 |
intended for setting character foreground colour as |
| 5344 |
specified in ISO 8613-6 [CCITT Recommendation T.416])</p> |
| 5345 |
</blockquote> |
| 5346 |
|
| 5347 |
<p>Of course you will immediately recognize that |
| 5348 |
<strong><tt>03/10</tt></strong> is ASCII <em>colon</em>, and |
| 5349 |
that ISO 8613-6 necessarily refers to the encoding in a |
| 5350 |
<em>parameter sub-string</em>. Or perhaps you will not.</p> |
| 5351 |
|
| 5352 |
<p>It took several years for this to become an issue. The |
| 5353 |
developers of other terminal emulators were not the ones who |
| 5354 |
first complained about it. In fact, though the |
| 5355 |
order-dependence was mentioned, no one pointed to a specific |
| 5356 |
program which was affected. Still, it was a known |
| 5357 |
problem.</p> |
| 5358 |
|
| 5359 |
<p>Later, in 2012 (<a href="/xterm/xterm.log.html">patch |
| 5360 |
#282</a>), I extended the parser to accommodate the |
| 5361 |
<em>corrected</em> syntax. The original remains, simply |
| 5362 |
because of its widespread use. As before, it took a few years |
| 5363 |
for other terminal developers to notice and start |
| 5364 |
incorporating the improvement. As of March 2016, not all had |
| 5365 |
finished noticing.</p> |
| 5366 |
|
| 5367 |
<p>On releasing <a href="/ncurses/announce-6.1.html">ncurses |
| 5368 |
6.1</a> in 2018, I used the corrected syntax in the <a href= |
| 5369 |
"/ncurses/terminfo.src.html#tic-xterm-direct"><em>xterm-direct</em></a> |
| 5370 |
terminal description, and also provided working examples for |
| 5371 |
the other terminals which supported the <em>direct color</em> |
| 5372 |
feature. Some of those still did not support the standard |
| 5373 |
syntax for the control sequences:</p> |
| 5374 |
|
| 5375 |
<ul> |
| 5376 |
<li> |
| 5377 |
<p><a href= |
| 5378 |
"/ncurses/terminfo.src.html#tic-xterm_direct">xterm+direct</a> |
| 5379 |
is the building-block for standard terminals</p> |
| 5380 |
</li> |
| 5381 |
|
| 5382 |
<li> |
| 5383 |
<p><a href= |
| 5384 |
"/ncurses/terminfo.src.html#tic-xterm_indirect">xterm+indirect</a> |
| 5385 |
is a building-block for nonstandard terminals</p> |
| 5386 |
</li> |
| 5387 |
</ul> |
| 5388 |
|
| 5389 |
<p>Still later, in 2020, a user's request prompted review of |
| 5390 |
this area:</p> |
| 5391 |
|
| 5392 |
<ul> |
| 5393 |
<li> |
| 5394 |
<p>One of the other terminal developers had implemented a |
| 5395 |
new feature using xterm's original semicolon |
| 5396 |
delimiters.</p> |
| 5397 |
</li> |
| 5398 |
|
| 5399 |
<li> |
| 5400 |
<p>That created a problem for this user because the same |
| 5401 |
string sent to both terminals would color text on the |
| 5402 |
other terminal, but reset colors on xterm.</p> |
| 5403 |
</li> |
| 5404 |
|
| 5405 |
<li> |
| 5406 |
<p>That happens because (unless xterm were specially |
| 5407 |
modified), xterm cannot tell that the new feature has |
| 5408 |
subparameters which are supposed to be used for setting |
| 5409 |
colors.</p> |
| 5410 |
</li> |
| 5411 |
|
| 5412 |
<li> |
| 5413 |
<p>The feature itself is nonstandard, using a code marked |
| 5414 |
in ECMA-48 for future standardization, so there is no |
| 5415 |
reason to modify xterm.</p> |
| 5416 |
</li> |
| 5417 |
|
| 5418 |
<li> |
| 5419 |
<p>As noted in the ncurses FAQ <a href= |
| 5420 |
"/ncurses/ncurses.faq.html#xterm_generic"><em>Why not |
| 5421 |
just use TERM set to “xterm”?</em></a>, |
| 5422 |
sometimes xterm's terminal description uses features not |
| 5423 |
supported by other terminals.</p> |
| 5424 |
</li> |
| 5425 |
|
| 5426 |
<li> |
| 5427 |
<p>ncurses has correct terminal descriptions for xterm |
| 5428 |
and other terminals (such as the one with the nonstandard |
| 5429 |
feature).</p> |
| 5430 |
</li> |
| 5431 |
|
| 5432 |
<li> |
| 5433 |
<p>Providing a terminal description using the nonstandard |
| 5434 |
semicolon for delimiting subparameters encourages users |
| 5435 |
to stumble into this problem.</p> |
| 5436 |
</li> |
| 5437 |
|
| 5438 |
<li> |
| 5439 |
<p>Going forward (e.g., xterm patch #357), these terminfo |
| 5440 |
building blocks are used in ncurses:</p> |
| 5441 |
|
| 5442 |
<ul> |
| 5443 |
<li> |
| 5444 |
<p><a href= |
| 5445 |
"/ncurses/terminfo.src.html#tic-xterm_256color2">xterm+256color<strong>2</strong></a> |
| 5446 |
is the building-block for standard terminals</p> |
| 5447 |
</li> |
| 5448 |
|
| 5449 |
<li> |
| 5450 |
<p><a href= |
| 5451 |
"/ncurses/terminfo.src.html#tic-xterm_256color">xterm+256color</a> |
| 5452 |
is a building-block for nonstandard terminals</p> |
| 5453 |
</li> |
| 5454 |
</ul> |
| 5455 |
</li> |
| 5456 |
</ul> |
| 5457 |
</li> |
| 5458 |
</ul> |
| 5459 |
|
| 5460 |
<p id="changing_256color_palette">As others incorporated the |
| 5461 |
xterm 256-color feature, the ability to <em>set</em> the palette |
| 5462 |
was usually not done before announcing that a program had the |
| 5463 |
256-color feature. Others acquired the ability to set the palette |
| 5464 |
after a lapse of years. As an exception, Geoff Wing (rxvt |
| 5465 |
developer) implemented the complete feature in August 2002 |
| 5466 |
(release 2.7.9). Any xterm-<em>compatible</em> implementation |
| 5467 |
with support for 256-colors automatically supports 88-colors, |
| 5468 |
since the palette is modifiable, which makes comments such as |
| 5469 |
<a href= |
| 5470 |
"https://unix.stackexchange.com/questions/269077/tput-setaf-color-table-how-to-determine-color-codes"> |
| 5471 |
this</a> at best badly informed.</p> |
| 5472 |
|
| 5473 |
<p>A few non-xterm applications may support the feature, |
| 5474 |
e.g.,</p> |
| 5475 |
|
| 5476 |
<ul> |
| 5477 |
<li> |
| 5478 |
<p><a href="/ncurses/terminfo.src.html#tic-putty">PuTTY</a> |
| 5479 |
(Windows)</p> |
| 5480 |
</li> |
| 5481 |
|
| 5482 |
<li> |
| 5483 |
<p><a href="/ncurses/terminfo.src.html#tic-iterm2">iTerm2</a> |
| 5484 |
(MacOS)</p> |
| 5485 |
</li> |
| 5486 |
|
| 5487 |
<li> |
| 5488 |
<p><a href="/ncurses/terminfo.src.html#tic-teken">teken</a> |
| 5489 |
(FreeBSD)</p> |
| 5490 |
</li> |
| 5491 |
</ul> |
| 5492 |
|
| 5493 |
<p>though the results may not be satisfactory. Here are |
| 5494 |
screenshots for 88- and 256-colors which I made in <a href= |
| 5495 |
"https://lists.freebsd.org/pipermail/freebsd-arch/2014-February/015081.html"> |
| 5496 |
February 2014</a> while discussing deficiencies of the FreeBSD |
| 5497 |
console emulator:</p> |
| 5498 |
|
| 5499 |
<blockquote> |
| 5500 |
<p><a href="/xterm/images/teken-88colors.png"><img width="450" |
| 5501 |
src="images/teken-88colors.png" alt="teken with 88-colors"></a></p> |
| 5502 |
|
| 5503 |
<p><a href="/xterm/images/teken-256colors.png"><img width="450" |
| 5504 |
src="images/teken-256colors.png" alt= |
| 5505 |
"teken with 256-colors"></a></p> |
| 5506 |
</blockquote> |
| 5507 |
|
| 5508 |
<p>XTerm stores the colors for <code>colorUL</code>, etc., at the |
| 5509 |
end of the color array used for ANSI, 16-, 88- and 256-colors. An |
| 5510 |
application can <em>modify</em> the colors using |
| 5511 |
<code>OSC 4</code>, which does not reduce the range |
| 5512 |
available for the <code>SGR 38/48</code> index used for |
| 5513 |
<em>selecting</em> colors (underline, bold, reverse — and |
| 5514 |
italics — all have their place in the video attribute |
| 5515 |
fields). Like dynamic colors, this was a feature found in XFree86 |
| 5516 |
but not in X11R5 or X11R6. According to David Dawes, some people |
| 5517 |
liked the feature. <a href= |
| 5518 |
"https://olesenm.github.io/about/">Mark J Olesen</a> incorporated |
| 5519 |
the same into rxvt mid-1996, and I added the other two |
| 5520 |
attributes. However, it was mainly popular with Red Hat users who |
| 5521 |
wanted to color their manpages. After Werner Lemberg changed |
| 5522 |
groff behavior <a href= |
| 5523 |
"https://lists.gnu.org/archive/html/groff/2001-10/msg00055.html">in |
| 5524 |
2001</a> to color manpages, this feature is not that well |
| 5525 |
known.</p> |
| 5526 |
|
| 5527 |
<p>Finally, there are the <em>default</em> foreground and |
| 5528 |
background colors set using <code>SGR 39/49</code>.</p> |
| 5529 |
|
| 5530 |
<p>If one wants to enumerate the colors which can be set by index |
| 5531 |
in xterm, there are multiple indices that are needed:</p> |
| 5532 |
|
| 5533 |
<ul> |
| 5534 |
<li> |
| 5535 |
<p>SGR number (for the 8 ANSI colors, the extra 8 aixterm |
| 5536 |
colors and the default colors)</p> |
| 5537 |
</li> |
| 5538 |
|
| 5539 |
<li> |
| 5540 |
<p>SGR 38/48 with (index) parameter (for the 88-colors and |
| 5541 |
the 256-colors, keeping in mind that those include the first |
| 5542 |
16 ANSI and aixterm colors)</p> |
| 5543 |
</li> |
| 5544 |
|
| 5545 |
<li> |
| 5546 |
<p>OSC 4 with (index) parameter (colored video |
| 5547 |
attributes)</p> |
| 5548 |
</li> |
| 5549 |
|
| 5550 |
<li> |
| 5551 |
<p>OSC numbers 10-19 (dynamic colors)</p> |
| 5552 |
</li> |
| 5553 |
</ul> |
| 5554 |
|
| 5555 |
<p>The sample scripts in xterm's sources demonstrate these |
| 5556 |
features. Some are written in POSIX shell, the remainder are in |
| 5557 |
Perl.</p> |
| 5558 |
|
| 5559 |
<h4 id="dont_like_blue-id"><a name="dont_like_blue" id= |
| 5560 |
"dont_like_blue">I don't like that shade of blue</a></h4> |
| 5561 |
|
| 5562 |
<p>Nobody does. But there are no universal solutions.</p> |
| 5563 |
|
| 5564 |
<p>If your terminal (or the application running in it has a dark |
| 5565 |
background, then darker blues are hard to see. With a light |
| 5566 |
background, yellows are hard to see.</p> |
| 5567 |
|
| 5568 |
<p>The available standards do not help: there <em>are</em> no |
| 5569 |
standards for terminal colors. Here is an illustration which I |
| 5570 |
made in reply to a <a href= |
| 5571 |
"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=241717">bug |
| 5572 |
report</a>, contrasting different choices for blue, against some |
| 5573 |
of the other terminals which (were said to) provide "standard |
| 5574 |
vt100 colors":</p> |
| 5575 |
|
| 5576 |
<blockquote class="code-block"> |
| 5577 |
<p><a href="/xterm/images/contrast.jpg"><img width="450" src= |
| 5578 |
"images/contrast.jpg" alt= |
| 5579 |
"Contrasting blue in terminal emulators"></a></p> |
| 5580 |
</blockquote> |
| 5581 |
|
| 5582 |
<p>Of course, anyone <em>developing</em> a terminal emulator |
| 5583 |
already knew that <a href= |
| 5584 |
"/ncurses/ncurses.faq.html#vt100_color">vt100's never did do |
| 5585 |
colors</a>.</p> |
| 5586 |
|
| 5587 |
<p>Ultimately it is up to the application running in a terminal |
| 5588 |
to enforce the colors it needs. XTerm merely provides the best |
| 5589 |
compromise on default visibility that I and my users have |
| 5590 |
found.</p> |
| 5591 |
|
| 5592 |
<h4 id="what_256colors-id"><a name="what_256colors" id= |
| 5593 |
"what_256colors">What is the 256-color palette?</a></h4> |
| 5594 |
|
| 5595 |
<p>The 256-color palette is a collection of red, green and blue |
| 5596 |
color values. Todd Larason's original proposal for this feature |
| 5597 |
in <a href="/xterm/xterm.log.html#xterm_111">1999</a> included a |
| 5598 |
sample script (see <a href= |
| 5599 |
"https://github.com/ThomasDickey/xterm-snapshots/blob/c6542a40c0ca62feb56961fffc67b6ef3e8a12aa/vttests/256colors2.pl"> |
| 5600 |
link</a>). Here is a screenshot:</p> |
| 5601 |
|
| 5602 |
<blockquote> |
| 5603 |
<p><a href="/xterm/images/256colors-1999.png"><img width="450" |
| 5604 |
src="images/256colors-1999.png" alt= |
| 5605 |
"original 256color demo"></a></p> |
| 5606 |
</blockquote> |
| 5607 |
|
| 5608 |
<p>I adapted Larason's script to create definitions which can be |
| 5609 |
compiled into xterm, initially as resource settings. Steve Wall |
| 5610 |
modified the colors in <a href= |
| 5611 |
"/xterm/xterm.log.html#xterm_166">2002</a> (see <a href= |
| 5612 |
"https://github.com/ThomasDickey/xterm-snapshots/blob/ebedc23345c9e786d4458aebccf932f39b792036/vttests/256colors2.pl"> |
| 5613 |
link</a>). Here is a screenshot:</p> |
| 5614 |
|
| 5615 |
<blockquote> |
| 5616 |
<p><a href="/xterm/images/256colors-2002.png"><img width="450" |
| 5617 |
src="images/256colors-2002.png" alt= |
| 5618 |
"updated 256color demo"></a></p> |
| 5619 |
</blockquote> |
| 5620 |
|
| 5621 |
<p>Both of those scripts ignore the first sixteen colors, which |
| 5622 |
are set using <a href= |
| 5623 |
"/xterm/manpage/xterm.html#VT100-Widget-Resources:color0">resource |
| 5624 |
values</a>. A script to show the red, green and blue components |
| 5625 |
for all 256 colors is complicated by the changes I made for the |
| 5626 |
colors 4 and 12 (blue) in <a href= |
| 5627 |
"/xterm/xterm.log.html#xterm_192">2004</a>. This python script |
| 5628 |
prints the color values which xterm uses by default:</p> |
| 5629 |
|
| 5630 |
<blockquote class="code-block100"> |
| 5631 |
<!--{{atr2html--> |
| 5632 |
|
| 5633 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 5634 |
<span class="comment"># print a list of the 256-color red/green/blue values used by xterm.<br> |
| 5635 |
</span> <span class="comment">#<br></span> <span class= |
| 5636 |
"comment"># reference:<br></span> <span class= |
| 5637 |
"comment"># <a href= |
| 5638 |
"https://github.com/ThomasDickey/ncurses-snapshots/blob/master/test/xterm-16color.dat">https://github.com/ThomasDickey/ncurses-snapshots/blob/master/test/xterm-16color.dat</a><br> |
| 5639 |
</span> <span class="comment"># <a href= |
| 5640 |
"https://github.com/ThomasDickey/xterm-snapshots/blob/master/XTerm-col.ad">https://github.com/ThomasDickey/xterm-snapshots/blob/master/XTerm-col.ad</a><br> |
| 5641 |
</span> <span class="comment"># <a href= |
| 5642 |
"https://github.com/ThomasDickey/xterm-snapshots/blob/master/256colres.pl">https://github.com/ThomasDickey/xterm-snapshots/blob/master/256colres.pl</a><br> |
| 5643 |
</span> <br> |
| 5644 |
<strong><span class= |
| 5645 |
"keyword">print</span></strong>(<span class="literal">"colors 0-16 correspond to the ANSI and aixterm naming"</span>)<br> |
| 5646 |
|
| 5647 |
<strong><span class= |
| 5648 |
"keyword">for</span></strong> code <strong><span class="keyword">in</span></strong> <span class="ident2">range</span>(<strong><span class="number">0</span></strong>, <strong><span class="number">16</span></strong>):<br> |
| 5649 |
|
| 5650 |
<strong><span class= |
| 5651 |
"keyword">if</span></strong> code > <strong><span class="number">8</span></strong>:<br> |
| 5652 |
|
| 5653 |
level = <strong><span class="number">255</span></strong><br> |
| 5654 |
|
| 5655 |
<strong><span class= |
| 5656 |
"keyword">elif</span></strong> code == <strong><span class="number">7</span></strong>:<br> |
| 5657 |
|
| 5658 |
level = <strong><span class="number">229</span></strong><br> |
| 5659 |
|
| 5660 |
<strong><span class= |
| 5661 |
"keyword">else</span></strong>:<br> |
| 5662 |
level = <strong><span class="number">205</span></strong><br> |
| 5663 |
|
| 5664 |
r = <strong><span class= |
| 5665 |
"number">127</span></strong> <strong><span class= |
| 5666 |
"keyword">if</span></strong> code == <strong><span class="number">8</span></strong> <strong><span class="keyword">else</span></strong> level <strong><span class="keyword">if</span></strong> (code & <strong><span class="number">1</span></strong>) != <strong><span class="number">0</span></strong> <strong><span class="keyword">else</span></strong> <strong><span class="number">92</span></strong> <strong><span class="keyword">if</span></strong> code == <strong><span class="number">12</span></strong> <strong><span class="keyword">else</span></strong> <strong><span class="number">0</span></strong><br> |
| 5667 |
|
| 5668 |
g = <strong><span class= |
| 5669 |
"number">127</span></strong> <strong><span class= |
| 5670 |
"keyword">if</span></strong> code == <strong><span class="number">8</span></strong> <strong><span class="keyword">else</span></strong> level <strong><span class="keyword">if</span></strong> (code & <strong><span class="number">2</span></strong>) != <strong><span class="number">0</span></strong> <strong><span class="keyword">else</span></strong> <strong><span class="number">92</span></strong> <strong><span class="keyword">if</span></strong> code == <strong><span class="number">12</span></strong> <strong><span class="keyword">else</span></strong> <strong><span class="number">0</span></strong><br> |
| 5671 |
|
| 5672 |
b = <strong><span class= |
| 5673 |
"number">127</span></strong> <strong><span class= |
| 5674 |
"keyword">if</span></strong> code == <strong><span class="number">8</span></strong> <strong><span class="keyword">else</span></strong> <strong><span class="number">238</span></strong> <strong><span class="keyword">if</span></strong> code == <strong><span class="number">4</span></strong> <strong><span class="keyword">else</span></strong> level <strong><span class="keyword">if</span></strong> (code & <strong><span class="number">4</span></strong>) != <strong><span class="number">0</span></strong> <strong><span class="keyword">else</span></strong> <strong><span class="number">0</span></strong><br> |
| 5675 |
|
| 5676 |
<strong><span class= |
| 5677 |
"keyword">print</span></strong>(f<span class= |
| 5678 |
"literal">"{code:3d}: {r:02X} {g:02X} {b:02X}"</span>)<br> |
| 5679 |
|
| 5680 |
<br> |
| 5681 |
<strong><span class= |
| 5682 |
"keyword">print</span></strong>(<span class="literal">"colors 16-231 are a 6x6x6 color cube"</span>)<br> |
| 5683 |
|
| 5684 |
<strong><span class= |
| 5685 |
"keyword">for</span></strong> red <strong><span class="keyword">in</span></strong> <span class="ident2">range</span>(<strong><span class="number">0</span></strong>, <strong><span class="number">6</span></strong>):<br> |
| 5686 |
|
| 5687 |
<strong><span class= |
| 5688 |
"keyword">for</span></strong> green <strong><span class="keyword">in</span></strong> <span class="ident2">range</span>(<strong><span class="number">0</span></strong>, <strong><span class="number">6</span></strong>):<br> |
| 5689 |
|
| 5690 |
<strong><span class="keyword">for</span></strong> blue <strong><span class="keyword">in</span></strong> <span class="ident2">range</span>(<strong><span class="number">0</span></strong>, <strong><span class="number">6</span></strong>):<br> |
| 5691 |
|
| 5692 |
code = <strong><span class="number">16</span></strong> + (red * <strong><span class="number">36</span></strong>) + (green * <strong><span class="number">6</span></strong>) + blue<br> |
| 5693 |
|
| 5694 |
r = red * <strong><span class="number">40</span></strong> + <strong><span class="number">55</span></strong> <strong><span class="keyword">if</span></strong> red != <strong><span class="number">0</span></strong> <strong><span class="keyword">else</span></strong> <strong><span class="number">0</span></strong><br> |
| 5695 |
|
| 5696 |
g = green * <strong><span class="number">40</span></strong> + <strong><span class="number">55</span></strong> <strong><span class="keyword">if</span></strong> green != <strong><span class="number">0</span></strong> <strong><span class="keyword">else</span></strong> <strong><span class="number">0</span></strong><br> |
| 5697 |
|
| 5698 |
b = blue * <strong><span class="number">40</span></strong> + <strong><span class="number">55</span></strong> <strong><span class="keyword">if</span></strong> blue != <strong><span class="number">0</span></strong> <strong><span class="keyword">else</span></strong> <strong><span class="number">0</span></strong><br> |
| 5699 |
|
| 5700 |
<strong><span class="keyword">print</span></strong>(f<span class="literal">"{code:3d}: {r:02X} {g:02X} {b:02X}"</span>)<br> |
| 5701 |
|
| 5702 |
<br> |
| 5703 |
<strong><span class= |
| 5704 |
"keyword">print</span></strong>(<span class="literal">"colors 232-255 are a grayscale ramp, intentionally leaving out black and white"</span>)<br> |
| 5705 |
|
| 5706 |
code = <strong><span class= |
| 5707 |
"number">232</span></strong><br> |
| 5708 |
<strong><span class= |
| 5709 |
"keyword">for</span></strong> gray <strong><span class="keyword">in</span></strong> <span class="ident2">range</span>(<strong><span class="number">0</span></strong>, <strong><span class="number">24</span></strong>):<br> |
| 5710 |
|
| 5711 |
level = gray * <strong><span class="number">10</span></strong> + <strong><span class="number">8</span></strong><br> |
| 5712 |
|
| 5713 |
code = <strong><span class= |
| 5714 |
"number">232</span></strong> + gray<br> |
| 5715 |
<strong><span class= |
| 5716 |
"keyword">print</span></strong>(f<span class= |
| 5717 |
"literal">"{code:3d}: {level:02X} {level:02X} {level:02X}"</span>)<br> |
| 5718 |
|
| 5719 |
<!--atr2html}}--></p> |
| 5720 |
</blockquote> |
| 5721 |
|
| 5722 |
<h4 id="why_no_italics-id"><a name="why_no_italics" id= |
| 5723 |
"why_no_italics">Why doesn't xterm support italics?</a></h4> |
| 5724 |
|
| 5725 |
<p>Well, actually it does and it doesn't.</p> |
| 5726 |
|
| 5727 |
<p>You can display “any” font using xterm (though |
| 5728 |
proportional fonts may be disappointing).</p> |
| 5729 |
|
| 5730 |
<p>But xterm has specific types of graphic rendition that it will |
| 5731 |
do. If you want italics, then xterm has an option |
| 5732 |
(<code>italicULMode</code>) to use that rendition instead of |
| 5733 |
underlining. That is the usual typographic alternative, though of |
| 5734 |
course some people want both at the same time.</p> |
| 5735 |
|
| 5736 |
<p>However, standard curses does not support italics. Few |
| 5737 |
terminals do this reliably, so it was disregarded long ago, never |
| 5738 |
was supported except for low-level applications (in terminfo). No |
| 5739 |
bit was reserved in the curses header for adding italics for |
| 5740 |
high-level applications. (As a special case, ncurses was modified |
| 5741 |
to provide <a href="/ncurses/NEWS.html#t20130831">partial |
| 5742 |
support</a>, but programs using this feature will not work with |
| 5743 |
other implementations).</p> |
| 5744 |
|
| 5745 |
<p>XTerm stores each cell of the display in fixed-size |
| 5746 |
structures. One byte stores the graphic rendition. XTerm is using |
| 5747 |
all of the bits in this byte for its VT220 emulation:</p> |
| 5748 |
|
| 5749 |
<table border="1" summary="Bits for XTerm's graphic rendition"> |
| 5750 |
<tr> |
| 5751 |
<th>Mnemonic</th> |
| 5752 |
<th>Bit</th> |
| 5753 |
<th>Description</th> |
| 5754 |
</tr> |
| 5755 |
|
| 5756 |
<tr> |
| 5757 |
<td>INVERSE</td> |
| 5758 |
<td>0</td> |
| 5759 |
<td>show cell reverse-video</td> |
| 5760 |
</tr> |
| 5761 |
|
| 5762 |
<tr> |
| 5763 |
<td>UNDERLINE</td> |
| 5764 |
<td>1</td> |
| 5765 |
<td>show cell underlined</td> |
| 5766 |
</tr> |
| 5767 |
|
| 5768 |
<tr> |
| 5769 |
<td>BOLD</td> |
| 5770 |
<td>2</td> |
| 5771 |
<td>show cell as bold</td> |
| 5772 |
</tr> |
| 5773 |
|
| 5774 |
<tr> |
| 5775 |
<td>BLINK</td> |
| 5776 |
<td>3</td> |
| 5777 |
<td>show cell as blinking</td> |
| 5778 |
</tr> |
| 5779 |
|
| 5780 |
<tr> |
| 5781 |
<td>BG_COLOR</td> |
| 5782 |
<td>4</td> |
| 5783 |
<td>use background color</td> |
| 5784 |
</tr> |
| 5785 |
|
| 5786 |
<tr> |
| 5787 |
<td>FG_COLOR</td> |
| 5788 |
<td>5</td> |
| 5789 |
<td>use foreground color</td> |
| 5790 |
</tr> |
| 5791 |
|
| 5792 |
<tr> |
| 5793 |
<td>PROTECTED</td> |
| 5794 |
<td>6</td> |
| 5795 |
<td>character cannot be erased</td> |
| 5796 |
</tr> |
| 5797 |
|
| 5798 |
<tr> |
| 5799 |
<td>CHARDRAWN</td> |
| 5800 |
<td>7</td> |
| 5801 |
<td>character has been drawn here on the screen</td> |
| 5802 |
</tr> |
| 5803 |
</table> |
| 5804 |
|
| 5805 |
<p>While additional bytes could be added to each cell, the cost |
| 5806 |
to the typical user has so far not been in line with the |
| 5807 |
usefulness of the feature.</p> |
| 5808 |
|
| 5809 |
<p>For those who are not constrained by cost, since <a href= |
| 5810 |
"xterm.log.html#xterm_305">patch #305</a> xterm provides a |
| 5811 |
compile-time option to support italics. The main reason for |
| 5812 |
implementing this is to be able to test the italics feature added |
| 5813 |
in ncurses (patch <a href= |
| 5814 |
"/ncurses/NEWS.html#t20130831">5.9.20130831</a>):</p> |
| 5815 |
|
| 5816 |
<ul> |
| 5817 |
<li> |
| 5818 |
<p>this increases the size of the attributes data.</p> |
| 5819 |
</li> |
| 5820 |
|
| 5821 |
<li> |
| 5822 |
<p>the feature requires some overhead for font-switching |
| 5823 |
(treating italics as “rare”)</p> |
| 5824 |
</li> |
| 5825 |
</ul> |
| 5826 |
|
| 5827 |
<p>The increase in size is not entirely wasted. The SGR |
| 5828 |
attributes for <em>dim</em>, <em>strike-out</em>, and |
| 5829 |
<em>double-underscore</em> also are implemented. However, the |
| 5830 |
last two are not in the portable terminfo definition (from |
| 5831 |
X/Open), and are not supported in the higher-level curses |
| 5832 |
interface (there is no <code>A_STRIKE</code> for that |
| 5833 |
reason).</p> |
| 5834 |
|
| 5835 |
<p>Here are screenshots showing the ncurses test-program |
| 5836 |
displaying video attributes (including italics). The first uses |
| 5837 |
bitmap fonts:</p> |
| 5838 |
|
| 5839 |
<blockquote> |
| 5840 |
<p><a href= |
| 5841 |
"/ncurses/images/ncurses6-bitmap-italics.png"><img width="300" |
| 5842 |
src="/ncurses/images/ncurses6-bitmap-italics.png" alt= |
| 5843 |
"ncurses – video attributes with bitmap-font"></a></p> |
| 5844 |
</blockquote> |
| 5845 |
|
| 5846 |
<p>and the second uses a (same size) TrueType font:</p> |
| 5847 |
|
| 5848 |
<blockquote> |
| 5849 |
<p><a href= |
| 5850 |
"/ncurses/images/ncurses6-truetype-italics.png"><img width= |
| 5851 |
"300" src="/ncurses/images/ncurses6-truetype-italics.png" alt= |
| 5852 |
"ncurses – video attributes with TrueType font"></a></p> |
| 5853 |
</blockquote> |
| 5854 |
|
| 5855 |
<h4 id="grep_colors-id"><a name="grep_colors" id= |
| 5856 |
"grep_colors">"grep --color" does not show the right output</a></h4> |
| 5857 |
|
| 5858 |
<p>GNU grep (version 2.5) introduced a <code>--color</code> |
| 5859 |
option.</p> |
| 5860 |
|
| 5861 |
<p>It does this for each highlighted match:</p> |
| 5862 |
|
| 5863 |
<ol> |
| 5864 |
<li> |
| 5865 |
<p>it writes the text up to (not including the match)</p> |
| 5866 |
</li> |
| 5867 |
|
| 5868 |
<li> |
| 5869 |
<p>it writes an ANSI color control control sequence</p> |
| 5870 |
</li> |
| 5871 |
|
| 5872 |
<li> |
| 5873 |
<p>it writes the matched text</p> |
| 5874 |
</li> |
| 5875 |
|
| 5876 |
<li> |
| 5877 |
<p>it writes a control sequence to clear to the end of the |
| 5878 |
line</p> |
| 5879 |
</li> |
| 5880 |
|
| 5881 |
<li> |
| 5882 |
<p>it writes an ANSI control sequence to reset graphic |
| 5883 |
rendition.</p> |
| 5884 |
</li> |
| 5885 |
|
| 5886 |
<li> |
| 5887 |
<p>repeat this process until the entire line is written.</p> |
| 5888 |
</li> |
| 5889 |
</ol> |
| 5890 |
|
| 5891 |
<p>One problem is in the second and fourth steps. If the |
| 5892 |
preceding text brought us up to the last column, then xterm (and |
| 5893 |
any VT100-compatible terminal) is waiting for graphic text to |
| 5894 |
wrap to the next line. Any controls would take effect on the |
| 5895 |
current column position. Newlines are ignored while in this |
| 5896 |
state.</p> |
| 5897 |
|
| 5898 |
<p>However, if xterm gets a control sequence while waiting to |
| 5899 |
wrap to the next line, it will update the screen according to |
| 5900 |
that control. Then it is ready to accept more data. But at this |
| 5901 |
point, it is no longer waiting to wrap; the special case is for |
| 5902 |
newline versus graphic characters. For instance, backspacing |
| 5903 |
clears the state (<a href="/vttest/vttest.html">vttest</a> |
| 5904 |
illustrates this). So the data starts to write at the current |
| 5905 |
column (the last one on the line), rather than at the beginning |
| 5906 |
of the next line. In that case, grep's output will not look |
| 5907 |
right.</p> |
| 5908 |
|
| 5909 |
<p>Here are some relevant bug reports:</p> |
| 5910 |
|
| 5911 |
<ul> |
| 5912 |
<li> |
| 5913 |
<p><a href= |
| 5914 |
"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=456943">Debian |
| 5915 |
#456943 - grep: incorrect display with color and wrapping in |
| 5916 |
some terminals</a></p> |
| 5917 |
</li> |
| 5918 |
|
| 5919 |
<li> |
| 5920 |
<p><a href= |
| 5921 |
"https://bugzilla.redhat.com/show_bug.cgi?id=1006310">Fedora |
| 5922 |
#1006310 - xterm does not print a character if the character |
| 5923 |
is last on a row and a color-change ANSI sequence follows</a></p> |
| 5924 |
</li> |
| 5925 |
|
| 5926 |
<li> |
| 5927 |
<p><a href= |
| 5928 |
"https://web.archive.org/web/20150903071543/https://bugzilla.novell.com/show_bug.cgi?id=148844"> |
| 5929 |
Novell #148844 - terminal text wrapping bug</a></p> |
| 5930 |
</li> |
| 5931 |
</ul> |
| 5932 |
|
| 5933 |
<h4 id="vt100_wrapping-id"><a name="vt100_wrapping" id= |
| 5934 |
"vt100_wrapping">That description of wrapping is odd, say |
| 5935 |
more?</a></h4> |
| 5936 |
|
| 5937 |
<p>This is one of the aspects of the so-called "vt100 glitch", as |
| 5938 |
mentioned in the terminfo manpage:</p> |
| 5939 |
|
| 5940 |
<blockquote class="code-block"> |
| 5941 |
<p>Terminals which ignore a line-feed immediately after an am |
| 5942 |
wrap, such as the Concept and vt100, should indicate xenl.</p> |
| 5943 |
</blockquote> |
| 5944 |
|
| 5945 |
<p>When the terminal reaches the right margin, it is in a special |
| 5946 |
state where it ignores tab characters and other formatting |
| 5947 |
controls (carriage return and newline), and in effect is |
| 5948 |
expecting only printable characters to wrap to the next line.</p> |
| 5949 |
|
| 5950 |
<p>Without it, it is misleading to refer to a terminal as a vt100 |
| 5951 |
emulator. After all, it is a well-known feature named for the |
| 5952 |
VT100. The applicable standards (ISO-6429, ECMA-48) do not go |
| 5953 |
into enough detail to address this sort of behavior, so the other |
| 5954 |
terminal emulators can be referred to most accurately as ANSI |
| 5955 |
terminals (if they obey the other guidelines).</p> |
| 5956 |
|
| 5957 |
<p><a href="/vttest/CHANGES">In 2004</a>, I added a test-screen |
| 5958 |
to vttest to demonstrate this. It was in response to someone who |
| 5959 |
insisted that xterm was wrong and one of those other terminal |
| 5960 |
emulators was “right”. I investigated, found that the |
| 5961 |
behavior had not changed in xterm at least since the early 1990s, |
| 5962 |
and that it matched the description of behavior from the DEC |
| 5963 |
manuals. One of my users verified the correctness of the test on |
| 5964 |
a VT520.</p> |
| 5965 |
|
| 5966 |
<p>Reviewing the results with xterm-alikes or less ambitious |
| 5967 |
"vt100 emulators" in mid-2013:</p> |
| 5968 |
|
| 5969 |
<ul> |
| 5970 |
<li> |
| 5971 |
<p>xterm, kterm, mlterm, some operating system consoles are |
| 5972 |
consistent with the VT100 behavior.</p> |
| 5973 |
</li> |
| 5974 |
|
| 5975 |
<li> |
| 5976 |
<p>rxvt, screen, putty (pterm), konsole, vte (gnome-terminal, |
| 5977 |
xfce4-terminal) are not consistent with VT100 (and behave |
| 5978 |
differently compared to each other).</p> |
| 5979 |
|
| 5980 |
<p>I included screen here because it claims to be a vt100 |
| 5981 |
emulator, and putty since it claims to be an xterm emulator. |
| 5982 |
I did not include tmux, because it does not make either |
| 5983 |
claim.</p> |
| 5984 |
</li> |
| 5985 |
|
| 5986 |
<li> |
| 5987 |
<p>mrxvt does not get to that screen; it resizes its window |
| 5988 |
to a single line.</p> |
| 5989 |
</li> |
| 5990 |
</ul> |
| 5991 |
|
| 5992 |
<p>In the <a href="/vttest/vttest-wrap.html">vttest</a> page, I |
| 5993 |
have provided screenshots to illustrate these points.</p> |
| 5994 |
|
| 5995 |
<p>Since 2013, Mattias Engdegård created a test program to |
| 5996 |
explore this area, citing DEC's internal standard document for |
| 5997 |
terminals (<a href= |
| 5998 |
"https://www.bitsavers.org/pdf/dec/standards/EL-SM070-00_DEC_STD_070_Video_Systems_Reference_Manual_Dec91.pdf"><em>DEC |
| 5999 |
STD 070 Video Systems Reference Manual</em></a>). That document |
| 6000 |
refers to this as the <em>last column flag</em>.</p> |
| 6001 |
|
| 6002 |
<p>Revisiting this in 2019, no improvement has been observed in |
| 6003 |
the problematic programs from 2013. A VTE user gave this |
| 6004 |
example</p> |
| 6005 |
|
| 6006 |
<blockquote> |
| 6007 |
<!--{{atr2html--> |
| 6008 |
|
| 6009 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 6010 |
<span class="comment">#!/bin/bash</span><br> |
| 6011 |
<strong><span class= |
| 6012 |
"keyword">echo</span></strong> -e <span class= |
| 6013 |
"literal">"</span><strong><em><span class= |
| 6014 |
"keyword2">\</span></em></strong><span class= |
| 6015 |
"literal">e[2J"</span><br> |
| 6016 |
<strong><span class= |
| 6017 |
"keyword">echo</span></strong> -e <span class= |
| 6018 |
"literal">"</span><strong><em><span class= |
| 6019 |
"keyword2">\</span></em></strong><span class= |
| 6020 |
"literal">e[1;79Hx</span><strong><em><span class= |
| 6021 |
"keyword2">\</span></em></strong><span class= |
| 6022 |
"literal">b</span><strong><em><span class= |
| 6023 |
"keyword2">\</span></em></strong><span class= |
| 6024 |
"literal">vx</span><strong><em><span class= |
| 6025 |
"keyword2">\</span></em></strong><span class= |
| 6026 |
"literal">b</span><strong><em><span class= |
| 6027 |
"keyword2">\</span></em></strong><span class= |
| 6028 |
"literal">vx</span><strong><em><span class= |
| 6029 |
"keyword2">\</span></em></strong><span class= |
| 6030 |
"literal">n"</span><br> |
| 6031 |
<strong><span class= |
| 6032 |
"keyword">echo</span></strong> -e <span class= |
| 6033 |
"literal">"</span><strong><em><span class= |
| 6034 |
"keyword2">\</span></em></strong><span class= |
| 6035 |
"literal">e[5;80Hx</span><strong><em><span class= |
| 6036 |
"keyword2">\</span></em></strong><span class= |
| 6037 |
"literal">b</span><strong><em><span class= |
| 6038 |
"keyword2">\</span></em></strong><span class= |
| 6039 |
"literal">vx</span><strong><em><span class= |
| 6040 |
"keyword2">\</span></em></strong><span class= |
| 6041 |
"literal">b</span><strong><em><span class= |
| 6042 |
"keyword2">\</span></em></strong><span class= |
| 6043 |
"literal">vx</span><strong><em><span class= |
| 6044 |
"keyword2">\</span></em></strong><span class= |
| 6045 |
"literal">n"</span><br> |
| 6046 |
<!--atr2html}}--></p> |
| 6047 |
</blockquote> |
| 6048 |
|
| 6049 |
<p>In this case, DEC's documentation for the <em>last column |
| 6050 |
flag</em> mentions that cursor-positioning resets the flag. |
| 6051 |
Because <strong>xterm</strong> takes that into account (while the |
| 6052 |
others from 2013 do not), the example will show different |
| 6053 |
results. Markus Schmidt provided a screenshot which demonstrates |
| 6054 |
that DEC's documentation is correct and that some terminal |
| 6055 |
emulators (e.g., <strong>xterm</strong>, <em>zoc</em>, MacOS |
| 6056 |
<em>Terminal</em>, <em>st</em>) implement this detail in the same |
| 6057 |
way that the hardware terminal did:</p> |
| 6058 |
|
| 6059 |
<blockquote> |
| 6060 |
<p><a href="images/LCF-versus-CUP.jpg"><img width="200" src= |
| 6061 |
"images/LCF-versus-CUP.jpg" alt= |
| 6062 |
"screenshot of last column flag with cursor positioning"></a></p> |
| 6063 |
</blockquote> |
| 6064 |
|
| 6065 |
<h4><a id="bce_oddness" name="bce_oddness">That color scheme is |
| 6066 |
odd, say more?</a></h4> |
| 6067 |
|
| 6068 |
<p>Occasionally someone questions the behavior of the |
| 6069 |
<strong>bce</strong> (<em>background color erase</em>) feature in |
| 6070 |
<strong>xterm</strong>, and mentions that some DEC terminal did |
| 6071 |
not behave that way with ANSI colors.</p> |
| 6072 |
|
| 6073 |
<p>First off:</p> |
| 6074 |
|
| 6075 |
<ul> |
| 6076 |
<li> |
| 6077 |
<p>Aside from the VT525, DEC terminals had no support for |
| 6078 |
ANSI colors.</p> |
| 6079 |
</li> |
| 6080 |
|
| 6081 |
<li> |
| 6082 |
<p>Likely, they were thinking of a terminal <em>emulator</em> |
| 6083 |
which supported colors. A while back, there was more than one |
| 6084 |
which said they were a “VT340” and the |
| 6085 |
misconceptions began. Not all of those behaved the same.</p> |
| 6086 |
|
| 6087 |
<p>Some developers were aware of this, others were not. The |
| 6088 |
<em>comp.os.vms</em> newsgroup thread <a href= |
| 6089 |
"https://groups.google.com/forum/#!topic/comp.os.vms/U0kbnWP4dMU"> |
| 6090 |
<em>How to setting color in code for a VT terminal</em></a> |
| 6091 |
shows both.</p> |
| 6092 |
</li> |
| 6093 |
|
| 6094 |
<li> |
| 6095 |
<p>From the outset, <em>modern xterm</em> was a VT100 or |
| 6096 |
VT220 <em>with</em> ANSI colors. No technical manual was |
| 6097 |
available for a VT525 at the time. Lacking a technical |
| 6098 |
manual, information about a VT525 was no more reliable than |
| 6099 |
the statements about a VT340.</p> |
| 6100 |
</li> |
| 6101 |
</ul> |
| 6102 |
|
| 6103 |
<p>The design used for <strong>xterm</strong> imitated Linux |
| 6104 |
console, which itself came about from different people (see |
| 6105 |
<a href="/ncurses/ncurses-slang.html#cause_bce">this page</a> for |
| 6106 |
some background).</p> |
| 6107 |
|
| 6108 |
<p>The VT525 programmer's reference manual is vague on the |
| 6109 |
details (ANSI color is mentioned in a fraction of one percent of |
| 6110 |
the manual), but the DEC standard for terminals is clear that it |
| 6111 |
would not implement <em>bce</em>: any <em>erase</em> command will |
| 6112 |
reset the video attributes. It documents ANSI color in the |
| 6113 |
section on video attributes without mentioning a special case. |
| 6114 |
Color would be reset as well.</p> |
| 6115 |
|
| 6116 |
<h3 id="problems_weird-id"><a name="problems_weird" id= |
| 6117 |
"problems_weird">Odd behavior</a></h3> |
| 6118 |
|
| 6119 |
<h4 id="xterm_paste-id"><a name="xterm_paste" id= |
| 6120 |
"xterm_paste">Why can't I select/paste in xterm?</a></h4> |
| 6121 |
|
| 6122 |
<p>When an application sets xterm to any of its <a href= |
| 6123 |
"ctlseqs/ctlseqs.html#h2-Mouse-Tracking">mouse tracking |
| 6124 |
modes</a>, it reserves the <em>unshifted</em> mouse button clicks |
| 6125 |
for the application's use. Unless you have modified the treatment |
| 6126 |
of the shifted mouse button events (e.g., with your window |
| 6127 |
manager), you can always do select/paste by pressing the |
| 6128 |
<em>shift</em> key while clicking with the mouse.</p> |
| 6129 |
|
| 6130 |
<p>This is all done using the <em>translations</em> resource (see |
| 6131 |
the <a href= |
| 6132 |
"manpage/xterm.html#h3-Default-Key-Bindings"><em>Default Key |
| 6133 |
Bindings</em></a> section in the manual page).</p> |
| 6134 |
|
| 6135 |
<h4><a name="xterm_select_clipboard" id= |
| 6136 |
"xterm_select_clipboard">Why can't I select/paste to/from other |
| 6137 |
programs?</a></h4> |
| 6138 |
|
| 6139 |
<p>Whether you select text in xterm and paste into another |
| 6140 |
window, or the reverse, the X client in which you have |
| 6141 |
<em>selected</em> text may provide the data in different |
| 6142 |
<em>formats</em> and different <em>containers</em>:</p> |
| 6143 |
|
| 6144 |
<blockquote> |
| 6145 |
<dl> |
| 6146 |
<dt><em>formats</em> |
| 6147 |
</dt> |
| 6148 |
|
| 6149 |
<dd> |
| 6150 |
<p>Originally (and by default) xterm made the selected data |
| 6151 |
available with ISO-8859-1 encoding (Latin-1). Since |
| 6152 |
<a href="xterm.log.html#xterm_101">patch #101 (1999)</a>, |
| 6153 |
it has provided it also in UTF-8.</p> |
| 6154 |
|
| 6155 |
<p>Regarding the type of data:</p> |
| 6156 |
|
| 6157 |
<ul> |
| 6158 |
<li> |
| 6159 |
<p>X11R4's ICCM documented “string” |
| 6160 |
selection data with ISO-8859-1, while</p> |
| 6161 |
</li> |
| 6162 |
|
| 6163 |
<li> |
| 6164 |
<p>X11R6 documented "compound text" (another name for |
| 6165 |
multibyte encoding, without specifying <em>what</em> |
| 6166 |
encoding).</p> |
| 6167 |
</li> |
| 6168 |
|
| 6169 |
<li> |
| 6170 |
<p>Selection data using UTF-8 was an extension by |
| 6171 |
XFree86.</p> |
| 6172 |
</li> |
| 6173 |
</ul> |
| 6174 |
|
| 6175 |
<p>The client holding the selection advertises the formats |
| 6176 |
that it can provide, and other client(s) ask for it using |
| 6177 |
one of those formats.</p> |
| 6178 |
|
| 6179 |
<p>Xterm can ask for UTF-8 even if it is not configured to |
| 6180 |
use UTF-8. In that case, it converts (a small number of) |
| 6181 |
useful characters to their ASCII or VT100 line-graphics |
| 6182 |
equivalents, and uses a "#" character for those which |
| 6183 |
cannot be converted.</p> |
| 6184 |
</dd> |
| 6185 |
|
| 6186 |
<dt><em>containers</em> |
| 6187 |
</dt> |
| 6188 |
|
| 6189 |
<dd> |
| 6190 |
<p>By default, xterm follows the <a href= |
| 6191 |
"https://tronche.com/gui/x/icccm/"><em>Inter-Client |
| 6192 |
Communication Conventions Manual</em></a> (ICCM). That |
| 6193 |
dates back to X11R4 in 1989, with minor updates in 1996 for |
| 6194 |
X11R6. The copyright for ICCM 1.0 is 1988/1989, making it |
| 6195 |
slightly older than Microsoft Windows.</p> |
| 6196 |
|
| 6197 |
<p>The ICCM specifies <a href= |
| 6198 |
"https://tronche.com/gui/x/icccm/sec-2.html#s-2.6"><em>"selection |
| 6199 |
atoms"</em></a> which are maintained by the X server. |
| 6200 |
According to the ICCM:</p> |
| 6201 |
|
| 6202 |
<blockquote> |
| 6203 |
<p>The selection named by the atom <em>PRIMARY</em> is |
| 6204 |
used for all commands that take only a single argument |
| 6205 |
and is the principal means of communication between |
| 6206 |
clients that use the selection mechanism.</p> |
| 6207 |
</blockquote> |
| 6208 |
|
| 6209 |
<p>and</p> |
| 6210 |
|
| 6211 |
<blockquote> |
| 6212 |
<p>The selection named by the atom <em>CLIPBOARD</em> is |
| 6213 |
used to hold data that is being transferred between |
| 6214 |
clients, that is, data that usually is being cut or |
| 6215 |
copied, and then pasted.</p> |
| 6216 |
</blockquote> |
| 6217 |
|
| 6218 |
<p>xterm uses PRIMARY by default. The default translations |
| 6219 |
also update something called CUT_BUFFER0 (also <a href= |
| 6220 |
"https://tronche.com/gui/x/icccm/sec-3.html#s-3">part of |
| 6221 |
the ICCM</a>).</p> |
| 6222 |
|
| 6223 |
<p>Unlike the PRIMARY selection, a cut buffer can hold only |
| 6224 |
"type STRING and format 8" (which happens to be |
| 6225 |
ISO-8859-1). That sounds like a drawback, but on the other |
| 6226 |
hand, cut buffers are <em>persistent</em>, while the |
| 6227 |
PRIMARY selection is <em>not</em>. An X client can provide |
| 6228 |
data using the PRIMARY selection only as long as it |
| 6229 |
<em>holds</em> the selection.</p> |
| 6230 |
</dd> |
| 6231 |
</dl> |
| 6232 |
</blockquote> |
| 6233 |
|
| 6234 |
<p>If xterm does not own the selection, it cannot supply the data |
| 6235 |
(and you cannot select/paste). Initially, xterm held the PRIMARY |
| 6236 |
selection only as long as the text was highlighted. Another |
| 6237 |
application could assert the selection, but generally losing the |
| 6238 |
PRIMARY selection in xterm was the same as losing highlighting. |
| 6239 |
That has been improved, e.g., using the |
| 6240 |
<code>keepSelection</code> resource in <a href= |
| 6241 |
"xterm.log.html#xterm_230">patch #230</a> (2007), as well as |
| 6242 |
refinements to retain highlighting when it updates other parts of |
| 6243 |
the window.</p> |
| 6244 |
|
| 6245 |
<p>A more likely reason for failing to select/paste is that the |
| 6246 |
other application may not use the same <em>selection atom</em> |
| 6247 |
(container). In the mid-1990s, Netscape set out to compete with |
| 6248 |
Internet Explorer. Part of that involved copying many aspects of |
| 6249 |
the way Internet Explorer worked, including the way it worked |
| 6250 |
with the Microsoft Windows clipboard. Netscape on non-Windows |
| 6251 |
platforms, "of course" assumed the clipboard was the way to do |
| 6252 |
things, and used the X11 clipboard rather following the ICCM. |
| 6253 |
(The way it used the X11 clipboard was also not in line with the |
| 6254 |
ICCM, but it was “close”).</p> |
| 6255 |
|
| 6256 |
<p>Not all applications followed Netscape and its descendents, |
| 6257 |
making it a nuisance if one wanted to select/paste text to/from |
| 6258 |
the web browser.</p> |
| 6259 |
|
| 6260 |
<p>Since <a href="xterm.log.html#xterm_209">patch #209</a> |
| 6261 |
(2006), xterm has provided a workaround: a menu entry (and |
| 6262 |
resource <code>selectToClipboard</code>) which changes xterm's |
| 6263 |
behavior for a special token <em>SELECT</em> in its default |
| 6264 |
translations. If the resource is true (or the menu item enabled), |
| 6265 |
xterm provides its selection to the <em>CLIPBOARD</em>. A menu |
| 6266 |
item is provided, of course, since many applications follow the |
| 6267 |
ICCM. In the default translations, these lines use |
| 6268 |
<em>SELECT</em>:</p> |
| 6269 |
|
| 6270 |
<blockquote> |
| 6271 |
<pre class="code-block"> |
| 6272 |
Shift <KeyPress> Select:select-cursor-start() \ |
| 6273 |
select-cursor-end(SELECT, CUT_BUFFER0) \n\ |
| 6274 |
Shift <KeyPress> Insert:insert-selection(SELECT, CUT_BUFFER0) \n\ |
| 6275 |
</pre> |
| 6276 |
</blockquote> |
| 6277 |
|
| 6278 |
<h4 id="xterm_tabs-id"><a name="xterm_tabs" id="xterm_tabs">Why |
| 6279 |
can't I select tabs in xterm?</a></h4> |
| 6280 |
|
| 6281 |
<p>This issue was noted early on, <a href= |
| 6282 |
"xterm.faq.html#known_bugs">here</a> in 1997.</p> |
| 6283 |
|
| 6284 |
<p><strong>XTerm</strong> is copying from the screen, which |
| 6285 |
stores only printable characters. That includes spaces and |
| 6286 |
line-drawing characters. But tabs are special; they are used for |
| 6287 |
more than one purpose.</p> |
| 6288 |
|
| 6289 |
<p>If the screen is cleared in some part, that stores nulls. |
| 6290 |
Cursor addressing does not fill in nulls as it jumps around, |
| 6291 |
though xterm does supply blanks for the most useful cases, |
| 6292 |
especially when getting data for a selection.</p> |
| 6293 |
|
| 6294 |
<p>Full-screen programs such as text-editors tend to write in |
| 6295 |
random fashion, and generally do not print nulls to the screen. |
| 6296 |
Curses on the other hand, may supply tabs where you thought there |
| 6297 |
were none. Also, the terminal driver can expand tabs (and often |
| 6298 |
is set to do this by default).</p> |
| 6299 |
|
| 6300 |
<p>So the whole thing is unreliable: unless you make special |
| 6301 |
arrangements for each of the programs running inside xterm, you |
| 6302 |
would often get a tab when you expect, and vice versa.</p> |
| 6303 |
|
| 6304 |
<p>For the special case where your expectations would match the |
| 6305 |
available data, it is solvable. There are basically two ways it |
| 6306 |
could be done:</p> |
| 6307 |
|
| 6308 |
<ul> |
| 6309 |
<li> |
| 6310 |
<p>set a bit in each cell's data which says it was skipped |
| 6311 |
over via a tab. The complication is that xterm is using all |
| 6312 |
of the flag bits in each cell.</p> |
| 6313 |
</li> |
| 6314 |
|
| 6315 |
<li> |
| 6316 |
<p>store literal tabs and nulls to be interpreted later |
| 6317 |
– both by the display and the selection logic.</p> |
| 6318 |
</li> |
| 6319 |
</ul> |
| 6320 |
|
| 6321 |
<p>As of 2010, a few other terminals did implement this feature. |
| 6322 |
But the reason that it's been low-priority is that it's of very |
| 6323 |
limited usefulness when copying between terminal sessions (and |
| 6324 |
for that matter, from other clients).</p> |
| 6325 |
|
| 6326 |
<h4><a name="xterm_paste_nl" id="xterm_paste_nl">Can |
| 6327 |
bracketed-paste solve my problems?</a></h4> |
| 6328 |
|
| 6329 |
<p>That depends. Bracketed-paste only gives an application a |
| 6330 |
<em>clue</em> that the input from the keyboard is being pasted |
| 6331 |
rather than typed. It was intended to help with the |
| 6332 |
<em>autoindent</em> feature in text editors. But not all programs |
| 6333 |
recognize the feature (see <a href="xterm-paste64.html">this |
| 6334 |
page</a> for more information).</p> |
| 6335 |
|
| 6336 |
<h4 id="xterm_resize-id"><a name="xterm_resize" id= |
| 6337 |
"xterm_resize">FVWM does weird things when I try to resize |
| 6338 |
xterm</a></h4> |
| 6339 |
|
| 6340 |
<p>I have an old (3.1.2G) bug report for xterm which may be |
| 6341 |
related to the second (3.9s) problem:</p> |
| 6342 |
|
| 6343 |
<ul> |
| 6344 |
<li> |
| 6345 |
<p>Steven Lang <[email protected]> reports a problem with |
| 6346 |
extra resize events for xterm.</p> |
| 6347 |
|
| 6348 |
<p>When I change font size often I will get the |
| 6349 |
double-refresh, and when that happens the text program gets 2 |
| 6350 |
resize events.. Running a quick test, I got this: Going to a |
| 6351 |
bigger font, it got a 53x20 resize, then a 80x24 resize. |
| 6352 |
Going to a smaller font, it got a 120x27 resize, then a 80x24 |
| 6353 |
resize.</p> |
| 6354 |
|
| 6355 |
<p>Earlier I made a mention of changing font size in rxvt |
| 6356 |
(And xterm does it to) causing 2 resize events. Well I just |
| 6357 |
happened to do it in fvwm (Instead of fvwm 95) and found it |
| 6358 |
seems to be a 'feature' of fvwm95, not XFree86 as I'd |
| 6359 |
initially assumed.</p> |
| 6360 |
</li> |
| 6361 |
|
| 6362 |
<li> |
| 6363 |
<p>Stephen Marley <[email protected]> reports a problem |
| 6364 |
with the active icon (from X11R6.3 xterm):</p> |
| 6365 |
|
| 6366 |
<p>Using the XFree86 xterm-53 with the active icon feature |
| 6367 |
on, I get some problems resizing where the xterm window |
| 6368 |
shrinks as small as possible and won't stay at whatever size |
| 6369 |
you set it thereafter.</p> |
| 6370 |
|
| 6371 |
<p>Comment out the PixmapPath and IconPath from your .fvwmrc |
| 6372 |
file to disable the fvwm icons and restart the WM. Start an |
| 6373 |
xterm. Iconify xterm and maximize it again. Use resize button |
| 6374 |
or corners to resize the xterm.</p> |
| 6375 |
|
| 6376 |
<p>The xterm now shrinks to a tiny size and attempts to |
| 6377 |
resize it result in it shrinking again.</p> |
| 6378 |
|
| 6379 |
<p>I've tried this with fvwm 1.23 and fvwm 2.0.46 with the |
| 6380 |
same results. Olvm, olvwm and twm all behave correctly so it |
| 6381 |
may be a fvwm problem.</p> |
| 6382 |
</li> |
| 6383 |
</ul> |
| 6384 |
|
| 6385 |
<p>I have not observed the first, but have reproduced the |
| 6386 |
second.</p> |
| 6387 |
|
| 6388 |
<h4 id="xterm_tite-id"><a name="xterm_tite" id="xterm_tite">Why |
| 6389 |
doesn't the screen clear when running vi?</a></h4> |
| 6390 |
|
| 6391 |
<p>This refers to the "alternate screen" feature, which has been |
| 6392 |
used in its termcap file since 1988. On various systems, this |
| 6393 |
feature may have been removed, although it has always been in the |
| 6394 |
xterm sources.</p> |
| 6395 |
|
| 6396 |
<p>The feature is controllable (it can be enabled or disabled). |
| 6397 |
However, as it was originally conceived, that ability to control |
| 6398 |
it applies only to programs using termcap.</p> |
| 6399 |
|
| 6400 |
<p>Under SunOS 4.x, the termcap description for xterm embeds in |
| 6401 |
the <code>ti</code> and <code>te</code> capabilities a command to |
| 6402 |
switch to xterm's alternate screen (e.g., while running |
| 6403 |
<code>vi</code>), and return to the normal screen on exit. This |
| 6404 |
has the effect of clearing the screen. The corresponding terminfo |
| 6405 |
symbols for <code>ti</code> and <code>te</code> are |
| 6406 |
<code>smcup</code> and <code>rmcup</code>, respectively.</p> |
| 6407 |
|
| 6408 |
<p>Beginning with Solaris 2.x, the terminfo description did not |
| 6409 |
use the alternate screen (it is a matter of preference after |
| 6410 |
all), so that the text from vi remains on the screen after exit. |
| 6411 |
Sun patched the X11R5 terminfo description to omit the |
| 6412 |
<code>smcup</code> and <code>rmcup</code> capabilities. However, |
| 6413 |
Sun began distributing modern xterm on the <em>freeware |
| 6414 |
companion</em> (a CDROM) beginning with Solaris 8. In Solaris 10 |
| 6415 |
for instance, the ncurses 5.6 package provided a usable terminal |
| 6416 |
description for xterm which uses the alternate screen. Solaris 11 |
| 6417 |
distributes modern xterm (though perhaps oddly) using an |
| 6418 |
old—unpatched—terminal description.</p> |
| 6419 |
|
| 6420 |
<p>Because it is in the terminal description, the feature is |
| 6421 |
configurable...</p> |
| 6422 |
|
| 6423 |
<p>For example (from Bjorn Helgaas <[email protected]>) this |
| 6424 |
procedure adds these capabilities to the “xterm” |
| 6425 |
terminfo definition on HP-UX 10.20:</p> |
| 6426 |
|
| 6427 |
<blockquote class="code-block"> |
| 6428 |
<!--{{atr2html--> |
| 6429 |
|
| 6430 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 6431 |
cp /usr/lib/terminfo/x/xterm /usr/lib/terminfo/x/xterm.orig<br> |
| 6432 |
|
| 6433 |
untic xterm > /tmp/xterm.src<br> |
| 6434 |
<span class="keyword">echo</span> <span class= |
| 6435 |
"literal">" smcup=</span><span class= |
| 6436 |
"keyword2">\</span><span class="literal">E7</span><span class= |
| 6437 |
"keyword2">\</span><span class= |
| 6438 |
"literal">E[?47h, rmcup=</span><span class= |
| 6439 |
"keyword2">\</span><span class= |
| 6440 |
"literal">E[2J</span><span class="keyword2">\</span><span class="literal">E[?47l</span><span class="keyword2">\</span><span class="literal">E8,"</span> >> /tmp/xterm.src<br> |
| 6441 |
|
| 6442 |
tic /tmp/xterm.src<br> |
| 6443 |
<!--atr2html}}--></p> |
| 6444 |
</blockquote> |
| 6445 |
|
| 6446 |
<p>In this example, the terminfo strings are a series of |
| 6447 |
operations:</p> |
| 6448 |
|
| 6449 |
<blockquote> |
| 6450 |
<dl> |
| 6451 |
<dt><code>smcup</code> |
| 6452 |
</dt> |
| 6453 |
|
| 6454 |
<dd><code>\E7</code> saves the cursor's position</dd> |
| 6455 |
|
| 6456 |
<dd><code>\E[?47h</code> switches to the alternate |
| 6457 |
screen</dd> |
| 6458 |
|
| 6459 |
<dt><code>rmcup</code> |
| 6460 |
</dt> |
| 6461 |
|
| 6462 |
<dd><code>\E[2J</code> clears the screen (assumed to be the |
| 6463 |
alternate screen)</dd> |
| 6464 |
|
| 6465 |
<dd><code>\E[?47l</code> switches back to the normal |
| 6466 |
screen</dd> |
| 6467 |
|
| 6468 |
<dd><code>\E8</code> restores the cursor's position.</dd> |
| 6469 |
</dl> |
| 6470 |
</blockquote> |
| 6471 |
|
| 6472 |
<p>However, xterms that are linked with termcap are more flexible |
| 6473 |
in this area than those linked with terminfo libraries. The xterm |
| 6474 |
program supports a resource <code>titeInhibit</code> which |
| 6475 |
manipulates the $TERMCAP variable to accomplish this. It sets the |
| 6476 |
$TERMCAP variable for the client with the <code>ti</code> and |
| 6477 |
<code>te</code> capabilities suppressed. Systems that use |
| 6478 |
terminfo cannot do this. If you are running terminfo with the |
| 6479 |
alternate screen controls in the terminal description, then you |
| 6480 |
can suppress the switching to the alternate screen by the |
| 6481 |
<code>titeInhibit</code>, but not the associated cursor |
| 6482 |
save/restore and clear-screen operations.</p> |
| 6483 |
|
| 6484 |
<p><a href="/xterm/xterm.log.html#xterm_54">XFree86 3.9s</a> |
| 6485 |
xterm implemented a different set of controls (private setmodes |
| 6486 |
1047, 1048 and 1049) which address this (in addition to the older |
| 6487 |
set of controls, for compatibility). The new set of controls |
| 6488 |
implements the entire <code>ti</code> sequence (save cursor, |
| 6489 |
switch to alternate screen, clear screen) and <code>te</code> |
| 6490 |
(switch to normal screen, restore cursor) as two control |
| 6491 |
sequences that can be disabled by <code>titeInhibit</code>.</p> |
| 6492 |
|
| 6493 |
<p>The 1049 code is a refinement of 1047 and 1048, clearing the |
| 6494 |
alternate screen before switching to it rather than after |
| 6495 |
switching back to the normal screen. Since <a href= |
| 6496 |
"xterm.log.html#xterm_90">patch #90 in 1998</a> xterm allows you |
| 6497 |
(with a popup menu entry designed to exploit this behavior) to |
| 6498 |
switch the display back to the alternate screen to select text |
| 6499 |
from it, to paste into the normal screen. You can also set or |
| 6500 |
clear the <code>titeInhibit</code> resource using another popup |
| 6501 |
menu entry (<code>Enable Alternate Screen Switching</code>).</p> |
| 6502 |
|
| 6503 |
<p>Most other terminal emulators implement only half of the |
| 6504 |
feature. They recognize the control sequence, but do not provide |
| 6505 |
the ability to change it at runtime, e.g., using a menu entry. |
| 6506 |
Like any other half-done implementation, that is a bug which |
| 6507 |
should be reported to the developers of those programs.</p> |
| 6508 |
|
| 6509 |
<h4 id="xterm_form_feed-id"><a name="xterm_form_feed" id= |
| 6510 |
"xterm_form_feed">Why doesn't the screen clear when I type |
| 6511 |
control/L?</a></h4> |
| 6512 |
|
| 6513 |
<p><em>Control/L</em> is ASCII <em>form-feed</em>. Printers do |
| 6514 |
something with form-feed. Terminals do not, as a rule (though I |
| 6515 |
agree it would be nice, e.g., <a href= |
| 6516 |
"/personal/oldprogs.html#repaginator">this</a>).</p> |
| 6517 |
|
| 6518 |
<p>Interpreting form-feed is normally done by your shell, not by |
| 6519 |
the terminal emulator. In a quick check:</p> |
| 6520 |
|
| 6521 |
<ul> |
| 6522 |
<li> |
| 6523 |
<p>bash, tcsh, zsh interpret form-feed by clearing the |
| 6524 |
screen, while</p> |
| 6525 |
</li> |
| 6526 |
|
| 6527 |
<li> |
| 6528 |
<p>csh, dash, ksh, mksh, yash do not</p> |
| 6529 |
</li> |
| 6530 |
</ul> |
| 6531 |
|
| 6532 |
<p>VT100s did not respond to form-feed. A few terminal emulators |
| 6533 |
interpret form-feed (PuTTY and SunOS console), but neither |
| 6534 |
matches VT100 behavior.</p> |
| 6535 |
|
| 6536 |
<p>Because most people do not see the difference between a |
| 6537 |
form-feed which they type (and is presumably echoed as a |
| 6538 |
form-feed) versus a form-feed which is sent from an application |
| 6539 |
to the terminal, this leads to confusion. <a href= |
| 6540 |
"https://www.thecodingforums.com/threads/screen-editing.444014/page-2#post-2480220"> |
| 6541 |
Several years ago</a>, I pointed this out as one of the errors in |
| 6542 |
the <a href="https://c-faq.com/osdep/termcap.html">C FAQ</a> |
| 6543 |
(notwithstanding Summit's comment, he did not update the |
| 6544 |
FAQ).</p> |
| 6545 |
|
| 6546 |
<h4 id="xterm_vite-id"><a name="xterm_vite" id="xterm_vite">Why |
| 6547 |
is the cursor misplaced after running vi?</a></h4> |
| 6548 |
|
| 6549 |
<p>Vi and other full-screen applications use the termcap |
| 6550 |
<code>ti/te</code> (terminfo <code>smcup/rmcup</code>) strings to |
| 6551 |
initiate and end cursor addressing mode. As mentioned in the |
| 6552 |
discussion of <a href= |
| 6553 |
"xterm.faq.html#xterm_tite">titeInhibit</a>, full-screen |
| 6554 |
applications can expect the initialization string to save the |
| 6555 |
cursor's position, and the end-string to restore it.</p> |
| 6556 |
|
| 6557 |
<p>A few applications (reportedly IRIX 5.x and 6.x |
| 6558 |
<code>vi</code> incorrectly move the cursor before initializing |
| 6559 |
cursor-addressing. This will cause the end-string to restore the |
| 6560 |
cursor to its position when it was saved by the initialization |
| 6561 |
string (typically at the upper left corner of the screen).</p> |
| 6562 |
|
| 6563 |
<p>The usual reason is due to the cursor save/restore controls in |
| 6564 |
the <code>ti/te</code> strings. If your application runs a |
| 6565 |
subprocess which in turn runs another full-screen application (or |
| 6566 |
when reinitializing the screen after the shell process), it will |
| 6567 |
save the cursor position again, so the position which is restored |
| 6568 |
when finally exiting your program is the last one saved, not the |
| 6569 |
first. Modern xterm (from late 1998, <a href= |
| 6570 |
"xterm.log.html#xterm_90">patch 90</a>) changes the behavior of |
| 6571 |
the cursor save/restore operations so they apply only to the |
| 6572 |
current screen. That makes it less likely to misplace your |
| 6573 |
cursor.</p> |
| 6574 |
|
| 6575 |
<h4 id="narrowproto-id"><a name="narrowproto" id= |
| 6576 |
"narrowproto">Why doesn't the scrollbar work?</a></h4> |
| 6577 |
|
| 6578 |
<p>Originally xterm was built using imake rather than a configure |
| 6579 |
script. One feature of imake that is not possible to guess within |
| 6580 |
the configure script is the wide-prototype compile-time |
| 6581 |
definition NARROWPROTO. When this is not set properly, the Athena |
| 6582 |
widget scrollbars do not work properly. xterm's configure script |
| 6583 |
has a fallback case which allows disabling imake. However, this |
| 6584 |
is moot with the Xorg “modular” build, whose compiler |
| 6585 |
options are unrelated to imake or older versions of any libraries |
| 6586 |
that it may distribute. In this case, the configure script needs |
| 6587 |
some help. Use this option to enable or disable NARROW proto (and |
| 6588 |
disable imake with the --disable-imake option) to match the whims |
| 6589 |
of Xorg hackers.</p> |
| 6590 |
|
| 6591 |
<p>For instance</p> |
| 6592 |
|
| 6593 |
<blockquote> |
| 6594 |
<pre class="code-block"> |
| 6595 |
configure --disable-imake --disable-narrowproto |
| 6596 |
</pre> |
| 6597 |
</blockquote> |
| 6598 |
|
| 6599 |
<h4 id="xaw_scrollbars-id"><a name="xaw_scrollbars" id= |
| 6600 |
"xaw_scrollbars">Can I improve the scrollbars?</a></h4> |
| 6601 |
|
| 6602 |
<p>Is that a problem with the appearance, or the way they |
| 6603 |
work?</p> |
| 6604 |
|
| 6605 |
<p>The appearance can be modified (though few do this) by linking |
| 6606 |
with one of the variants of the Athena widget set (Xaw).</p> |
| 6607 |
|
| 6608 |
<p>To illustrate, here are a few screenshots:</p> |
| 6609 |
|
| 6610 |
<blockquote> |
| 6611 |
<dl> |
| 6612 |
<dt>Xaw (default)</dt> |
| 6613 |
|
| 6614 |
<dd> |
| 6615 |
<p><a href="images/xterm-Xaw.png"><img width="300" src= |
| 6616 |
"images/xterm-Xaw.png" alt= |
| 6617 |
"xterm – default scrollbar with Xaw"></a></p> |
| 6618 |
</dd> |
| 6619 |
|
| 6620 |
<dt>XawPlus</dt> |
| 6621 |
|
| 6622 |
<dd> |
| 6623 |
<p><a href="images/xterm-XawPlus.png"><img width="300" src= |
| 6624 |
"images/xterm-XawPlus.png" alt= |
| 6625 |
"xterm – scrollbar with XawPlus"></a></p> |
| 6626 |
</dd> |
| 6627 |
|
| 6628 |
<dt>Xaw3d</dt> |
| 6629 |
|
| 6630 |
<dd> |
| 6631 |
<p><a href="images/xterm-Xaw3d.png"><img width="300" src= |
| 6632 |
"images/xterm-Xaw3d.png" alt= |
| 6633 |
"xterm – scrollbar with Xaw3d"></a></p> |
| 6634 |
</dd> |
| 6635 |
|
| 6636 |
<dt>neXtaw</dt> |
| 6637 |
|
| 6638 |
<dd> |
| 6639 |
<p><a href="images/xterm-neXtaw.png"><img width="300" src= |
| 6640 |
"images/xterm-neXtaw.png" alt= |
| 6641 |
"xterm – scrollbar with neXtaw"></a></p> |
| 6642 |
</dd> |
| 6643 |
</dl> |
| 6644 |
</blockquote> |
| 6645 |
|
| 6646 |
<p>Those variants use the same calling interface, so supporting |
| 6647 |
them is simple. Adapting to other toolkits would be much more |
| 6648 |
difficult. For instance (see the discussion of <a href= |
| 6649 |
"#bug_mxterm">mxterm</a>), replacing the scrollbars may require |
| 6650 |
replacing other parts from the library to get consistent |
| 6651 |
initialization and operation. In the case of Motif, it had |
| 6652 |
nothing like the Athena widget set's popup menus.</p> |
| 6653 |
|
| 6654 |
<h4 id="scroll_speed-id"><a name="scroll_speed" id= |
| 6655 |
"scroll_speed">Can I improve the scrolling speed?</a></h4> |
| 6656 |
|
| 6657 |
<p>Several years ago (before 2010) there was a <a href= |
| 6658 |
"https://web.archive.org/web/20091210162250/https://martin.ankerl.com/2007/09/01/comprehensive-linux-terminal-performance-comparison/"> |
| 6659 |
webpage</a> which gave its author's notion of what constituted a |
| 6660 |
“good” terminal emulator: |
| 6661 |
<strong><code>cat</code></strong>'ing (sending) a large file to |
| 6662 |
the terminal would complete in minimal time. Apparently that was |
| 6663 |
the sole interest. Interestingly, its author stated that |
| 6664 |
<em>xterm</em> was the slowest although the presented data do not |
| 6665 |
show this. Also, although the page says “Linux” some |
| 6666 |
of the data are for programs running on |
| 6667 |
<strong><em>Windows</em></strong>. The page spawned a few |
| 6668 |
imitators (with no better methodology), none was systematic, none |
| 6669 |
did any analysis.</p> |
| 6670 |
|
| 6671 |
<p>Of course, developers do not do that in practice. The terminal |
| 6672 |
is useful for interactive tasks. Compiling is best done by |
| 6673 |
redirecting the build messages to a log file or using a batch |
| 6674 |
process. End users have a different outlook.</p> |
| 6675 |
|
| 6676 |
<p>There is more than one factor involved in scrolling speed. |
| 6677 |
Here are a few:</p> |
| 6678 |
|
| 6679 |
<ul> |
| 6680 |
<li> |
| 6681 |
<p>When <strong>xterm</strong> was first written, machines |
| 6682 |
had less memory, and scrolling back a thousand lines seemed |
| 6683 |
good enough for users. Internally, <em>xterm</em> stored the |
| 6684 |
current screen and saved-lines in a large array. It scrolled |
| 6685 |
the array by shifting the entire array by a given number of |
| 6686 |
rows. For a thousand lines saved-lines (the scrollback |
| 6687 |
region), that works well enough.</p> |
| 6688 |
|
| 6689 |
<p>But the <a href= |
| 6690 |
"manpage/xterm.html#VT100-Widget-Resources:saveLines"><code>saveLines</code></a> |
| 6691 |
resource allows a full <em>integer</em>, and during the |
| 6692 |
mid/late-1990s, a few users found that setting the resource |
| 6693 |
to a million lines made <em>xterm</em> very slow.</p> |
| 6694 |
|
| 6695 |
<p>Still, the graphics display was fast enough. By the way, |
| 6696 |
<em>xterm</em> uses the <em>XCopyArea</em> function, and |
| 6697 |
normally (attempts to) display all of the updates to the |
| 6698 |
screen.</p> |
| 6699 |
</li> |
| 6700 |
|
| 6701 |
<li> |
| 6702 |
<p>Later, <strong>rxvt</strong> came along. It limited the |
| 6703 |
number of saved-lines to a signed 16-bit integer, i.e., 32767 |
| 6704 |
(and some packagers limited it to only a few thousand lines), |
| 6705 |
and moved just the pointers to the line data when scrolling |
| 6706 |
rather than shifting all of the text. It also uses |
| 6707 |
<em>XCopyArea</em>, noting in its features</p> |
| 6708 |
|
| 6709 |
<blockquote> |
| 6710 |
<pre class="code-block"> |
| 6711 |
/* |
| 6712 |
* Define to remove support for XCopyArea() support. XCopyArea() is useful |
| 6713 |
* for scrolling on non-local X displays |
| 6714 |
*/ |
| 6715 |
/* #define NO_SLOW_LINK_SUPPORT */ |
| 6716 |
</pre> |
| 6717 |
</blockquote> |
| 6718 |
|
| 6719 |
<p>Unlike <em>xterm</em>, <em>rxvt</em> did not attempt to |
| 6720 |
display all updates. If it fell behind, it would discard some |
| 6721 |
of the updates, to catch up. Doing that had a greater effect |
| 6722 |
on the apparent scrolling speed than its internal memory |
| 6723 |
organization, since it was useful for any number of |
| 6724 |
saved-lines. One drawback was that ASCII animations were |
| 6725 |
somewhat erratic.</p> |
| 6726 |
</li> |
| 6727 |
|
| 6728 |
<li> |
| 6729 |
<p>A few other terminal emulators, such as |
| 6730 |
<strong>konsole</strong> copied the <em>rxvt</em> feature. |
| 6731 |
Others copied, in turn, from whatever source. As a result, |
| 6732 |
one cannot compare the speed of different terminal emulators, |
| 6733 |
since they do not follow the same rules.</p> |
| 6734 |
</li> |
| 6735 |
|
| 6736 |
<li> |
| 6737 |
<p>The issue with <em>xterm</em> shifting a large array was a |
| 6738 |
problem which was addressed by changing all of the pointers |
| 6739 |
to its line data into a <a href= |
| 6740 |
"https://www.geeksforgeeks.org/dsa/implementation-deque-using-circular-array/"> |
| 6741 |
<em>circular array</em></a> in 2009 (<a href= |
| 6742 |
"xterm.log.html#xterm_244">patch #244</a>).</p> |
| 6743 |
</li> |
| 6744 |
|
| 6745 |
<li> |
| 6746 |
<p>Even after improving the memory performance of scrolling, |
| 6747 |
<em>rxvt</em> and its imitators still appeared to scroll |
| 6748 |
faster.</p> |
| 6749 |
|
| 6750 |
<p>The <a href= |
| 6751 |
"manpage/xterm.html#VT100-Widget-Resources:fastScroll"><code>fastScroll</code></a> |
| 6752 |
resource added in patch #244 provides a simple implementation |
| 6753 |
of the <em>rxvt</em> (mis?)feature for <em>xterm</em>.</p> |
| 6754 |
|
| 6755 |
<p>As implemented, it is rather crude (sometimes |
| 6756 |
<em>xterm</em> — like <em>konsole</em> — appears |
| 6757 |
to stop, since it is waiting for a new set of screen updates |
| 6758 |
after having discarded some).</p> |
| 6759 |
</li> |
| 6760 |
</ul> |
| 6761 |
|
| 6762 |
<p>Scrolling speed is only one aspect of terminal speed, but it |
| 6763 |
is easy to measure. Other aspects (such as the speed with which |
| 6764 |
an application can change color, move the cursor around the |
| 6765 |
screen, write text in various places) can also be measured. But |
| 6766 |
comparing terminals based on that speed can be misleading. When |
| 6767 |
the terminal drops updates to keep up with an application's |
| 6768 |
speed, the result may be unnoticeable (if the application is fast |
| 6769 |
enough), or it may not.</p> |
| 6770 |
|
| 6771 |
<p>For example, running the <strong>dots</strong> program from |
| 6772 |
the <a href="/ncurses/ncurses-examples.html">ncurses-examples</a> |
| 6773 |
shows some interesting misbehavior with <em>gnome-terminal</em> |
| 6774 |
and <em>konsole</em>: both “choke” at times for a few |
| 6775 |
seconds. The <em>dots</em> program prints colored cells randomly |
| 6776 |
around the screen, pausing briefly 1% of the time. However when |
| 6777 |
<em>dots</em> is terminated, it prints the program's notion of |
| 6778 |
the output rate. In spite of the pauses, the program saw a fairly |
| 6779 |
good rate of output. Some terminal emulators cannot keep up with |
| 6780 |
<em>dots</em>; one possible explanation for the discrepancy is |
| 6781 |
that the terminal emulator discards output (as in the special |
| 6782 |
case of scrolling).</p> |
| 6783 |
|
| 6784 |
<p>Seeing that raised the question of what variation to expect |
| 6785 |
from different terminal emulators, to point out which might |
| 6786 |
discard output to achieve fast scrolling speeds. A simple script |
| 6787 |
showing the elapsed time to send <em>ncurses</em>'s <a href= |
| 6788 |
"/ncurses/terminfo.src.html"><code>terminfo.src</code></a> |
| 6789 |
(1.1Mb) a given number of times to the terminal was used. Here is |
| 6790 |
a table illustrating the differences, using the available |
| 6791 |
terminal emulators for Fedora 26 and Ubuntu 17 in November |
| 6792 |
2017:</p> |
| 6793 |
|
| 6794 |
<table border="1" summary="examples of scrolling speed"> |
| 6795 |
<tr> |
| 6796 |
<th rowspan="2" style="width:6em;">Mode</th> |
| 6797 |
<th rowspan="2" style="width:10em;">Terminal</th> |
| 6798 |
<th colspan="3">Fedora</th> |
| 6799 |
<th colspan="3">Ubuntu</th> |
| 6800 |
</tr> |
| 6801 |
|
| 6802 |
<tr> |
| 6803 |
<th style="width:4em;">1</th> |
| 6804 |
<th style="width:4em;">10</th> |
| 6805 |
<th style="width:4em;">99</th> |
| 6806 |
<th style="width:4em;">1</th> |
| 6807 |
<th style="width:4em;">10</th> |
| 6808 |
<th style="width:4em;">99</th> |
| 6809 |
</tr> |
| 6810 |
|
| 6811 |
<tr> |
| 6812 |
<td rowspan="10" align="center">Remote</td> |
| 6813 |
<td>gnome-terminal</td> |
| 6814 |
<td>(1)</td> |
| 6815 |
<td>(1)</td> |
| 6816 |
<td>(1)</td> |
| 6817 |
<td>(1)</td> |
| 6818 |
<td>(1)</td> |
| 6819 |
<td>(1)</td> |
| 6820 |
</tr> |
| 6821 |
|
| 6822 |
<tr> |
| 6823 |
<td>konsole</td> |
| 6824 |
<td>0.12</td> |
| 6825 |
<td>2.10</td> |
| 6826 |
<td>23.2</td> |
| 6827 |
<td>0.26</td> |
| 6828 |
<td>2.65</td> |
| 6829 |
<td>25.7</td> |
| 6830 |
</tr> |
| 6831 |
|
| 6832 |
<tr> |
| 6833 |
<td>mlterm</td> |
| 6834 |
<td>(2)</td> |
| 6835 |
<td>(2)</td> |
| 6836 |
<td>(2)</td> |
| 6837 |
<td>0.30</td> |
| 6838 |
<td>3.07</td> |
| 6839 |
<td>30.4</td> |
| 6840 |
</tr> |
| 6841 |
|
| 6842 |
<tr> |
| 6843 |
<td>pterm / putty</td> |
| 6844 |
<td>0.15</td> |
| 6845 |
<td>1.42</td> |
| 6846 |
<td>14.6</td> |
| 6847 |
<td>0.55</td> |
| 6848 |
<td>5.66</td> |
| 6849 |
<td>56.2</td> |
| 6850 |
</tr> |
| 6851 |
|
| 6852 |
<tr> |
| 6853 |
<td>rxvt (3)</td> |
| 6854 |
<td>0.25</td> |
| 6855 |
<td>2.97</td> |
| 6856 |
<td>29.5</td> |
| 6857 |
<td>0.23</td> |
| 6858 |
<td>3.03</td> |
| 6859 |
<td>29.5</td> |
| 6860 |
</tr> |
| 6861 |
|
| 6862 |
<tr> |
| 6863 |
<td>st / stterm (4)</td> |
| 6864 |
<td>0.07</td> |
| 6865 |
<td>0.50</td> |
| 6866 |
<td>4.40</td> |
| 6867 |
<td>0.15</td> |
| 6868 |
<td>1.42</td> |
| 6869 |
<td>14.4</td> |
| 6870 |
</tr> |
| 6871 |
|
| 6872 |
<tr> |
| 6873 |
<td>terminology</td> |
| 6874 |
<td>0.10</td> |
| 6875 |
<td>1.00</td> |
| 6876 |
<td>10.1</td> |
| 6877 |
<td>0.19</td> |
| 6878 |
<td>2.01</td> |
| 6879 |
<td>19.0</td> |
| 6880 |
</tr> |
| 6881 |
|
| 6882 |
<tr> |
| 6883 |
<td>urxvt</td> |
| 6884 |
<td>0.05</td> |
| 6885 |
<td>0.38</td> |
| 6886 |
<td>3.24</td> |
| 6887 |
<td>0.17</td> |
| 6888 |
<td>1.60</td> |
| 6889 |
<td>15.7</td> |
| 6890 |
</tr> |
| 6891 |
|
| 6892 |
<tr> |
| 6893 |
<td>xterm</td> |
| 6894 |
<td>0.31</td> |
| 6895 |
<td>3.50</td> |
| 6896 |
<td>34.8</td> |
| 6897 |
<td>0.47</td> |
| 6898 |
<td>4.41</td> |
| 6899 |
<td>44.1</td> |
| 6900 |
</tr> |
| 6901 |
|
| 6902 |
<tr> |
| 6903 |
<td>xterm + fastScroll</td> |
| 6904 |
<td>0.09</td> |
| 6905 |
<td>0.82</td> |
| 6906 |
<td>8.36</td> |
| 6907 |
<td>0.39</td> |
| 6908 |
<td>2.43</td> |
| 6909 |
<td>22.9</td> |
| 6910 |
</tr> |
| 6911 |
|
| 6912 |
<tr> |
| 6913 |
<td rowspan="10" align="center">Local</td> |
| 6914 |
<td>gnome-terminal</td> |
| 6915 |
<td>0.12</td> |
| 6916 |
<td>1.16</td> |
| 6917 |
<td>11.4</td> |
| 6918 |
<td>0.29</td> |
| 6919 |
<td>3.14</td> |
| 6920 |
<td>30.6</td> |
| 6921 |
</tr> |
| 6922 |
|
| 6923 |
<tr> |
| 6924 |
<td>konsole</td> |
| 6925 |
<td>0.11</td> |
| 6926 |
<td>0.82</td> |
| 6927 |
<td>7.97</td> |
| 6928 |
<td>0.22</td> |
| 6929 |
<td>2.17</td> |
| 6930 |
<td>20.1</td> |
| 6931 |
</tr> |
| 6932 |
|
| 6933 |
<tr> |
| 6934 |
<td>mlterm</td> |
| 6935 |
<td>(2)</td> |
| 6936 |
<td>(2)</td> |
| 6937 |
<td>(2)</td> |
| 6938 |
<td>1.01</td> |
| 6939 |
<td>7.59</td> |
| 6940 |
<td>105.</td> |
| 6941 |
</tr> |
| 6942 |
|
| 6943 |
<tr> |
| 6944 |
<td>pterm / putty</td> |
| 6945 |
<td>0.17</td> |
| 6946 |
<td>1.52</td> |
| 6947 |
<td>14.6</td> |
| 6948 |
<td>(5)</td> |
| 6949 |
<td>(5)</td> |
| 6950 |
<td>(5)</td> |
| 6951 |
</tr> |
| 6952 |
|
| 6953 |
<tr> |
| 6954 |
<td>rxvt</td> |
| 6955 |
<td>1.23</td> |
| 6956 |
<td>11.9</td> |
| 6957 |
<td>118.</td> |
| 6958 |
<td>1.75</td> |
| 6959 |
<td>16.9</td> |
| 6960 |
<td>166.</td> |
| 6961 |
</tr> |
| 6962 |
|
| 6963 |
<tr> |
| 6964 |
<td>st / stterm (4)</td> |
| 6965 |
<td>0.08</td> |
| 6966 |
<td>0.61</td> |
| 6967 |
<td>5.10</td> |
| 6968 |
<td>0.21</td> |
| 6969 |
<td>1.63</td> |
| 6970 |
<td>15.9</td> |
| 6971 |
</tr> |
| 6972 |
|
| 6973 |
<tr> |
| 6974 |
<td>terminology</td> |
| 6975 |
<td>0.09</td> |
| 6976 |
<td>1.03</td> |
| 6977 |
<td>10.1</td> |
| 6978 |
<td>0.43</td> |
| 6979 |
<td>1.64</td> |
| 6980 |
<td>16.0</td> |
| 6981 |
</tr> |
| 6982 |
|
| 6983 |
<tr> |
| 6984 |
<td>urxvt</td> |
| 6985 |
<td>0.07</td> |
| 6986 |
<td>0.53</td> |
| 6987 |
<td>4.52</td> |
| 6988 |
<td>0.26</td> |
| 6989 |
<td>2.41</td> |
| 6990 |
<td>23.7</td> |
| 6991 |
</tr> |
| 6992 |
|
| 6993 |
<tr> |
| 6994 |
<td>xterm</td> |
| 6995 |
<td>1.77</td> |
| 6996 |
<td>18.5</td> |
| 6997 |
<td>178.</td> |
| 6998 |
<td>2.70</td> |
| 6999 |
<td>26.5</td> |
| 7000 |
<td>259.</td> |
| 7001 |
</tr> |
| 7002 |
|
| 7003 |
<tr> |
| 7004 |
<td>xterm + fastScroll</td> |
| 7005 |
<td>0.12</td> |
| 7006 |
<td>0.96</td> |
| 7007 |
<td>9.92</td> |
| 7008 |
<td>0.25</td> |
| 7009 |
<td>2.36</td> |
| 7010 |
<td>22.9</td> |
| 7011 |
</tr> |
| 7012 |
</table> |
| 7013 |
|
| 7014 |
<p><strong>Notes</strong>:</p> |
| 7015 |
|
| 7016 |
<ol> |
| 7017 |
<li> |
| 7018 |
<p>On both systems, <em>gnome-terminal</em> failed to connect |
| 7019 |
remotely.</p> |
| 7020 |
</li> |
| 7021 |
|
| 7022 |
<li> |
| 7023 |
<p>Fedora does not have <em>mlterm</em>.</p> |
| 7024 |
</li> |
| 7025 |
|
| 7026 |
<li> |
| 7027 |
<p>On Ubuntu, the <em>urxvt</em> package hijacks the name |
| 7028 |
“rxvt”, so the <em>“rxvt”</em> |
| 7029 |
actually tested was <em>rxvt-xpm</em> from the rxvt 2.7.10 |
| 7030 |
package.</p> |
| 7031 |
</li> |
| 7032 |
|
| 7033 |
<li> |
| 7034 |
<p>Fedora has <em>st</em> 0.70, while Ubuntu has version |
| 7035 |
0.60, which is a couple of years older.</p> |
| 7036 |
</li> |
| 7037 |
|
| 7038 |
<li> |
| 7039 |
<p>Running locally on Ubuntu, <em>pterm</em> 0.70-1 dumped |
| 7040 |
core.</p> |
| 7041 |
</li> |
| 7042 |
</ol> |
| 7043 |
|
| 7044 |
<p>Regarding the selection of terminal emulators:</p> |
| 7045 |
|
| 7046 |
<ul> |
| 7047 |
<li> |
| 7048 |
<p>Keeping mind that this is an <em>xterm</em> FAQ, the Linux |
| 7049 |
console (and Windows console, and PuTTY running on Windows) |
| 7050 |
are off-topic.</p> |
| 7051 |
</li> |
| 7052 |
|
| 7053 |
<li> |
| 7054 |
<p>The table mentions programs which at one time or another |
| 7055 |
have set <a href= |
| 7056 |
"/ncurses/ncurses.faq.html#xterm_generic"><code>TERM=xterm</code></a>.</p> |
| 7057 |
|
| 7058 |
<p>The actual test does not rely upon the terminal |
| 7059 |
description, nor in fact on any terminal description. The |
| 7060 |
distinction was made for their relevance to this FAQ.</p> |
| 7061 |
</li> |
| 7062 |
|
| 7063 |
<li> |
| 7064 |
<p>Given that, <em>rxvt</em> 2.7.10 is listed, as well as its |
| 7065 |
descendent <em>urxvt</em> (rxvt-unicode).</p> |
| 7066 |
|
| 7067 |
<p>Other variations of <em>rxvt</em> (such as <em>aterm</em> |
| 7068 |
and <em>mrxvt</em>) were considered, but since much of the |
| 7069 |
related code is identical, not very interesting.</p> |
| 7070 |
</li> |
| 7071 |
|
| 7072 |
<li> |
| 7073 |
<p>Both systems have several variants of the <em>skins</em> |
| 7074 |
for the VTE library, but for both systems, the developers |
| 7075 |
have a heavy bias in favor of the GNOME desktop. Comparing |
| 7076 |
the performance of the various skins would be pointless, |
| 7077 |
since not all are equally supported (due to the GNOME |
| 7078 |
developers' practice of making incompatible changes), and |
| 7079 |
would make an unbalanced comparison in any case.</p> |
| 7080 |
</li> |
| 7081 |
|
| 7082 |
<li> |
| 7083 |
<p>The Unix port of PuTTY, <em>pterm</em> is listed. It uses |
| 7084 |
<em>GDK</em>.</p> |
| 7085 |
</li> |
| 7086 |
</ul> |
| 7087 |
|
| 7088 |
<p>Interestingly, performance is better running remotely. In the |
| 7089 |
test, the machines are not identical:</p> |
| 7090 |
|
| 7091 |
<ul> |
| 7092 |
<li> |
| 7093 |
<p>The <em>remote</em> system uses a Mac mini-server.</p> |
| 7094 |
</li> |
| 7095 |
|
| 7096 |
<li> |
| 7097 |
<p>The Fedora system is a virtual machine using |
| 7098 |
Parallels.</p> |
| 7099 |
</li> |
| 7100 |
|
| 7101 |
<li> |
| 7102 |
<p>The Ubuntu system is a virtual machine using Vmware |
| 7103 |
Fusion.</p> |
| 7104 |
</li> |
| 7105 |
</ul> |
| 7106 |
|
| 7107 |
<p>Possibly displaying on the virtual machines does not perform |
| 7108 |
as well as via XQuartz. But that is a lot of difference to |
| 7109 |
explain. More likely, the local X server is performing badly on |
| 7110 |
some calls.</p> |
| 7111 |
|
| 7112 |
<ul> |
| 7113 |
<li> |
| 7114 |
<p>For a while, <em>XCopyArea</em> was a problem, where the |
| 7115 |
Xorg hackers had degraded its performance radically. While |
| 7116 |
that might still be the underlying issue, <em>st</em> and |
| 7117 |
<em>urxvt</em> do use that function.</p> |
| 7118 |
</li> |
| 7119 |
|
| 7120 |
<li> |
| 7121 |
<p>Another possibility is mentioned in <em><a href= |
| 7122 |
"#compiz_bugs">Why is the text in the wrong place?</a></em> |
| 7123 |
where the apparent root cause was a server feature which only |
| 7124 |
implemented parts of the X protocol.</p> |
| 7125 |
</li> |
| 7126 |
</ul> |
| 7127 |
|
| 7128 |
<p>Using the <em>fastScroll</em> feature made <em>xterm</em> |
| 7129 |
performance comparable to the “desktop” applications. |
| 7130 |
But as usual, with performance data, your mileage may vary.</p> |
| 7131 |
|
| 7132 |
<h4 id="window_ops-id"><a name="window_ops" id="window_ops">Why |
| 7133 |
can't my program read the window title?</a></h4> |
| 7134 |
|
| 7135 |
<p>The longstanding control sequence for reading the window title |
| 7136 |
is something that can be abused in special conditions. For novice |
| 7137 |
(unknowledgeable) users, this can be a problem.</p> |
| 7138 |
|
| 7139 |
<p><strong>XTerm</strong> provides resource-settings and menu |
| 7140 |
entries to allow this and related features to be enabled or |
| 7141 |
disabled. See for example <code>allowWindowOps</code> The default |
| 7142 |
resource settings in xterm can be overridden by a packager. |
| 7143 |
However, a knowledgeable user can override those default |
| 7144 |
settings.</p> |
| 7145 |
|
| 7146 |
<p>It is also possible that an overzealous packager may have |
| 7147 |
crippled xterm by removing the functionality altogether. (That |
| 7148 |
should be reported as a bug, to me).</p> |
| 7149 |
|
| 7150 |
<p>For instance, one of those sent me a "security fix" some years |
| 7151 |
ago, which deleted most of the control sequences which return |
| 7152 |
data to the host. It broke the <code>resize</code> program, and |
| 7153 |
selection, among other uses considered to be benign. In contrast, |
| 7154 |
the same features used in other terminal emulators are tolerated |
| 7155 |
by the same people, so rather than being a misguided attempt at |
| 7156 |
fixing security issues, patches such as that appear to be an |
| 7157 |
attempt at harassment.</p> |
| 7158 |
|
| 7159 |
<h4 id="window_ops2-id"><a name="window_ops2" id= |
| 7160 |
"window_ops2">Why can't my program set the window size?</a></h4> |
| 7161 |
|
| 7162 |
<p>Some overzealous packagers, perhaps influenced by the |
| 7163 |
demonstration I provided, are protecting you against the |
| 7164 |
possibility of your xterm becoming inaccessible. (That's |
| 7165 |
unlikely...).</p> |
| 7166 |
|
| 7167 |
<p>You should be able to override it, as noted above via resource |
| 7168 |
settings or menu entry ("Allow Window Ops").</p> |
| 7169 |
|
| 7170 |
<h4><a name="compiz_bugs" id="compiz_bugs">Why is the text in the |
| 7171 |
wrong place?</a></h4> |
| 7172 |
|
| 7173 |
<p>Are you using Ubuntu? This was a frequently-reported problem |
| 7174 |
for Ubuntu users. With other systems, it could occur (as of |
| 7175 |
September 2012), but is less frequent. But it was an issue with |
| 7176 |
Ubuntu since 2008.</p> |
| 7177 |
|
| 7178 |
<p>There were several related symptoms, e.g.,</p> |
| 7179 |
|
| 7180 |
<ul> |
| 7181 |
<li> |
| 7182 |
<p>text may be the wrong size</p> |
| 7183 |
</li> |
| 7184 |
|
| 7185 |
<li> |
| 7186 |
<p>repainting the screen puts text in the wrong place</p> |
| 7187 |
</li> |
| 7188 |
</ul> |
| 7189 |
|
| 7190 |
<p>Here are some of the corresponding bug reports:</p> |
| 7191 |
|
| 7192 |
<ul> |
| 7193 |
<li> |
| 7194 |
<p><a href= |
| 7195 |
"https://bugs.launchpad.net/ubuntu/+source/xterm/+bug/199285"> |
| 7196 |
Ubuntu #199285 - xterm crashes when compiz is on</a></p> |
| 7197 |
</li> |
| 7198 |
|
| 7199 |
<li> |
| 7200 |
<p><a href= |
| 7201 |
"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=467399">Debian |
| 7202 |
#467399 - compiz fails to take control of windows</a></p> |
| 7203 |
</li> |
| 7204 |
|
| 7205 |
<li> |
| 7206 |
<p><a href= |
| 7207 |
"https://bugs.launchpad.net/ubuntu/+source/xfce4-terminal/+bug/378668"> |
| 7208 |
Ubuntu #378668 - Cursor in terminal behaves badly with |
| 7209 |
special characters present</a></p> |
| 7210 |
</li> |
| 7211 |
|
| 7212 |
<li> |
| 7213 |
<p><a href= |
| 7214 |
"https://web.archive.org/web/20150903071615/https://bugzilla.novell.com/show_bug.cgi?id=622936"> |
| 7215 |
Novell #622936 - xterm: font drawing glitch</a></p> |
| 7216 |
</li> |
| 7217 |
|
| 7218 |
<li> |
| 7219 |
<p><a href= |
| 7220 |
"https://bugzilla.redhat.com/show_bug.cgi?id=583904">Redhat |
| 7221 |
#583904 - gnome-terminal and xterm show garbled fonts with |
| 7222 |
compiz enabled (intel graphics)</a></p> |
| 7223 |
</li> |
| 7224 |
|
| 7225 |
<li> |
| 7226 |
<p><a href= |
| 7227 |
"https://bugzilla.redhat.com/show_bug.cgi?id=614542">Redhat |
| 7228 |
#614542 - xterm graphical corruption when compiz is |
| 7229 |
active</a></p> |
| 7230 |
</li> |
| 7231 |
|
| 7232 |
<li> |
| 7233 |
<p><a href= |
| 7234 |
"https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/635258"> |
| 7235 |
Ubuntu #635258 - Garbled chars in xterm</a></p> |
| 7236 |
</li> |
| 7237 |
|
| 7238 |
<li> |
| 7239 |
<p><a href= |
| 7240 |
"https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/644943"> |
| 7241 |
Ubuntu #644943 - xterm fonts get corrupted while typing</a></p> |
| 7242 |
</li> |
| 7243 |
|
| 7244 |
<li> |
| 7245 |
<p><a href= |
| 7246 |
"https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/701160"> |
| 7247 |
Ubuntu #701160 - /usr/bin/xterm is not functional in |
| 7248 |
natty</a></p> |
| 7249 |
</li> |
| 7250 |
|
| 7251 |
<li> |
| 7252 |
<p><a href= |
| 7253 |
"https://bugs.launchpad.net/ubuntu/+source/xterm/+bug/700477"> |
| 7254 |
Ubuntu #700477 - Font corruption in xterm under Lucid</a></p> |
| 7255 |
</li> |
| 7256 |
|
| 7257 |
<li> |
| 7258 |
<p><a href= |
| 7259 |
"https://web.archive.org/web/20150903071612/https://bugzilla.novell.com/show_bug.cgi?id=681359"> |
| 7260 |
Novell #681359 - xterm: no data shown under the screen |
| 7261 |
program</a></p> |
| 7262 |
</li> |
| 7263 |
|
| 7264 |
<li> |
| 7265 |
<p><a href= |
| 7266 |
"https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/711894"> |
| 7267 |
Ubuntu #711894 - iconic option does not work with compiz</a></p> |
| 7268 |
</li> |
| 7269 |
|
| 7270 |
<li> |
| 7271 |
<p><a href= |
| 7272 |
"https://bugs.launchpad.net/ubuntu/+source/xterm/+bug/778439"> |
| 7273 |
Ubuntu #778439 - Typing “exit” in xterm kills X |
| 7274 |
session</a></p> |
| 7275 |
</li> |
| 7276 |
|
| 7277 |
<li> |
| 7278 |
<p><a href= |
| 7279 |
"https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/831336"> |
| 7280 |
Ubuntu #831336 - running 'xterm' crashes X server</a></p> |
| 7281 |
</li> |
| 7282 |
|
| 7283 |
<li> |
| 7284 |
<p><a href= |
| 7285 |
"https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/841103"> |
| 7286 |
Ubuntu #841103 - Text has artifacts when typing something |
| 7287 |
else</a></p> |
| 7288 |
</li> |
| 7289 |
|
| 7290 |
<li> |
| 7291 |
<p><a href= |
| 7292 |
"https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/844454"> |
| 7293 |
Ubuntu #844454 - Garbled chars in xterm (Onieric)</a></p> |
| 7294 |
</li> |
| 7295 |
|
| 7296 |
<li> |
| 7297 |
<p><a href= |
| 7298 |
"https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/1002972"> |
| 7299 |
Ubuntu #1002972 - xterm moves to upper left when clicking |
| 7300 |
titel bar</a></p> |
| 7301 |
</li> |
| 7302 |
|
| 7303 |
<li> |
| 7304 |
<p><a href= |
| 7305 |
"https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/1007722"> |
| 7306 |
Ubuntu #1007722 - xterm doesn't display all the |
| 7307 |
information</a></p> |
| 7308 |
</li> |
| 7309 |
</ul> |
| 7310 |
|
| 7311 |
<p>Since the problem was not in xterm, all I could do is to help |
| 7312 |
forward those bug-reports to whatever package owns |
| 7313 |
<code>compiz</code>. What these had in common is that someone |
| 7314 |
wrote code which was tested against only a small subset of the X |
| 7315 |
protocol.</p> |
| 7316 |
|
| 7317 |
<p>Looking for solutions (since compiz was not being fixed), it |
| 7318 |
was possible to disable compiz. The means for doing this varied |
| 7319 |
with time. Aside from pointing to the root cause of the problem, |
| 7320 |
there was little advice that was useful.</p> |
| 7321 |
|
| 7322 |
<ul> |
| 7323 |
<li> |
| 7324 |
<p>For instance, <a href= |
| 7325 |
"https://force.subcritical.org/xterm_under_compiz/">this |
| 7326 |
comment</a> by Eric Williams suggested that the problem could |
| 7327 |
be worked around by setting xterm's <code>borderWidth</code> |
| 7328 |
resource to zero.</p> |
| 7329 |
</li> |
| 7330 |
|
| 7331 |
<li> |
| 7332 |
<p>other comments suggested turning off the “desktop |
| 7333 |
effects” or “animation”.</p> |
| 7334 |
</li> |
| 7335 |
|
| 7336 |
<li> |
| 7337 |
<p>On my machines using the default <em>Ubuntu</em> desktop, |
| 7338 |
I could see misbehavior easily in Ubuntu 12.04 using <a href= |
| 7339 |
"/vttest/vttest.html">vttest</a>. However, Ubuntu 12.04 |
| 7340 |
provided <em>Ubuntu 2D</em>, which did not show those |
| 7341 |
problems (and was noticeably faster).</p> |
| 7342 |
</li> |
| 7343 |
</ul> |
| 7344 |
|
| 7345 |
<p>Ubuntu dropped <em>compiz</em> in 2017. Its replacement (GNOME |
| 7346 |
shell) has fewer bugs.</p> |
| 7347 |
|
| 7348 |
<h3 id="my_xdefaults-id"><a name="my_xdefaults" id= |
| 7349 |
"my_xdefaults">Sample .Xdefaults Color-Settings for XTerm</a></h3> |
| 7350 |
|
| 7351 |
<p>This example dates from March 1997:</p> |
| 7352 |
|
| 7353 |
<blockquote class="code-block"> |
| 7354 |
<!--{{atr2html--> |
| 7355 |
|
| 7356 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 7357 |
<span class="keyword">XTerm</span>*<span class= |
| 7358 |
"ident2">internalBorder</span>:<span class= |
| 7359 |
"literal"> </span><span class="number">10</span><br> |
| 7360 |
<span class="keyword">XTerm</span>*<span class= |
| 7361 |
"ident2">highlightSelection</span>:<span class= |
| 7362 |
"literal"> </span><span class= |
| 7363 |
"keyword">true</span><br> |
| 7364 |
<span class="keyword">XTerm</span>*<span class= |
| 7365 |
"keyword">VT100</span>.<span class= |
| 7366 |
"ident2">colorBDMode</span>:<span class= |
| 7367 |
"literal"> on</span><br> |
| 7368 |
<span class="keyword">XTerm</span>*<span class= |
| 7369 |
"keyword">VT100</span>.<span class= |
| 7370 |
"ident2">colorBD</span>:<span class= |
| 7371 |
"literal"> blue</span><br> |
| 7372 |
<span class="keyword">XTerm</span>*<span class= |
| 7373 |
"keyword">VT100</span>.<span class= |
| 7374 |
"ident2">colorULMode</span>:<span class= |
| 7375 |
"literal"> on</span><br> |
| 7376 |
<span class="keyword">XTerm</span>*<span class= |
| 7377 |
"keyword">VT100</span>.<span class= |
| 7378 |
"ident2">colorUL</span>:<span class= |
| 7379 |
"literal"> magenta</span><br> |
| 7380 |
<span class="keyword">XTerm</span>*<span class= |
| 7381 |
"keyword">VT100</span>.<span class= |
| 7382 |
"ident2">eightBitInput</span>:<span class= |
| 7383 |
"literal"> </span><span class= |
| 7384 |
"keyword">true</span><br> |
| 7385 |
<span class="keyword">XTerm</span>*<span class= |
| 7386 |
"keyword">VT100</span>.<span class= |
| 7387 |
"ident2">eightBitOutput</span>:<span class= |
| 7388 |
"literal"> </span><span class= |
| 7389 |
"keyword">true</span><br> |
| 7390 |
<span class="keyword">XTerm</span>*<span class= |
| 7391 |
"ident2">scrollBar</span>:<span class= |
| 7392 |
"literal"> </span><span class= |
| 7393 |
"keyword">true</span><br> |
| 7394 |
<span class="keyword">XTerm</span>*<span class= |
| 7395 |
"keyword">VT100</span>.<span class= |
| 7396 |
"ident2">titeInhibit</span>:<span class= |
| 7397 |
"literal"> </span><span class= |
| 7398 |
"keyword">true</span><br> |
| 7399 |
<br> |
| 7400 |
<span class="keyword">XTerm</span>*<span class= |
| 7401 |
"keyword">VT100</span>.<span class= |
| 7402 |
"ident2">colorMode</span>:<span class= |
| 7403 |
"literal"> on</span><br> |
| 7404 |
<span class="keyword">XTerm</span>*<span class= |
| 7405 |
"keyword">VT100</span>.<span class= |
| 7406 |
"ident2">dynamicColors</span>:<span class= |
| 7407 |
"literal"> on</span><br> |
| 7408 |
<br> |
| 7409 |
<span class= |
| 7410 |
"comment">! Uncomment this to use color for underline attribute<br> |
| 7411 |
</span> <span class="keyword">XTerm</span>*<span class= |
| 7412 |
"keyword">VT100</span>.<span class= |
| 7413 |
"ident2">colorULMode</span>:<span class= |
| 7414 |
"literal"> on</span><br> |
| 7415 |
<span class="keyword">XTerm</span>*<span class= |
| 7416 |
"keyword">VT100</span>.<span class= |
| 7417 |
"ident2">underLine</span>:<span class= |
| 7418 |
"literal"> off</span><br> |
| 7419 |
<br> |
| 7420 |
<span class= |
| 7421 |
"comment">! Uncomment this to use color for the bold attribute<br> |
| 7422 |
</span> <span class="keyword">XTerm</span>*<span class= |
| 7423 |
"keyword">VT100</span>.<span class= |
| 7424 |
"ident2">colorBDMode</span>:<span class= |
| 7425 |
"literal"> on</span><br> |
| 7426 |
<br> |
| 7427 |
<span class="keyword">XTerm</span>*<span class= |
| 7428 |
"keyword">VT100</span>.<span class= |
| 7429 |
"ident2">color0</span>:<span class= |
| 7430 |
"literal"> black</span><br> |
| 7431 |
<span class="keyword">XTerm</span>*<span class= |
| 7432 |
"keyword">VT100</span>.<span class= |
| 7433 |
"ident2">color1</span>:<span class= |
| 7434 |
"literal"> red3</span><br> |
| 7435 |
<span class="keyword">XTerm</span>*<span class= |
| 7436 |
"keyword">VT100</span>.<span class= |
| 7437 |
"ident2">color2</span>:<span class= |
| 7438 |
"literal"> green3</span><br> |
| 7439 |
<span class="keyword">XTerm</span>*<span class= |
| 7440 |
"keyword">VT100</span>.<span class= |
| 7441 |
"ident2">color3</span>:<span class= |
| 7442 |
"literal"> yellow3</span><br> |
| 7443 |
<span class="keyword">XTerm</span>*<span class= |
| 7444 |
"keyword">VT100</span>.<span class= |
| 7445 |
"ident2">color4</span>:<span class= |
| 7446 |
"literal"> blue3</span><br> |
| 7447 |
<span class="keyword">XTerm</span>*<span class= |
| 7448 |
"keyword">VT100</span>.<span class= |
| 7449 |
"ident2">color5</span>:<span class= |
| 7450 |
"literal"> magenta3</span><br> |
| 7451 |
<span class="keyword">XTerm</span>*<span class= |
| 7452 |
"keyword">VT100</span>.<span class= |
| 7453 |
"ident2">color6</span>:<span class= |
| 7454 |
"literal"> cyan3</span><br> |
| 7455 |
<span class="keyword">XTerm</span>*<span class= |
| 7456 |
"keyword">VT100</span>.<span class= |
| 7457 |
"ident2">color7</span>:<span class= |
| 7458 |
"literal"> gray90</span><br> |
| 7459 |
<span class="keyword">XTerm</span>*<span class= |
| 7460 |
"keyword">VT100</span>.<span class= |
| 7461 |
"ident2">color8</span>:<span class= |
| 7462 |
"literal"> gray30</span><br> |
| 7463 |
<span class="keyword">XTerm</span>*<span class= |
| 7464 |
"keyword">VT100</span>.<span class= |
| 7465 |
"ident2">color9</span>:<span class= |
| 7466 |
"literal"> red</span><br> |
| 7467 |
<span class="keyword">XTerm</span>*<span class= |
| 7468 |
"keyword">VT100</span>.<span class= |
| 7469 |
"ident2">color10</span>:<span class= |
| 7470 |
"literal"> green</span><br> |
| 7471 |
<span class="keyword">XTerm</span>*<span class= |
| 7472 |
"keyword">VT100</span>.<span class= |
| 7473 |
"ident2">color11</span>:<span class= |
| 7474 |
"literal"> yellow</span><br> |
| 7475 |
<span class="keyword">XTerm</span>*<span class= |
| 7476 |
"keyword">VT100</span>.<span class= |
| 7477 |
"ident2">color12</span>:<span class= |
| 7478 |
"literal"> blue</span><br> |
| 7479 |
<span class="keyword">XTerm</span>*<span class= |
| 7480 |
"keyword">VT100</span>.<span class= |
| 7481 |
"ident2">color13</span>:<span class= |
| 7482 |
"literal"> magenta</span><br> |
| 7483 |
<span class="keyword">XTerm</span>*<span class= |
| 7484 |
"keyword">VT100</span>.<span class= |
| 7485 |
"ident2">color14</span>:<span class= |
| 7486 |
"literal"> cyan</span><br> |
| 7487 |
<span class="keyword">XTerm</span>*<span class= |
| 7488 |
"keyword">VT100</span>.<span class= |
| 7489 |
"ident2">color15</span>:<span class= |
| 7490 |
"literal"> white</span><br> |
| 7491 |
<span class="keyword">XTerm</span>*<span class= |
| 7492 |
"keyword">VT100</span>.<span class= |
| 7493 |
"ident2">colorUL</span>:<span class= |
| 7494 |
"literal"> yellow</span><br> |
| 7495 |
<span class="keyword">XTerm</span>*<span class= |
| 7496 |
"keyword">VT100</span>.<span class= |
| 7497 |
"ident2">colorBD</span>:<span class= |
| 7498 |
"literal"> white</span><br> |
| 7499 |
<br> |
| 7500 |
<span class="keyword">XTerm</span>*<span class= |
| 7501 |
"keyword">VT100</span>.<span class= |
| 7502 |
"ident2">cursorColor</span>:<span class= |
| 7503 |
"literal"> lime green</span><br> |
| 7504 |
<!--atr2html}}--></p> |
| 7505 |
</blockquote> |
| 7506 |
|
| 7507 |
<p><strong>XTerm</strong> comes with two copies of each resource |
| 7508 |
file, one with color only (<code>XTerm-col.ad</code>, which is |
| 7509 |
installed as <code>XTerm-color</code>), and the regular one |
| 7510 |
(<code>XTerm.ad</code>, installed as <code>XTerm</code>). To use |
| 7511 |
the <code>XTerm-color</code> file in conjunction with a separate |
| 7512 |
<code>XTerm</code> app-defaults file which does not contain |
| 7513 |
color, add the following line to your <code>.Xdefaults</code> |
| 7514 |
file:</p> |
| 7515 |
|
| 7516 |
<blockquote class="code-block"> |
| 7517 |
<!--{{atr2html--> |
| 7518 |
|
| 7519 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 7520 |
*<span class="ident2">customization</span>:<span class= |
| 7521 |
"literal"> -color</span><br> |
| 7522 |
<!--atr2html}}--></p> |
| 7523 |
</blockquote> |
| 7524 |
|
| 7525 |
<p>Since 1997, the resource files grew in size and number. |
| 7526 |
Besides <code>XTerm</code> and <code>XTerm-color</code>, there |
| 7527 |
are also resource files for <strong>xterm</strong> using |
| 7528 |
different <em>class</em> values, together with the |
| 7529 |
<code>-color</code> flavors of these. Because the |
| 7530 |
<code>-color</code> flavors differ only by an |
| 7531 |
<code>#include</code> statement, the makefile generates these |
| 7532 |
from <a href= |
| 7533 |
"https://github.com/ThomasDickey/xterm-snapshots/blob/master/XTerm-col.ad"> |
| 7534 |
XTerm-col.ad</a>. Here are the others:</p> |
| 7535 |
|
| 7536 |
<blockquote> |
| 7537 |
<table border="1" summary="resource files for XTerm"> |
| 7538 |
<tr> |
| 7539 |
<th>Program</th> |
| 7540 |
<th>Resource</th> |
| 7541 |
</tr> |
| 7542 |
|
| 7543 |
<tr> |
| 7544 |
<td><a href="#xterm_man">xterm</a> |
| 7545 |
</td> |
| 7546 |
<td><a href= |
| 7547 |
"https://github.com/ThomasDickey/xterm-snapshots/blob/master/XTerm.ad"> |
| 7548 |
XTerm</a> |
| 7549 |
</td> |
| 7550 |
</tr> |
| 7551 |
|
| 7552 |
<tr> |
| 7553 |
<td><a href="#uxterm_man">uxterm</a> |
| 7554 |
</td> |
| 7555 |
<td><a href= |
| 7556 |
"https://github.com/ThomasDickey/xterm-snapshots/blob/master/UXTerm.ad"> |
| 7557 |
UXTerm</a> |
| 7558 |
</td> |
| 7559 |
</tr> |
| 7560 |
|
| 7561 |
<tr> |
| 7562 |
<td><a href="#koi8rxterm_man">koi8rxterm</a> |
| 7563 |
</td> |
| 7564 |
<td><a href= |
| 7565 |
"https://github.com/ThomasDickey/xterm-snapshots/blob/master/KOI8RXTerm.ad"> |
| 7566 |
KOI8RXTerm</a> |
| 7567 |
</td> |
| 7568 |
</tr> |
| 7569 |
</table> |
| 7570 |
</blockquote> |
| 7571 |
|
| 7572 |
<p>Besides just adding files, I continued testing more resource |
| 7573 |
combinations. Originally (in the 1990s for instance), developers |
| 7574 |
could reasonably expect their users to configure resources for |
| 7575 |
themselves, rather than use a single prepackaged flavor. That was |
| 7576 |
a while ago. After 2000, I developed nicer resource files. Rather |
| 7577 |
than modify the installed <code>app-defaults</code> file, I use |
| 7578 |
this feature from X:</p> |
| 7579 |
|
| 7580 |
<blockquote> |
| 7581 |
<p class="code-block">Directories named by the environment |
| 7582 |
variable <code>XUSERFILESEARCHPATH</code> or the environment |
| 7583 |
variable <strong><code>XAPPLRESDIR</code></strong> (which names |
| 7584 |
a single directory and should end with a ‘/’ on |
| 7585 |
POSIX systems), plus directories in a standard place (usually |
| 7586 |
under <em><code>/usr/share/X11/</code></em>, but this can be |
| 7587 |
overridden with the <em><code>XFILESEARCHPATH</code></em> |
| 7588 |
environment variable) are searched for for application-specific |
| 7589 |
resources. For example, application default resources are |
| 7590 |
usually kept in |
| 7591 |
<em><code>/usr/share/X11/app-defaults/</code></em>. See the |
| 7592 |
<em>X Toolkit Intrinsics – C Language Interface</em> |
| 7593 |
manual for details.</p> |
| 7594 |
</blockquote> |
| 7595 |
|
| 7596 |
<p>That is, if you set the <code>XAPPLRESDIR</code> environment |
| 7597 |
variable to point to a directory, you can put application |
| 7598 |
resource files there, and X will find those before the system |
| 7599 |
app-defaults files. That allows more flexibility and better |
| 7600 |
control over the various applications than putting everything |
| 7601 |
into a single <code>.Xdefaults</code> file.</p> |
| 7602 |
|
| 7603 |
<p>On the opposite extreme, some people advise using |
| 7604 |
<code>xrdb</code>. Not everyone. Back around 1990 I had an |
| 7605 |
informative conversation with one of the developers at the |
| 7606 |
Software Productivity Consortium. He was a member of a team |
| 7607 |
developing a set of X widgets. The gist of our conversation was |
| 7608 |
that</p> |
| 7609 |
|
| 7610 |
<ul> |
| 7611 |
<li> |
| 7612 |
<p>using <code>xrdb</code> prevented you from changing things |
| 7613 |
dynamically.</p> |
| 7614 |
</li> |
| 7615 |
|
| 7616 |
<li> |
| 7617 |
<p>it was like using a hammer (nailing things down to prevent |
| 7618 |
them from being different).</p> |
| 7619 |
</li> |
| 7620 |
|
| 7621 |
<li> |
| 7622 |
<p>when the only tool you know how to use is a hammer, |
| 7623 |
<a href= |
| 7624 |
"https://www.google.com/search?q=hammer+nail+problem&tbm=isch&tbo=u&source=univ&sa=X&ved=0ahUKEwigkLaixZLPAhWGWCYKHVD5B0sQsAQIUQ"> |
| 7625 |
all of the problems look like nails</a>.</p> |
| 7626 |
</li> |
| 7627 |
|
| 7628 |
<li> |
| 7629 |
<p>a good developer knows how to use more than one tool.</p> |
| 7630 |
</li> |
| 7631 |
</ul> |
| 7632 |
|
| 7633 |
<h3 id="warning_msg-id"><a name="warning_msg" id= |
| 7634 |
"warning_msg">What is this warning message?</a></h3> |
| 7635 |
|
| 7636 |
<dl> |
| 7637 |
<dt id="warning_errno">xterm: Error 11, errno 22: permission |
| 7638 |
denied</dt> |
| 7639 |
|
| 7640 |
<dd> |
| 7641 |
Actually, any message like this denotes a failure which |
| 7642 |
requires studying the xterm source to determine the exact |
| 7643 |
problem. |
| 7644 |
<p>You have either found a bug in xterm, or there is |
| 7645 |
something wrong with your computer's configuration, e.g., not |
| 7646 |
enough pty's, incorrect permissions, etc.</p> |
| 7647 |
|
| 7648 |
<p>The first number is an internal code (defined in error.h |
| 7649 |
in xterm's source), and the second is the system error number |
| 7650 |
(defined in /usr/include/sys/errno.h). The system error |
| 7651 |
number is easier to lookup, but the internal error code tells |
| 7652 |
you where to look in the source.</p> |
| 7653 |
</dd> |
| 7654 |
|
| 7655 |
<dt id="warning_preedit">input method doesn't support my |
| 7656 |
preedit type</dt> |
| 7657 |
|
| 7658 |
<dd> |
| 7659 |
Ignore this if you do not know what <em>input method</em> is. |
| 7660 |
Input methods are used to enter composite characters (e.g., |
| 7661 |
umlauts, other types of punctuated characters, East Asian |
| 7662 |
characters, etc). Your computer's libraries support this, but |
| 7663 |
are missing configuration tables, and xterm is warning you. |
| 7664 |
<p>If the message bothers you (e.g., if you aren't starting |
| 7665 |
xterm from a window manager menu), you can suppress it by |
| 7666 |
setting a resource:</p> |
| 7667 |
|
| 7668 |
<blockquote class="code-block"> |
| 7669 |
<!--{{atr2html--> |
| 7670 |
|
| 7671 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 7672 |
<span class="keyword">XTerm</span>*<span class= |
| 7673 |
"ident2">openIm</span>:<span class= |
| 7674 |
"keyword">false</span><br> |
| 7675 |
<!--atr2html}}--></p> |
| 7676 |
</blockquote> |
| 7677 |
</dd> |
| 7678 |
|
| 7679 |
<dt id="warning_action">Warning: Actions not found: ignore, |
| 7680 |
"<em>xxx</em>"</dt> |
| 7681 |
|
| 7682 |
<dd> |
| 7683 |
The action "<em>xxx</em>" (for example "scroll-back") is |
| 7684 |
specified in a resource file whose translations match widgets |
| 7685 |
that do not support them. For example, this |
| 7686 |
<blockquote class="code-block"> |
| 7687 |
<!--{{atr2html--> |
| 7688 |
|
| 7689 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 7690 |
<span class="keyword">XTerm</span>*<span class= |
| 7691 |
"ident2">translations</span>:<span class= |
| 7692 |
"literal"> #override\n\<br> |
| 7693 |
</span><span class="keyword"><Leave></span><span class="literal">, ~Ctrl ~Meta </span><span class="keyword"><Btn2Up></span><span class="literal">: ignore()\n\<br> |
| 7694 |
|
| 7695 |
~Shift </span><span class="keyword"><Key></span><span class="literal">KP_8: scroll-back(</span><span class="number">1</span><span class="literal">,line)\n\<br> |
| 7696 |
|
| 7697 |
~Shift </span><span class="keyword"><Key></span><span class="literal">KP_2: scroll-forw(</span><span class="number">1</span><span class="literal">,line)\n\<br> |
| 7698 |
|
| 7699 |
Shift </span><span class="keyword"><Key></span><span class="literal">KP_8: scroll-back(</span><span class="number">1</span><span class="literal">,halfpage)\n\<br> |
| 7700 |
|
| 7701 |
Shift </span><span class="keyword"><Key></span><span class="literal">KP_2: scroll-forw(</span><span class="number">1</span><span class="literal">,halfpage)</span><br> |
| 7702 |
|
| 7703 |
<!--atr2html}}--></p> |
| 7704 |
</blockquote> |
| 7705 |
|
| 7706 |
<p>will produce warnings such as</p> |
| 7707 |
|
| 7708 |
<blockquote> |
| 7709 |
<pre class="code-block"> |
| 7710 |
Warning: Actions not found: ignore, scroll-back, scroll-forw |
| 7711 |
Warning: Actions not found: ignore, scroll-back, scroll-forw |
| 7712 |
Warning: Actions not found: ignore, scroll-back, scroll-forw |
| 7713 |
</pre> |
| 7714 |
</blockquote> |
| 7715 |
|
| 7716 |
<p>This is a correct form, assigning the actions to the |
| 7717 |
“VT100” widget.</p> |
| 7718 |
|
| 7719 |
<blockquote class="code-block"> |
| 7720 |
<!--{{atr2html--> |
| 7721 |
|
| 7722 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 7723 |
<span class="keyword">XTerm</span>*<span class= |
| 7724 |
"keyword">VT100</span>.<span class= |
| 7725 |
"ident2">translations</span>:<span class= |
| 7726 |
"literal"> #override\n\<br> |
| 7727 |
</span><span class="keyword"><Leave></span><span class="literal">, ~Ctrl ~Meta </span><span class="keyword"><Btn2Up></span><span class="literal">: ignore()\n\<br> |
| 7728 |
|
| 7729 |
~Shift </span><span class="keyword"><Key></span><span class="literal">KP_8: scroll-back(</span><span class="number">1</span><span class="literal">,line)\n\<br> |
| 7730 |
|
| 7731 |
~Shift </span><span class="keyword"><Key></span><span class="literal">KP_2: scroll-forw(</span><span class="number">1</span><span class="literal">,line)\n\<br> |
| 7732 |
|
| 7733 |
Shift </span><span class="keyword"><Key></span><span class="literal">KP_8: scroll-back(</span><span class="number">1</span><span class="literal">,halfpage)\n\<br> |
| 7734 |
|
| 7735 |
Shift </span><span class="keyword"><Key></span><span class="literal">KP_2: scroll-forw(</span><span class="number">1</span><span class="literal">,halfpage)</span><br> |
| 7736 |
|
| 7737 |
<!--atr2html}}--></p> |
| 7738 |
</blockquote> |
| 7739 |
</dd> |
| 7740 |
|
| 7741 |
<dt id="alloc_color-id"><a name="alloc_color" id= |
| 7742 |
"alloc_color">Warning: Cannot allocate colormap entry for |
| 7743 |
"<em>xxx</em>"</a> |
| 7744 |
</dt> |
| 7745 |
|
| 7746 |
<dd> |
| 7747 |
This comes from the X library. Modern xterm uses the default |
| 7748 |
color map. What this means is that if your X server has |
| 7749 |
insufficient space to store color information for more than |
| 7750 |
one color map, other applications which could use other color |
| 7751 |
maps may conflict with xterm. In practice, that is 256 unique |
| 7752 |
colors on the screen at a time—not enough for a fancy |
| 7753 |
background or an application such as Netscape. |
| 7754 |
<p>During resource initialization, xterm attempts to allocate |
| 7755 |
an entry from the color map for each color which it might |
| 7756 |
use. If there are not enough free slots in the color map, you |
| 7757 |
will see a "Cannot allocate" message for each color that |
| 7758 |
xterm failed to allocate. Those colors will be rendered in |
| 7759 |
the foreground color, making full-screen color applications |
| 7760 |
such as <a href="/dialog/dialog.html">dialog</a> |
| 7761 |
unreadable.</p> |
| 7762 |
|
| 7763 |
<p>This problem is alleviated with <a href= |
| 7764 |
"xterm.log.html#xterm_129">patch 129</a>, which modified |
| 7765 |
xterm to delay the most color allocation until the colors are |
| 7766 |
first needed. If a color is never needed (xterm allocates 20 |
| 7767 |
colors in this manner), that reduces the number of slots in |
| 7768 |
the color map that are needed. Even with this improvement, |
| 7769 |
xterm must still allocate 4 colors during initialization to |
| 7770 |
determine how to display the cursor. If none of those colors |
| 7771 |
can be allocated, xterm reverts to monochrome.</p> |
| 7772 |
</dd> |
| 7773 |
</dl> |
| 7774 |
|
| 7775 |
<h2 id="known_bugs-id"><a name="known_bugs" id="known_bugs">Known |
| 7776 |
Bugs in <strong>XTerm</strong> and Look–alikes</a></h2> |
| 7777 |
|
| 7778 |
<p>These are the known bugs (or limitations) in modern xterm. |
| 7779 |
They are also present in the other versions based on the X |
| 7780 |
Consortium sources (color_xterm, ansi_xterm, kterm).</p> |
| 7781 |
|
| 7782 |
<p>Note that of the emulators that support color, some do not |
| 7783 |
support <code>bce</code> (back color erase). The bce capability |
| 7784 |
is also called the "new color model", though it has been |
| 7785 |
implemented in the IBM PC for quite a while. Technically, not |
| 7786 |
implementing <code>bce</code> (or allowing the choice between it |
| 7787 |
and its complement) is not a bug, since few hardware terminals |
| 7788 |
(with good reason) implemented this feature.</p> |
| 7789 |
|
| 7790 |
<ul> |
| 7791 |
<li> |
| 7792 |
<p>cut/paste does not <a href= |
| 7793 |
"xterm.faq.html#xterm_tabs">select tabs</a>; instead spaces |
| 7794 |
are selected. This is because the selection works from the |
| 7795 |
array of displayed characters, on which tab/space conversion |
| 7796 |
has already been performed.</p> |
| 7797 |
</li> |
| 7798 |
|
| 7799 |
<li> |
| 7800 |
<p>does not implement the autorepeat feature of VTxxx |
| 7801 |
terminals.</p> |
| 7802 |
</li> |
| 7803 |
</ul> |
| 7804 |
|
| 7805 |
<h3 id="bug_xterm_r6-id"><a name="bug_xterm_r6" id= |
| 7806 |
"bug_xterm_r6">X11R6.3 <strong>XTerm</strong></a></h3> |
| 7807 |
|
| 7808 |
<p>The X Consortium version of xterm (and versions based on it) |
| 7809 |
has additional bugs not in modern xterm:</p> |
| 7810 |
|
| 7811 |
<ul> |
| 7812 |
<li> |
| 7813 |
<p>the program must be run with fixed (nonproportional) |
| 7814 |
fonts.</p> |
| 7815 |
</li> |
| 7816 |
|
| 7817 |
<li> |
| 7818 |
<p>the home and end keys do not generate usable escape |
| 7819 |
sequences, due to an indexing error. (Note that it is |
| 7820 |
possible to work around this using the VT100 translations |
| 7821 |
resource, but usually this is not done).</p> |
| 7822 |
</li> |
| 7823 |
|
| 7824 |
<li> |
| 7825 |
<p>the Main Options menu is improperly constructed, due to |
| 7826 |
incorrect indices after removing the logging toggle. This |
| 7827 |
makes the list of signals off by one.</p> |
| 7828 |
</li> |
| 7829 |
|
| 7830 |
<li> |
| 7831 |
<p>very large screens (e.g., by using nil2 for a font) cause |
| 7832 |
core dumps because the program uses a fixed array (200 lines) |
| 7833 |
for adjusting pointers.</p> |
| 7834 |
</li> |
| 7835 |
|
| 7836 |
<li> |
| 7837 |
<p>certain types of key translations cause a core dump |
| 7838 |
because the program does not check the event class before |
| 7839 |
attempting to use events.</p> |
| 7840 |
</li> |
| 7841 |
</ul> |
| 7842 |
|
| 7843 |
<p>(These bugs are also present in the X11R5 version).</p> |
| 7844 |
|
| 7845 |
<p id="xterm-xorg-id"><a name="xterm-xorg" id= |
| 7846 |
"xterm-xorg"><em>Update 2004/04/08:</em></a><br> |
| 7847 |
Complicating this discussion was the "X.Org" xterm (from 2004). |
| 7848 |
That was the XFree86 xterm from XFree86 CVS with all visible |
| 7849 |
“xfree86” strings changed to "X.Org" or |
| 7850 |
“xorg”, depending on the use. For example the |
| 7851 |
"xterm-xfree86" terminfo entry became “xterm-xorg”. |
| 7852 |
The change history for the related CVS for X.Org showed this. |
| 7853 |
Similarly, the release notes for X11R6.7 included my notes for |
| 7854 |
XFree86 4.4.</p> |
| 7855 |
|
| 7856 |
<p><em>As of 2009</em>, it was apparent that “X.Org” |
| 7857 |
xterm had died a natural death, since none of the people who |
| 7858 |
created it had any likelihood of maintaining it. Instead, X.Org |
| 7859 |
deferred to my version of xterm.</p> |
| 7860 |
|
| 7861 |
<p><em>Reviewing in 2014</em>, the major vendors had been using |
| 7862 |
modern xterm (different patch levels) for some time. However, |
| 7863 |
there were documentation problems with AIX, beyond what is noted |
| 7864 |
<a href="#xterm_pageup">here</a>:</p> |
| 7865 |
|
| 7866 |
<ul> |
| 7867 |
<li> |
| 7868 |
<p>AIX provided a copy of <a href="/luit/luit.html">luit</a>, |
| 7869 |
and a corresponding <a href= |
| 7870 |
"https://www.ibm.com/docs/en/aix/7.3.0?topic=l-luit-command">manpage</a>—which |
| 7871 |
omitted the sections on security, bugs and attribution.</p> |
| 7872 |
</li> |
| 7873 |
|
| 7874 |
<li> |
| 7875 |
<p>The <a href= |
| 7876 |
"https://www.ibm.com/docs/en/aix/7.2.0?topic=x-xterm-command"> |
| 7877 |
xterm</a> manpage provided with AIX said this was X11R6 xterm |
| 7878 |
“with no functional enhancements.” Comparing |
| 7879 |
releases X11R5, X11R6.1, X11R6.3 against the AIX page, it |
| 7880 |
matched X11R6.1 (December 1995). That is, it included the |
| 7881 |
text of the X11R6.1 xterm manpage plus the control sequences |
| 7882 |
document—again omitting the security, bugs and |
| 7883 |
attribution sections from each.</p> |
| 7884 |
</li> |
| 7885 |
</ul> |
| 7886 |
|
| 7887 |
<p>The other vendors provide documentation which is more |
| 7888 |
up-to-date.</p> |
| 7889 |
|
| 7890 |
<h3 id="bug_color_xterm-id"><a name="bug_color_xterm" id= |
| 7891 |
"bug_color_xterm">COLOR_XTERM</a> <a href= |
| 7892 |
"https://www.ibiblio.org/pub/X11/contrib/applications/color_xterm-beta1.tar.gz"> |
| 7893 |
download</a></h3> |
| 7894 |
|
| 7895 |
<p>This is based on the X Consortium X11R5 source, with the same |
| 7896 |
bugs.</p> |
| 7897 |
|
| 7898 |
<ul> |
| 7899 |
<li> |
| 7900 |
<p>implements non-bce color model</p> |
| 7901 |
</li> |
| 7902 |
|
| 7903 |
<li> |
| 7904 |
<p>moving the cursor is reported to leave trails of incorrect |
| 7905 |
color</p> |
| 7906 |
</li> |
| 7907 |
|
| 7908 |
<li> |
| 7909 |
<p>clearing the screen resets colors (arguably this is a |
| 7910 |
limitation).</p> |
| 7911 |
</li> |
| 7912 |
</ul> |
| 7913 |
|
| 7914 |
<p>Not exactly a bug, but it does not build on Linux with |
| 7915 |
X11R6.3</p> |
| 7916 |
|
| 7917 |
<h3 id="bug_ansi_xterm-id"><a name="bug_ansi_xterm" id= |
| 7918 |
"bug_ansi_xterm">ANSI_XTERM</a> <a href= |
| 7919 |
"https://www.ibiblio.org/pub/X11/contrib/applications/xterm-R6-sb_right-ansi-3d.tar.gz"> |
| 7920 |
download</a></h3> |
| 7921 |
|
| 7922 |
<p>This is based on the X Consortium source, with the same |
| 7923 |
bugs.</p> |
| 7924 |
|
| 7925 |
<ul> |
| 7926 |
<li> |
| 7927 |
<p>implements non-bce color model</p> |
| 7928 |
</li> |
| 7929 |
|
| 7930 |
<li> |
| 7931 |
<p>fails <a href="/vttest/vttest.html">vttest</a> by not |
| 7932 |
rendering reverse-video screen</p> |
| 7933 |
</li> |
| 7934 |
</ul> |
| 7935 |
|
| 7936 |
<h3 id="bug_cxterm-id"><a name="bug_cxterm" id= |
| 7937 |
"bug_cxterm">CXTERM</a> <a href= |
| 7938 |
"https://cxterm.sourceforge.net/">link</a></h3> |
| 7939 |
|
| 7940 |
<p>CXterm stands for "Chinese Xterm". This is based on the X |
| 7941 |
Consortium source.</p> |
| 7942 |
|
| 7943 |
<h3 id="bug_dtterm-id"><a name="bug_dtterm" id= |
| 7944 |
"bug_dtterm">DTTERM</a></h3> |
| 7945 |
|
| 7946 |
<p>This is distributed with CDE. It implements more of the DEC |
| 7947 |
VT220 than the X Consortium xterm, and also adds controls to |
| 7948 |
manipulate the window and icon.</p> |
| 7949 |
|
| 7950 |
<ul> |
| 7951 |
<li> |
| 7952 |
<p>implements non-bce color model</p> |
| 7953 |
</li> |
| 7954 |
|
| 7955 |
<li> |
| 7956 |
<p>fails <a href="/vttest/vttest.html">vttest</a> by clearing |
| 7957 |
its background to solid white rather than preserving its |
| 7958 |
sense in response to ED.</p> |
| 7959 |
</li> |
| 7960 |
|
| 7961 |
<li> |
| 7962 |
<p>under some circumstances, scrolling margins are not |
| 7963 |
recognized. For instance, running <a href= |
| 7964 |
"/vile/vile.html">vile</a> which uses scrolling margins, we |
| 7965 |
see text overwriting the status line.</p> |
| 7966 |
</li> |
| 7967 |
</ul> |
| 7968 |
|
| 7969 |
<h3 id="bug_emu-id"><a name="bug_emu" id="bug_emu">EMU 1.3</a> |
| 7970 |
<a href= |
| 7971 |
"https://www.ibiblio.org/pub/X11/contrib/applications/emu-1.31.tar.gz"> |
| 7972 |
download</a></h3> |
| 7973 |
|
| 7974 |
<p>This is not based on the X Consortium source. The authors |
| 7975 |
state that it implements VT220 emulation. It is in need of |
| 7976 |
maintenance, since it builds with some problems to produce an |
| 7977 |
executable that (on Linux and SunOS) does not handle the carriage |
| 7978 |
return and newline translations properly. So I am unable to run |
| 7979 |
<a href="/vttest/vttest.html">vttest</a> on this emulator.</p> |
| 7980 |
|
| 7981 |
<h3 id="bug_eterm-id"><a name="bug_eterm" id= |
| 7982 |
"bug_eterm">ETERM</a> <a href= |
| 7983 |
"https://web.archive.org/web/20140804010958/https://www.eterm.org/"> |
| 7984 |
link</a></h3> |
| 7985 |
|
| 7986 |
<p>Eterm was based on rxvt, though the appearance differs. The |
| 7987 |
terminal emulation capabilities appear similar, though I am not |
| 7988 |
able to run the full suite of tests in <a href= |
| 7989 |
"/vttest/vttest.html">vttest</a> with this emulator (the core |
| 7990 |
dump noted for rxvt, as well as hanging while awaiting response |
| 7991 |
from one or more control sequences). Oddly, it appears that |
| 7992 |
neither Eterm nor rxvt implement CPR (cursor position report). |
| 7993 |
Finally, it reserves F1 (function-key) for a popup menu. This |
| 7994 |
applies to versions of <em>Eterm</em> through 0.9.</p> |
| 7995 |
|
| 7996 |
<h3 id="bug_gnometerm-id"><a name="bug_gnometerm" id= |
| 7997 |
"bug_gnometerm">GNOME TERMINAL</a> <a href= |
| 7998 |
"https://www.gnome.org/">link</a></h3> |
| 7999 |
|
| 8000 |
<p>Unless specifically mentioned, GNOME Terminal and VTE's issues |
| 8001 |
generally accumulate, with occasional veering off with skin-deep |
| 8002 |
“rewrites”. Each sighting provides a new episode.</p> |
| 8003 |
|
| 8004 |
<p>Starting in 1999 —</p> |
| 8005 |
|
| 8006 |
<p>GNOME Terminal is developed separately from both xterm and |
| 8007 |
rxvt, and was originally based on the <a href= |
| 8008 |
"https://web.archive.org/web/20180916121741/https://www.fifi.org/doc/gnome-dev-doc/html/zvt/book1.html"> |
| 8009 |
zvt (zterm) widget</a>. Like <a href="#bug_kvt">kvt</a>), it |
| 8010 |
appears to have been developed imitating other terminal emulators |
| 8011 |
(Linux console and xterm) rather than strictly emulating a VT102. |
| 8012 |
The documentation is fragmentary (with a comment suggesting that |
| 8013 |
the author does not know where to find relevant information), and |
| 8014 |
the program fares badly with <a href= |
| 8015 |
"/vttest/vttest.html">vttest</a>. Beginning with late 1999, |
| 8016 |
reports indicate that it does not properly parse ANSI control |
| 8017 |
sequences: the vim editor is using xterm's vt220-style "Send |
| 8018 |
Device Attributes" (Secondary DA) control sequence to obtain the |
| 8019 |
terminal emulator's version. That is, it sends</p> |
| 8020 |
|
| 8021 |
<blockquote> |
| 8022 |
<pre class="code-block"> |
| 8023 |
\E[>c |
| 8024 |
</pre> |
| 8025 |
</blockquote> |
| 8026 |
|
| 8027 |
<p>expecting a response such as</p> |
| 8028 |
|
| 8029 |
<blockquote> |
| 8030 |
<pre class="code-block"> |
| 8031 |
\E[>0;138;0c |
| 8032 |
</pre> |
| 8033 |
</blockquote> |
| 8034 |
|
| 8035 |
<p>for vt100. The bug report indicates that the “c” |
| 8036 |
sent by vim is echoed rather than interpreted by the |
| 8037 |
emulator.</p> |
| 8038 |
|
| 8039 |
<p>But it suffices for vi.</p> |
| 8040 |
|
| 8041 |
<p>Moving on to 2001 —</p> |
| 8042 |
|
| 8043 |
<p>A more recent GNOME Terminal uses the VTE widget. I observed |
| 8044 |
version 1.4.0.4 in late 2001, which mentioned it in the credits |
| 8045 |
(although VTE 0.1's ChangeLog mentions no date before February |
| 8046 |
2002). It does not implement a complete vt102: it was missing |
| 8047 |
several features which can be demonstrated in <a href= |
| 8048 |
"/vttest/vttest.html">vttest</a>). Most of the bugs in the Device |
| 8049 |
Attributes responses remain, but it works a little better with |
| 8050 |
vim. However, there are problems with the alternate screen that |
| 8051 |
show up with vim. Again, these can be demonstrated with vttest |
| 8052 |
(menu 11.6.3 in the 20011130 snapshot).</p> |
| 8053 |
|
| 8054 |
<p>Moving on to 2002 —</p> |
| 8055 |
|
| 8056 |
<p>Rather than evolving from zvt, VTE is largely a new work. It |
| 8057 |
does credit zvt in one place. However, its source code uses |
| 8058 |
xterm's source code as a resource, accounting for odd (often |
| 8059 |
incomplete) chunks. Reviewing 0.9.0 (September 2002):</p> |
| 8060 |
|
| 8061 |
<ul> |
| 8062 |
<li> |
| 8063 |
<p>the termcap file. The last comment in the file is copied |
| 8064 |
from xterm's source. The content of course is generated from |
| 8065 |
ncurses with a small number of changes.</p> |
| 8066 |
</li> |
| 8067 |
|
| 8068 |
<li> |
| 8069 |
<p>the parser <code>src/vte.c</code> —a 14,125 line |
| 8070 |
file. For example, the chunks related to DEC VT220 keyboard |
| 8071 |
queries and DEC private modes contain comments copied from |
| 8072 |
xterm's source code.</p> |
| 8073 |
</li> |
| 8074 |
</ul> |
| 8075 |
|
| 8076 |
<p>Jumping to 2010 —</p> |
| 8077 |
|
| 8078 |
<p>Later versions of VTE incorporate more features (and comments, |
| 8079 |
symbol names, etc), from xterm's source. In some instances, the |
| 8080 |
copied features were disabled by Red Hat's package for xterm. |
| 8081 |
<a href= |
| 8082 |
"https://bugzilla.redhat.com/show_bug.cgi?id=122815">Here</a> is |
| 8083 |
a related bug report, for key bindings.</p> |
| 8084 |
|
| 8085 |
<p id="vte:xconsortium">The documentation for GNOME Terminal |
| 8086 |
asserts:</p> |
| 8087 |
|
| 8088 |
<blockquote class="code-block"> |
| 8089 |
<p>GNOME Terminal emulates the xterm application developed by |
| 8090 |
the X Consortium. In turn, the xterm application emulates the |
| 8091 |
DEC VT102 terminal and also supports the DEC VT220 escape |
| 8092 |
sequences. An escape sequence is a series of characters that |
| 8093 |
starts with the Esc character. GNOME Terminal accepts all of |
| 8094 |
the escape sequences that the VT102 and VT220 terminals use for |
| 8095 |
functions such as to position the cursor and to clear the |
| 8096 |
screen.</p> |
| 8097 |
</blockquote> |
| 8098 |
|
| 8099 |
<p>That sounds fine, except that it is both inaccurate and |
| 8100 |
misleading:</p> |
| 8101 |
|
| 8102 |
<blockquote> |
| 8103 |
<dl> |
| 8104 |
<dt>inaccurate</dt> |
| 8105 |
|
| 8106 |
<dd> |
| 8107 |
combining the "X Consortium" and "DEC VT220", for example, |
| 8108 |
since that was done after the demise of said organization. |
| 8109 |
<p>It emulates a <em>subset</em> of VT100, lacks support |
| 8110 |
for most of the VT220 control sequences (including some |
| 8111 |
used for positioning the cursor) that are not recognized by |
| 8112 |
a VT100.</p> |
| 8113 |
|
| 8114 |
<p>Even in the subset which it emulates, GNOME Terminal has |
| 8115 |
bugs. Many of these are easy to demonstrate with |
| 8116 |
vttest.</p> |
| 8117 |
</dd> |
| 8118 |
|
| 8119 |
<dt>misleading</dt> |
| 8120 |
|
| 8121 |
<dd>as noted in <a href="#ctlseqs_ms">Xterm Control |
| 8122 |
Sequences</a>, xterm (mostly after "X Consortium") supports |
| 8123 |
control sequences which are not VT100/VT220. GNOME Terminal |
| 8124 |
implements many of these, but not all.</dd> |
| 8125 |
</dl> |
| 8126 |
</blockquote> |
| 8127 |
|
| 8128 |
<p>Perhaps that was unintentional – GNOME developers did |
| 8129 |
not appear to document what their program <em>does</em> outside |
| 8130 |
of that remark. However, an inspection of the changelog for |
| 8131 |
libvte (VTE) does show that most of the borrowing from xterm is |
| 8132 |
cited in an oblique manner – not once mentioning XFree86 |
| 8133 |
for example, leaving the impression (as indicated by "X |
| 8134 |
Consortium") that all of the work on xterm was done before |
| 8135 |
development of GNOME Terminal commenced.</p> |
| 8136 |
|
| 8137 |
<p>Most of this observation was documented between 2000 and 2007. |
| 8138 |
Other than maintenance, development of GNOME Terminal appeared to |
| 8139 |
have paused in 2005. As of 2009, its maintainer was (of the |
| 8140 |
development team), the least knowledgeable about terminal |
| 8141 |
emulation. So there was no progress on the large number of bug |
| 8142 |
reports related to xterm-compatibility.</p> |
| 8143 |
|
| 8144 |
<p>Revisiting in 2018 —</p> |
| 8145 |
|
| 8146 |
<p>Regarding documentation, the situation was not as good as |
| 8147 |
reported earlier. The problematic documentation was not even part |
| 8148 |
of the “official” GNOME Terminal, but was an add-on |
| 8149 |
by a Debian developer, adapted from GNOME Terminal's online help. |
| 8150 |
The developer's relationship was mentioned in a Debian bug |
| 8151 |
report:</p> |
| 8152 |
|
| 8153 |
<p><a href= |
| 8154 |
"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=127622"><em>#127622: |
| 8155 |
ncurses-term: terminfo entry for gnome-terminal swaps |
| 8156 |
Backspace/Delete</em></a>:</p> |
| 8157 |
|
| 8158 |
<blockquote> |
| 8159 |
<pre class="code-block"> |
| 8160 |
>> "TD" == Thomas Dickey <[email protected]> writes: |
| 8161 |
|
| 8162 |
> On Sun, Jan 06, 2002 at 06:13:30PM +0100, Christian Marillat wrote: |
| 8163 |
|
| 8164 |
[...] |
| 8165 |
|
| 8166 |
>> The upstream author should consider ours Debian changes has official |
| 8167 |
>> changes ? |
| 8168 |
|
| 8169 |
> sure - get gnome-terminal's author to make the changes. (I generally |
| 8170 |
> don't add customizations to ncurses' terminfo unless I see them incorporated |
| 8171 |
> intact by more than one other source). |
| 8172 |
|
| 8173 |
Sorry to say that, but upstream don't care about my patches. I've |
| 8174 |
forwarded patches since one year, and these patches has never been |
| 8175 |
included by upstream. Upstream sayd “commited”, but I never seen any |
| 8176 |
changes. |
| 8177 |
|
| 8178 |
Christian |
| 8179 |
</pre> |
| 8180 |
</blockquote> |
| 8181 |
|
| 8182 |
<p>The manual page provided as an attachment to GNOME <a href= |
| 8183 |
"https://bugzilla.gnome.org/show_bug.cgi?id=311565#c15">#311565</a> |
| 8184 |
identifies the author. However, four years later there is still |
| 8185 |
no manpage for GNOME Terminal. GNOME <a href= |
| 8186 |
"https://bugzilla.gnome.org/show_bug.cgi?id=701691">#701691</a> |
| 8187 |
mentions this in conjunction with GNOME Terminal's incompatible |
| 8188 |
behavior versus other terminals for the |
| 8189 |
“<code>-e</code>” option:</p> |
| 8190 |
|
| 8191 |
<blockquote> |
| 8192 |
<pre class="code-block"> |
| 8193 |
Christian Persch 2013-06-06 11:10:43 UTC |
| 8194 |
|
| 8195 |
This works as designed. Note that both -x and -e are deprecated; the only supported way to pass the arguments is after -- like this: |
| 8196 |
|
| 8197 |
$ gnome-terminal -- emacs file |
| 8198 |
</pre> |
| 8199 |
</blockquote> |
| 8200 |
|
| 8201 |
<p>and</p> |
| 8202 |
|
| 8203 |
<blockquote> |
| 8204 |
<pre class="code-block"> |
| 8205 |
Christian Persch 2013-06-06 16:02:54 UTC |
| 8206 |
|
| 8207 |
There are no docs for the gnome-terminal command line options. |
| 8208 |
</pre> |
| 8209 |
</blockquote> |
| 8210 |
|
| 8211 |
<p>Admittedly, GNOME Terminal has <em>some</em> documentation, in |
| 8212 |
its online help pages. As mentioned, the misleading comments |
| 8213 |
about <em>X Consortium</em> came from that material, which |
| 8214 |
remained for more than ten years before being revised early in |
| 8215 |
2013. Here are a few links for that process:</p> |
| 8216 |
|
| 8217 |
<ul> |
| 8218 |
<li> |
| 8219 |
<p><a href= |
| 8220 |
"https://github.com/GNOME/gnome-terminal/commit/911c644e814683f819463da50c1e4bbeb49a2a26"> |
| 8221 |
<em>help: update introduction.page</em></a> (2013-01-10)</p> |
| 8222 |
</li> |
| 8223 |
|
| 8224 |
<li> |
| 8225 |
<p><a href= |
| 8226 |
"https://github.com/GNOME/gnome-terminal/commit/dd1c5125c785f644954010052ee3e4c7783c08da"> |
| 8227 |
<em>help: review</em></a> (2013-01-09)</p> |
| 8228 |
</li> |
| 8229 |
|
| 8230 |
<li> |
| 8231 |
<p><a href= |
| 8232 |
"https://github.com/GNOME/gnome-terminal/commit/317b05f46807ea60fbd6a0ed493824a2269dcc60"> |
| 8233 |
<em>help: modified help in accordance with last |
| 8234 |
review</em></a> (2013-01-09)</p> |
| 8235 |
</li> |
| 8236 |
|
| 8237 |
<li> |
| 8238 |
<p><a href= |
| 8239 |
"https://github.com/GNOME/gnome-terminal/commit/13ece45d6398e0ebe9aa06cc8da2148534ca8af6"> |
| 8240 |
<em>help: write instroduction.page</em></a> (2013-01-08)</p> |
| 8241 |
</li> |
| 8242 |
|
| 8243 |
<li> |
| 8244 |
<p><a href= |
| 8245 |
"https://github.com/GNOME/gnome-terminal/commit/8a4b9e67bc8f6a19e62c58650a635de6178911bd"> |
| 8246 |
<em>help: start rewrite in Mallard</em></a> (2013-01-08)</p> |
| 8247 |
</li> |
| 8248 |
</ul> |
| 8249 |
|
| 8250 |
<p>The document editors removed this statement</p> |
| 8251 |
|
| 8252 |
<blockquote class="code-block"> |
| 8253 |
<p>Run any application that is designed to run on VT102, VT220, |
| 8254 |
and <code>xterm</code> terminals</p> |
| 8255 |
</blockquote> |
| 8256 |
|
| 8257 |
<p>as well as the extended comment about the <a href= |
| 8258 |
"#vte:xconsortium">X Consortium</a>, and replaced it with a less |
| 8259 |
specific statement.</p> |
| 8260 |
|
| 8261 |
<blockquote class="code-block"> |
| 8262 |
<p><code>Terminal</code> is a terminal emulator application for |
| 8263 |
accessing a UNIX shell environment which can be used to run |
| 8264 |
programs available on your system.</p> |
| 8265 |
|
| 8266 |
<p><code>Terminal</code> supports escape sequences that control |
| 8267 |
cursor position and colors.</p> |
| 8268 |
</blockquote> |
| 8269 |
|
| 8270 |
<p>The assertion about GNOME-Terminal's support for |
| 8271 |
“any” persists in its <a href= |
| 8272 |
"https://packages.debian.org/sid/gnome-terminal">package |
| 8273 |
description</a> in Debian as of 2026:</p> |
| 8274 |
|
| 8275 |
<blockquote class="code-block"> |
| 8276 |
<ul> |
| 8277 |
<li> |
| 8278 |
<p>Access a UNIX shell in the GNOME environment.</p> |
| 8279 |
</li> |
| 8280 |
|
| 8281 |
<li> |
| 8282 |
<p>Run any application that is designed to run on VT102, |
| 8283 |
VT220, and xterm terminals.</p> |
| 8284 |
</li> |
| 8285 |
</ul> |
| 8286 |
</blockquote> |
| 8287 |
|
| 8288 |
<p>Whether the revised manual is improved or even helpful is |
| 8289 |
debatable. For instance, it tells the reader how to turn the |
| 8290 |
scrollbar on and off (using a dialog, of course). But for |
| 8291 |
command-line options, it can print only about 45 lines of option |
| 8292 |
names and short (less than 10 words) descriptions for each if one |
| 8293 |
types</p> |
| 8294 |
|
| 8295 |
<blockquote> |
| 8296 |
<pre class="code-block"> |
| 8297 |
gnome-terminal --help-all |
| 8298 |
</pre> |
| 8299 |
</blockquote> |
| 8300 |
|
| 8301 |
<p>Other programs do the equivalent. In a quick check using |
| 8302 |
Debian 8:</p> |
| 8303 |
|
| 8304 |
<ul> |
| 8305 |
<li> |
| 8306 |
<p>85 lines for konsole</p> |
| 8307 |
</li> |
| 8308 |
|
| 8309 |
<li> |
| 8310 |
<p>120 lines for xterm patch #331</p> |
| 8311 |
</li> |
| 8312 |
|
| 8313 |
<li> |
| 8314 |
<p>122 lines for mlterm</p> |
| 8315 |
</li> |
| 8316 |
|
| 8317 |
<li> |
| 8318 |
<p>140 lines for urxvt</p> |
| 8319 |
</li> |
| 8320 |
</ul> |
| 8321 |
|
| 8322 |
<p>Bug <a href= |
| 8323 |
"https://bugzilla.gnome.org/show_bug.cgi?id=311565#c15">#311565</a> |
| 8324 |
was filed in 2014. In 2020, a manual was added, which is a slight |
| 8325 |
improvement over the command-line help, which lists the options. |
| 8326 |
As a <a href= |
| 8327 |
"https://salsa.debian.org/gnome-team/extras/gnome-terminal/-/commits/debian/latest/man?ref_type=heads"> |
| 8328 |
replacement</a> for Marillat's version, it omits the inaccurate |
| 8329 |
and misleading paragraphs cited above, leaving only this:</p> |
| 8330 |
|
| 8331 |
<blockquote> |
| 8332 |
<pre class="code-block">gnome-terminal is a terminal emulator |
| 8333 |
application for accessing a UNIX shell environment which can be |
| 8334 |
used to run programs available on your system. It supports |
| 8335 |
several profiles, multiple tabs and implements several keyboard |
| 8336 |
shortcuts.</pre> |
| 8337 |
</blockquote> |
| 8338 |
|
| 8339 |
<p>For additional information, as of 2026, the manual concludes |
| 8340 |
with links to two pages which recommend trying on the GNOME |
| 8341 |
website. As of 2026, there is no useful information on that |
| 8342 |
website.</p> |
| 8343 |
|
| 8344 |
<h3 id="vte_widget-id"><a name="vte_widget" id="vte_widget">Notes |
| 8345 |
on VTE</a></h3> |
| 8346 |
|
| 8347 |
<p>VTE is used by developers who provide a <a href= |
| 8348 |
"https://web.archive.org/web/20160727174633/https://best-practice-software-engineering.ifs.tuwien.ac.at/patterns/facade.html"> |
| 8349 |
facade</a> (also referred to as a “<a href= |
| 8350 |
"https://techterms.com/definition/skin">skin</a>”) for |
| 8351 |
simple desktop-oriented terminal emulation. <a href= |
| 8352 |
"https://www.calno.com/evilvte/">This page</a> gives a number of |
| 8353 |
examples with sizes for the skins. The actual program size is far |
| 8354 |
larger in each case, making the size of the skin irrelevant.</p> |
| 8355 |
|
| 8356 |
<p>For several years (<a href= |
| 8357 |
"https://github.com/GNOME/vte/commit/02f28ec3d4e12776c4b4edd2984be29d74d815c">2007</a> |
| 8358 |
to <a href= |
| 8359 |
"https://github.com/GNOME/vte/commit/4e253be9282829f594c8a55ca08d1299e80e471d"> |
| 8360 |
2014</a>), VTE's README file asserted</p> |
| 8361 |
|
| 8362 |
<blockquote class="code-block"> |
| 8363 |
<p>VTE supports Unicode and character set conversion, as well |
| 8364 |
as emulating any terminal known to the system's terminfo |
| 8365 |
database.</p> |
| 8366 |
</blockquote> |
| 8367 |
|
| 8368 |
<p>The latter part of that ("emulating any terminal") was |
| 8369 |
incorrect. It did have the ability to work with the standard |
| 8370 |
function-key definitions which can be defined in a terminfo |
| 8371 |
description. That feature was discarded in 2014.</p> |
| 8372 |
|
| 8373 |
<p>Notes from 2010 —</p> |
| 8374 |
|
| 8375 |
<p>Some of the function-key logic was adapted from xterm; |
| 8376 |
generally refactoring the xterm source-code to make it appear |
| 8377 |
different. In places however (naming conventions and comments), |
| 8378 |
there was some verbatim copying. The same observation can be made |
| 8379 |
of "character set conversion". None of that is reflected in VTE's |
| 8380 |
<a href= |
| 8381 |
"https://github.com/GNOME/vte/commits/master/">git-log</a>.</p> |
| 8382 |
|
| 8383 |
<p>As an aside, the credits in GNOME Terminal's |
| 8384 |
“About” box also are inaccurate. For several years |
| 8385 |
(according to its change-log), most of the work on VTE (the |
| 8386 |
principal part of the program) was done by Nalin Dahyabhai.</p> |
| 8387 |
|
| 8388 |
<p>xterm on the other hand, can be told with the <a href= |
| 8389 |
"manpage/xterm.html#Application-Resources:tcapFunctionKeys"><code> |
| 8390 |
tcapFunctionKeys</code></a> resource setting to use a more |
| 8391 |
complete subset, based on the ncurses extended terminal |
| 8392 |
descriptions. However, terminal descriptions describe only one |
| 8393 |
particular configuration of a terminal. Even xterm's |
| 8394 |
terminfo/termcap descriptions do not cover the (literally) |
| 8395 |
thousands of keyboard combinations which are available via its |
| 8396 |
resource settings.</p> |
| 8397 |
|
| 8398 |
<p>Outside of function-keys, VTE provided no ability to emulate |
| 8399 |
“any terminal”. A casual glance at its source code |
| 8400 |
revealed the following:</p> |
| 8401 |
|
| 8402 |
<ul> |
| 8403 |
<li> |
| 8404 |
<p>no support for VT220-style protected areas.</p> |
| 8405 |
</li> |
| 8406 |
|
| 8407 |
<li> |
| 8408 |
<p>inconsistent support for modifier keys (the subject of |
| 8409 |
several bug reports misdirected toward ncurses).</p> |
| 8410 |
</li> |
| 8411 |
|
| 8412 |
<li> |
| 8413 |
<p>only a subset of the standard terminfo/termcap properties |
| 8414 |
is used (5/36 booleans, 3/33 numbers, 125/242 strings other |
| 8415 |
than function-keys).</p> |
| 8416 |
</li> |
| 8417 |
|
| 8418 |
<li> |
| 8419 |
<p>a pervasive assumption that the terminal is something like |
| 8420 |
xterm, e.g., to provide hardcoded behavior where termcap |
| 8421 |
might describe something different.</p> |
| 8422 |
</li> |
| 8423 |
|
| 8424 |
<li> |
| 8425 |
<p>it uses termcap to retrieve data, rather than providing a |
| 8426 |
choice between terminfo/termcap, opening up the problem of |
| 8427 |
using an obsolete database.</p> |
| 8428 |
</li> |
| 8429 |
|
| 8430 |
<li> |
| 8431 |
<p>using termcap also means that it has no guidance for |
| 8432 |
following features which are absent or have |
| 8433 |
limited-functionality compared to terminfo, such as setting |
| 8434 |
video attributes, colors, etc.</p> |
| 8435 |
</li> |
| 8436 |
</ul> |
| 8437 |
|
| 8438 |
<p>For instance, VTE cannot emulate <a href= |
| 8439 |
"xterm.faq.html#bug_dtterm">dtterm</a>, because of differences in |
| 8440 |
color behavior. In fact, VTE does not use any of the termcap data |
| 8441 |
to support its interpretation of color control sequences.</p> |
| 8442 |
|
| 8443 |
<p>After 2014 —</p> |
| 8444 |
|
| 8445 |
<p>Until 2014, VTE used a <em>termcap</em> file, with its own |
| 8446 |
<em>reader</em>, presumably under the impression that could be |
| 8447 |
used to describe “any terminal” (although it was |
| 8448 |
fairly well known that terminals could support escape sequences |
| 8449 |
not found in any terminal description). As a separate file, the |
| 8450 |
<em>termcap</em> was a nuisance, whether it was bundled with VTE |
| 8451 |
(and inaccessible to users) or not. The developers tried it both |
| 8452 |
ways.</p> |
| 8453 |
|
| 8454 |
<p>One recurring problem was that VTE's termcap did not match |
| 8455 |
xterm's function-keys. Even when VTE's developers modified the |
| 8456 |
termcap to match as well as the termcap could, the match was |
| 8457 |
still incomplete. None of the <em>modified</em> keys were |
| 8458 |
correct, since none of those are described by termcap. That meant |
| 8459 |
that a <em><strong>control</strong></em> modifier with a |
| 8460 |
cursor-key or function key was likely to be misread by programs |
| 8461 |
running in VTE.</p> |
| 8462 |
|
| 8463 |
<p>Finally in 2014, the VTE developers decided to change it. |
| 8464 |
First, one decided to adapt a chunk of source-code from ncurses, |
| 8465 |
perhaps thinking that was the way to get a better |
| 8466 |
<em>reader</em>. That did not work well, and finally they |
| 8467 |
discarded the whole feature, hardcoding the behavior to match |
| 8468 |
xterm's default configuration.</p> |
| 8469 |
|
| 8470 |
<p>Here are bug reports which give the story:</p> |
| 8471 |
|
| 8472 |
<ul> |
| 8473 |
<li> |
| 8474 |
<p><a href= |
| 8475 |
"https://bugzilla.gnome.org/show_bug.cgi?id=600659">#600659 |
| 8476 |
– <em>Home/End generate wrong control |
| 8477 |
sequences</em></a>.</p> |
| 8478 |
|
| 8479 |
<pre class="code-block"> |
| 8480 |
Escape sequences of the “default” kbd mode should be okay now. |
| 8481 |
|
| 8482 |
Removal of non-default kbd modes is continued in bug 730137. |
| 8483 |
</pre> |
| 8484 |
</li> |
| 8485 |
|
| 8486 |
<li> |
| 8487 |
<p><a href= |
| 8488 |
"https://bugzilla.gnome.org/show_bug.cgi?id=169295">#169295 |
| 8489 |
– <em>builtin termcap parser not needed</em></a>.</p> |
| 8490 |
|
| 8491 |
<pre class="code-block"> |
| 8492 |
all: Use terminfo instead of termcap |
| 8493 |
</pre> |
| 8494 |
</li> |
| 8495 |
|
| 8496 |
<li> |
| 8497 |
<p><a href= |
| 8498 |
"https://bugzilla.gnome.org/show_bug.cgi?id=730137">#730137 |
| 8499 |
– <em>Drop (or fix) nondefault fkey modes</em></a>.</p> |
| 8500 |
|
| 8501 |
<p class="code-block">Since addressing bug 600659, VTE's |
| 8502 |
default mode pretty accurately matches XTerm. VT220 is |
| 8503 |
okay-ish, Legacy is so-so, HP and Sun are quite broken.</p> |
| 8504 |
</li> |
| 8505 |
|
| 8506 |
<li> |
| 8507 |
<p><a href= |
| 8508 |
"https://bugzilla.gnome.org/show_bug.cgi?id=728900">#728900 |
| 8509 |
– <em>use terminfo instead of termcap</em></a>.</p> |
| 8510 |
|
| 8511 |
<p class="code-block">Do we want to rely in term{cap,info} |
| 8512 |
*at all*? So far vte has used hardwired sequences most of the |
| 8513 |
time. Even if we clean up everything and drop all fkey modes |
| 8514 |
except the default (request: bug 600659 comment 73) we'd need |
| 8515 |
to keep hardwired sequences for numerous reasons. E.g. |
| 8516 |
Home/End should generate ^[[H/^[[F which are not present in |
| 8517 |
terminfo. Application cursor keys and application keypad mode |
| 8518 |
alter some sequences, with AFAICT no terminfo support |
| 8519 |
whatsoever. F1..F4 completely change their sequences when a |
| 8520 |
modifier is pressed, again probably no support for it in |
| 8521 |
terminfo. Terminfo is just able to encode the complexity (app |
| 8522 |
keypad mode, app cursor mode, modifiers, numlock) we need. |
| 8523 |
Wouldn't life be much simpler with just hardwired |
| 8524 |
xterm-compatible sequences? (With probably a way to override |
| 8525 |
them from config file or dconf for experts.)</p> |
| 8526 |
</li> |
| 8527 |
</ul> |
| 8528 |
|
| 8529 |
<p>As a minor improvement, those changes removed some of the code |
| 8530 |
whose origin was cut/paste from xterm. But that does not mean |
| 8531 |
that the VTE developers stopped that practice. For instance, a |
| 8532 |
change in late 2017 <a href= |
| 8533 |
"https://en.wikipedia.org/w/index.php?title=ANSI_escape_code&type=revision&diff=816842550&oldid=815750533"> |
| 8534 |
here</a> reminded me to check what VTE does when saving/restoring |
| 8535 |
the cursor position. It turns out that it does something similar, |
| 8536 |
because (see <a href= |
| 8537 |
"https://bugzilla.gnome.org/show_bug.cgi?id=731205">#731205</a> |
| 8538 |
and <a href= |
| 8539 |
"https://bugzilla.gnome.org/show_bug.cgi?id=741193">#741193</a>) |
| 8540 |
the developer studied xterm's source-code and imitated it (see |
| 8541 |
<a href= |
| 8542 |
"https://github.com/GNOME/vte/commit/master/?id=5a434e6c4457bdfe182a13213396e7a66a08f767"> |
| 8543 |
source changes</a> and <a href= |
| 8544 |
"https://github.com/GNOME/vte/commit/master/?id=e549a0eebc82fde89134c15ead322dc199d99239"> |
| 8545 |
followup fixes</a>). There's a quirk in the resulting program (it |
| 8546 |
pays attention to send/receive and insert modes, which are |
| 8547 |
unrelated, while also missing the handling of wrap state), but if |
| 8548 |
the developer had read the documentation (DEC's manuals), that |
| 8549 |
detail would be missing. In reviewing the documentation, I |
| 8550 |
noticed a different aspect which might be used to improve xterm, |
| 8551 |
and ultimately appear in VTE (or perhaps not, since it is in an |
| 8552 |
area poorly supported by VTE, i.e., the bug which was |
| 8553 |
reported).</p> |
| 8554 |
|
| 8555 |
<p>VTE developers do more than copy from xterm, of course. There |
| 8556 |
are other programs (such as Konsole and Terminal.app) which get |
| 8557 |
similar treatment. Because they tend to copy from others rather |
| 8558 |
than doing their own solutions, they have not acquired the |
| 8559 |
experience to see why features were added or modified (or |
| 8560 |
removed), just that it is there. For instance:</p> |
| 8561 |
|
| 8562 |
<ul> |
| 8563 |
<li> |
| 8564 |
<p>In a rewrite in early 2018, they introduced a skeleton of |
| 8565 |
code from Paul Williams' sample parser. However, that was |
| 8566 |
only a skeleton. For the flesh – the usual approach |
| 8567 |
(see above).</p> |
| 8568 |
|
| 8569 |
<p>Two thirds of the functions listed in the skeleton are |
| 8570 |
no-ops (<a href= |
| 8571 |
"https://github.com/GNOME/vte/blob/78b37c0ef1e6266cd10789991fcc6bf1d1b9cc3c">not |
| 8572 |
implemented</a>). Some of those listed as implemented do not |
| 8573 |
work (see vttest <a href= |
| 8574 |
"/vttest/vttest-codepages.html#ISO-Latin-1">screenshot</a>).</p> |
| 8575 |
|
| 8576 |
<p>Oddly enough, the developers decided to make the program |
| 8577 |
first a <a href= |
| 8578 |
"https://github.com/GNOME/vte/blob/78b37c0ef1e6266cd10789991fcc6bf1d1b9cc3c/src/vteseq.cc#L3553"> |
| 8579 |
VT420</a> (using the primary device attributes), then a |
| 8580 |
<a href= |
| 8581 |
"https://github.com/GNOME/vte/blob/fde88ef7f9226a0849ca62663bc1eaa9862178b8/src/vteseq.cc#L2807"> |
| 8582 |
VT525</a> (with the secondary device attributes) but |
| 8583 |
confusing it with <a href= |
| 8584 |
"https://github.com/GNOME/vte/blob/fde88ef7f9226a0849ca62663bc1eaa9862178b8/src/vteseq.cc#L2797"> |
| 8585 |
VT220</a> The skeleton demonstrates that it lacked almost all |
| 8586 |
features provided by the corresponding VT525 hardware |
| 8587 |
terminal. In October 2018, the listing showed mostly a subset |
| 8588 |
of VT100, with some (longstanding) features adapted from |
| 8589 |
xterm, and a few inspired by ECMA-48.</p> |
| 8590 |
</li> |
| 8591 |
|
| 8592 |
<li> |
| 8593 |
<p>The latter requires some comment: xterm's |
| 8594 |
control-sequences document has mentioned ISO-6429 and ECMA-48 |
| 8595 |
since its earliest version. VTE's developers used the |
| 8596 |
control-sequences document as a reference <a href= |
| 8597 |
"https://web.archive.org/web/20181208113535/https://bugzilla.gnome.org/buglist.cgi?quicksearch=ctlseqs"> |
| 8598 |
(see bug reports)</a> along with xterm's source-code rather |
| 8599 |
than <a href= |
| 8600 |
"https://web.archive.org/web/20190326145614/https://bugzilla.gnome.org/buglist.cgi?quicksearch=ecma-48"> |
| 8601 |
ECMA-48</a> or DEC's manuals until around the end of |
| 8602 |
2016.</p> |
| 8603 |
</li> |
| 8604 |
|
| 8605 |
<li> |
| 8606 |
<p>They did (eventually) read documentation referred to by |
| 8607 |
xterm's documentation. But that took a while, and they began |
| 8608 |
copying from those sources before understanding the tradeoffs |
| 8609 |
in those. Late in 2016, they started copying features |
| 8610 |
mentioned in ECMA-48. The motivation for that appears to be |
| 8611 |
(unsurprisingly) copying from yet another source, e.g., |
| 8612 |
<a href="https://github.com/kovidgoyal/kitty">kitty</a> (yet |
| 8613 |
another copyist: see <a href= |
| 8614 |
"https://github.com/alacritty/alacritty">alacritty</a>, but |
| 8615 |
also see <a href= |
| 8616 |
"https://github.com/alacritty/vte">this</a>).</p> |
| 8617 |
</li> |
| 8618 |
|
| 8619 |
<li> |
| 8620 |
<p>Introducing those ECMA-48 features caused additional |
| 8621 |
failures for VTE versus <a href= |
| 8622 |
"/vttest/vttest.html">vttest</a>, which the VTE developers |
| 8623 |
solved by making a copy of vttest, to “fix” the |
| 8624 |
bug. The problematic feature dealt with clearing tab-stops |
| 8625 |
(selection 2).</p> |
| 8626 |
|
| 8627 |
<p>ECMA-48 specifies the <em>active line</em> in selection 2. |
| 8628 |
For an explanation of the term, see ECMA-48 section |
| 8629 |
<em><strong>6.1.5</strong> Relationship between active data |
| 8630 |
position and active presentation position</em>. This is |
| 8631 |
distinct from the feature which DEC's terminals |
| 8632 |
supported.</p> |
| 8633 |
|
| 8634 |
<p>The VT520 manual is explicit in this case (only selections |
| 8635 |
0 and 3 are supported). Per Lindberg's 1985 test demonstrated |
| 8636 |
that the unsupported selection 2 was ignored in a VT100.</p> |
| 8637 |
</li> |
| 8638 |
|
| 8639 |
<li> |
| 8640 |
<p>The VT520 did not support the other selection (2) because |
| 8641 |
that would have been used to support bi-directional text. |
| 8642 |
There is no point in having two differently-worded |
| 8643 |
descriptions of the same identical feature.</p> |
| 8644 |
|
| 8645 |
<p>At the time the VTE developers copied the feature, they |
| 8646 |
had not begun to develop support bi-directional text (see for |
| 8647 |
example <a href= |
| 8648 |
"https://bugzilla.gnome.org/show_bug.cgi?id=321490"><em>#321490 |
| 8649 |
(vtebidi)</em></a> and <a href= |
| 8650 |
"https://bugzilla.gnome.org/show_bug.cgi?id=767529"><em>#767529 |
| 8651 |
(vteemoji)</em></a>.</p> |
| 8652 |
|
| 8653 |
<p>As I was writing this in 2018, the developers were talking |
| 8654 |
about working on that. The tab-clear operation was still |
| 8655 |
<a href= |
| 8656 |
"https://github.com/GNOME/vte/blob/fde88ef7f9226a0849ca62663bc1eaa9862178b8/src/vteseq.cc#L5306"> |
| 8657 |
identical in VTE</a> for both selections 2 and 3, and does |
| 8658 |
not implement any of the features from ECMA-48 |
| 8659 |
<strong>not</strong> in a DEC terminal.</p> |
| 8660 |
</li> |
| 8661 |
</ul> |
| 8662 |
|
| 8663 |
<p>Other problems with VTE —</p> |
| 8664 |
|
| 8665 |
<p>These are a few of the interesting bugs found in VTE (or GNOME |
| 8666 |
Terminal) during 2017:</p> |
| 8667 |
|
| 8668 |
<ul> |
| 8669 |
<li> |
| 8670 |
<p>system crash due to running out of memory<br> |
| 8671 |
while running ncurses sample programs <a href= |
| 8672 |
"/ncurses/ncurses-slang.html#compare_dots">dots</a> and |
| 8673 |
<a href= |
| 8674 |
"/ncurses/ncurses-slang.html#compare_picsmap">picsmap</a>.</p> |
| 8675 |
</li> |
| 8676 |
|
| 8677 |
<li> |
| 8678 |
<p>failure to open a remote connection, noticed<br> |
| 8679 |
while gathering data for a <a href="#scroll_speed">discussion |
| 8680 |
of scrolling performance</a>.</p> |
| 8681 |
</li> |
| 8682 |
</ul> |
| 8683 |
|
| 8684 |
<p>Other uses of VTE —</p> |
| 8685 |
|
| 8686 |
<p>Because of GNOME Terminal's reputation for excessive code |
| 8687 |
bloat, developers of every other program based on VTE advertise |
| 8688 |
their version as reduced memory usage, faster startup, etc. Here |
| 8689 |
are a few of the available ones:</p> |
| 8690 |
|
| 8691 |
<ul> |
| 8692 |
<li> |
| 8693 |
<p><a name="bug_osso_xterm" id= |
| 8694 |
"bug_osso_xterm">osso-xterm</a> <a href= |
| 8695 |
"https://web.archive.org/web/20150906084119/https://maemo.org/development/tools/doc/diablo/osso-xterm/"> |
| 8696 |
link</a></p> |
| 8697 |
|
| 8698 |
<p>Its home page refers to "at least two versions". I recall |
| 8699 |
seeing an older version which was apparently not based on |
| 8700 |
VTE. There did not appear to be any relevant page (as of |
| 8701 |
2009) for that version. The Internet Archive has <a href= |
| 8702 |
"https://web.archive.org/web/20090223194901/http://repository.maemo.org/pool/maemo3.2/free/source/"> |
| 8703 |
source code</a>, and packages which provides only versions |
| 8704 |
based on VTE, along with this information:</p> |
| 8705 |
|
| 8706 |
<blockquote> |
| 8707 |
<pre class="code-block"> |
| 8708 |
Benedikt Meurer <[email protected]> |
| 8709 |
Francois Le Clainche <[email protected]> |
| 8710 |
Johan Hedberg <[email protected]> |
| 8711 |
|
| 8712 |
Some pieces of code where adopted from gnome-terminal (e.g. the DnD code |
| 8713 |
is based on the code found in gnome-terminal, also parts of the geometry |
| 8714 |
management were taken from gnome-terminal). |
| 8715 |
|
| 8716 |
Parts of the online documentation where copied from Konsole and the |
| 8717 |
gnome user guide. |
| 8718 |
</pre> |
| 8719 |
</blockquote> |
| 8720 |
</li> |
| 8721 |
|
| 8722 |
<li> |
| 8723 |
<p><a name="bug_roxterm" id="bug_roxterm">roxterm</a> |
| 8724 |
<a href="https://roxterm.sourceforge.net/">link</a></p> |
| 8725 |
</li> |
| 8726 |
|
| 8727 |
<li> |
| 8728 |
<p><a name="bug_xfce_term" id="bug_xfce_term">XFCE |
| 8729 |
Terminal</a> <a href= |
| 8730 |
"https://docs.xfce.org/apps/terminal/start">link</a></p> |
| 8731 |
</li> |
| 8732 |
</ul> |
| 8733 |
|
| 8734 |
<h3 id="bug_multignome-id"><a name="bug_multignome" id= |
| 8735 |
"bug_multignome">MULTI GNOME TERMINAL (MGT)</a> <a href= |
| 8736 |
"https://multignometerm.sourceforge.net/">link</a></h3> |
| 8737 |
|
| 8738 |
<p>Of particular note, MGT 1.4.0 announcement claims that it |
| 8739 |
works properly for all of <a href= |
| 8740 |
"/vttest/vttest.html">vttest</a>)'s tests. On the positive side, |
| 8741 |
it does do VT52 emulation, but (reading the source code did not |
| 8742 |
help) it apparently does not really do VT220 from vttest's |
| 8743 |
perspective.</p> |
| 8744 |
|
| 8745 |
<h3 id="bug_hanterm-id"><a name="bug_hanterm" id= |
| 8746 |
"bug_hanterm">HANTERM</a> <a href= |
| 8747 |
"https://ftp.bme.hu/debian-archive/debian/pool/main/h/hanterm/">download</a></h3> |
| 8748 |
|
| 8749 |
<p>HanTerm stands for "Hangul term" (Korean). This is based on |
| 8750 |
the XFree86 source.</p> |
| 8751 |
|
| 8752 |
<h3 id="bug_konsole-id"><a name="bug_konsole" id= |
| 8753 |
"bug_konsole">KONSOLE</a> <a href= |
| 8754 |
"https://kde.org/">link</a></h3> |
| 8755 |
|
| 8756 |
<p>More than just a rewrite of <a href= |
| 8757 |
"xterm.faq.html#bug_kvt">kvt</a> into C++. But there are several |
| 8758 |
incompatibilities between konsole (noted with version 1.0.2 in |
| 8759 |
late 2001) and xterm:</p> |
| 8760 |
|
| 8761 |
<ul> |
| 8762 |
<li> |
| 8763 |
<p>none of the selections of keyboard mappings match the |
| 8764 |
actual behavior of xterm (a few come close, but do so by |
| 8765 |
matching the terminfo descriptions rather than the programs). |
| 8766 |
In particular, the application keypad does not send |
| 8767 |
vt100-style escapes.</p> |
| 8768 |
</li> |
| 8769 |
|
| 8770 |
<li> |
| 8771 |
<p><a href="/vttest/vttest.html">vttest</a>) demonstrates |
| 8772 |
that konsole does not properly ignore escape sequences to |
| 8773 |
switch character sets that it does not support. Also, the |
| 8774 |
developers of konsole did use an old version of vttest, but |
| 8775 |
that was to add a bogus Device Attributes response (claimed |
| 8776 |
to be for “vt220”, but not corresponding to any |
| 8777 |
that DEC produced). They do not use the newer version of |
| 8778 |
vttest (which was available more than a year before |
| 8779 |
development of konsole began).</p> |
| 8780 |
</li> |
| 8781 |
|
| 8782 |
<li> |
| 8783 |
<p>konsole implements several features from XFree86 xterm, |
| 8784 |
but some are done incorrectly. In particular, the <a href= |
| 8785 |
"xterm.faq.html#xterm_tite">private setmode 1049</a> does not |
| 8786 |
save and restore the cursor, causing the cursor to be in |
| 8787 |
unexpected locations after exiting a fullscreen application |
| 8788 |
such as vi.</p> |
| 8789 |
</li> |
| 8790 |
</ul> |
| 8791 |
|
| 8792 |
<p>The problem with setmode 1049 was fixed several weeks later |
| 8793 |
(reported here 2001/09/10, fixed upstream 2001/11/01 and packaged |
| 8794 |
<a href= |
| 8795 |
"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=121159#20">2001/11/26</a>); |
| 8796 |
other issues linger on.</p> |
| 8797 |
|
| 8798 |
<p>The original change and the correction bear comment:</p> |
| 8799 |
|
| 8800 |
<ul> |
| 8801 |
<li> |
| 8802 |
<p>The initial change adding the 1049 mode was one of several |
| 8803 |
changes where the konsole developer copied features from |
| 8804 |
xterm.</p> |
| 8805 |
|
| 8806 |
<blockquote class="code-block100"> |
| 8807 |
<!--{{atr2html--> |
| 8808 |
|
| 8809 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 8810 |
commit <a href= |
| 8811 |
"https://invent.kde.org/utilities/konsole/-/commit/ec4314a82cea1396f763da459caa5016cf4ca5e6">ec4314a82cea1396f763da459caa5016cf4ca5e6</a><br> |
| 8812 |
|
| 8813 |
Author: Lars Doelle <[email protected]><br> |
| 8814 |
|
| 8815 |
Date: Sun Jan 16 04:52:58 2000 +0000<br> |
| 8816 |
|
| 8817 |
<br> |
| 8818 |
added 1049 privacy code. reverted back to TERM=xterm.<br> |
| 8819 |
|
| 8820 |
<br> |
| 8821 |
svn path=/trunk/kdebase/konsole/; revision=38470<br> |
| 8822 |
|
| 8823 |
<br> |
| 8824 |
diff --git a/ChangeLog b/ChangeLog<br> |
| 8825 |
index 5c50f8e1f..9c7a895aa 100644<br> |
| 8826 |
<strong><span class= |
| 8827 |
"number">---</span></strong><span class="ident2"> a/ChangeLog<br> |
| 8828 |
</span> <strong><span class= |
| 8829 |
"number">+++</span></strong><span class= |
| 8830 |
"ident2"> b/ChangeLog<br></span> <strong><span class= |
| 8831 |
"number">@@</span></strong><span class= |
| 8832 |
"ident2"> -1,3 +1,6 @@<br></span> |
| 8833 |
+<span class="preproc">16 Jan 2000<br></span> |
| 8834 |
+<span class= |
| 8835 |
"preproc">- added privacy code 1049.<br> |
| 8836 |
</span> +<span class= |
| 8837 |
"preproc">- reverted to TERM=xterm.<br></span> |
| 8838 |
11 Jan 2000<br> |
| 8839 |
- upgraded xterm title hack to unicode.<br> |
| 8840 |
|
| 8841 |
- upgraded copy/paste to handle unicode.<br> |
| 8842 |
|
| 8843 |
diff --git a/src/TEShell.C b/src/TEShell.C<br> |
| 8844 |
|
| 8845 |
index 4910f685c..7587ca4f5 100644<br> |
| 8846 |
<strong><span class= |
| 8847 |
"number">---</span></strong><span class="ident2"> a/src/TEShell.C<br> |
| 8848 |
</span> <strong><span class= |
| 8849 |
"number">+++</span></strong><span class= |
| 8850 |
"ident2"> b/src/TEShell.C<br></span> |
| 8851 |
<strong><span class="number">@@</span></strong><span class= |
| 8852 |
"ident2"> -29,6 +29,12 @@<br></span> |
| 8853 |
<br> |
| 8854 |
\par FIXME<br> |
| 8855 |
<br> |
| 8856 |
+<span class= |
| 8857 |
"preproc"> NOTE that this module is part of a program and not a dump for<br> |
| 8858 |
</span> +<span class= |
| 8859 |
"preproc"> obsolete tty interfaces. The opening sequence can be reduced to<br> |
| 8860 |
</span> +<span class= |
| 8861 |
"preproc"> three or four lines, and, yes, i'll do this on a regular basis.<br> |
| 8862 |
</span> +<span class= |
| 8863 |
"preproc"> <br></span> +<span class= |
| 8864 |
"preproc"> \par FIXME<br></span> |
| 8865 |
+<span class="preproc"><br></span> |
| 8866 |
[NOTE: much of the technical stuff below will be replaced by forkpty.]<br> |
| 8867 |
|
| 8868 |
<br> |
| 8869 |
publish the SIGCHLD signal if not related to an instance.<br> |
| 8870 |
|
| 8871 |
<strong><span class="number">@@</span></strong><span class= |
| 8872 |
"ident2"> -356,11 +362,11 @@ void Shell::makeShell(const char* dev, QStrList & args, const char* term, int lo<br> |
| 8873 |
</span> <br> |
| 8874 |
if (tt > 2) close(tt);<br> |
| 8875 |
|
| 8876 |
<br> |
| 8877 |
-<span class= |
| 8878 |
"comment"> // Setup job control<br> |
| 8879 |
</span> +<span class= |
| 8880 |
"preproc"> // Setup job control ////////////////////////////////// <br> |
| 8881 |
</span> +<span class="preproc"><br></span> +<span class= |
| 8882 |
"preproc"> // This is pretty obscure stuff which makes the session<br> |
| 8883 |
</span> +<span class= |
| 8884 |
"preproc"> // to be the controlling terminal of a process group.<br> |
| 8885 |
</span> <br> |
| 8886 |
-<span class= |
| 8887 |
"comment"> // "There be dragons."<br> |
| 8888 |
</span> -<span class= |
| 8889 |
"comment"> // (Ancient world map)<br> |
| 8890 |
</span> -<span class="comment"> <br></span> |
| 8891 |
if (setsid() < 0) perror("failed to set process group"); // (vital for bash)<br> |
| 8892 |
|
| 8893 |
<br> |
| 8894 |
#if defined(TIOCSCTTY) <br> |
| 8895 |
diff --git a/src/TEmuVt102.C b/src/TEmuVt102.C<br> |
| 8896 |
|
| 8897 |
index 3870d086f..68a991110 100644<br> |
| 8898 |
<strong><span class= |
| 8899 |
"number">---</span></strong><span class="ident2"> a/src/TEmuVt102.C<br> |
| 8900 |
</span> <strong><span class= |
| 8901 |
"number">+++</span></strong><span class= |
| 8902 |
"ident2"> b/src/TEmuVt102.C<br></span> |
| 8903 |
<strong><span class="number">@@</span></strong><span class= |
| 8904 |
"ident2"> -423,6 +423,11 @@ void VT102Emulation::tau( int code, int p, int q )<br> |
| 8905 |
</span> |
| 8906 |
case TY_CSI_PR('h', 1048) : saveCursor ( ); break; //XTERM<br> |
| 8907 |
|
| 8908 |
case TY_CSI_PR('l', 1048) : restoreCursor ( ); break; //XTERM<br> |
| 8909 |
|
| 8910 |
<br> |
| 8911 |
+<span class= |
| 8912 |
"preproc"> //FIXME: every once new sequences like this pop up in xterm.<br> |
| 8913 |
</span> +<span class= |
| 8914 |
"preproc"> // Here's a guess of what they could mean.<br> |
| 8915 |
</span> +<span class= |
| 8916 |
"preproc"> case TY_CSI_PR('h', 1049) : setMode (MODE_AppScreen); break; //XTERM<br> |
| 8917 |
</span> +<span class= |
| 8918 |
"preproc"> case TY_CSI_PR('l', 1049) : resetMode (MODE_AppScreen); break; //XTERM<br> |
| 8919 |
</span> +<span class="preproc"><br></span> |
| 8920 |
//FIXME: when changing between vt52 and ansi mode evtl do some resetting.<br> |
| 8921 |
|
| 8922 |
case TY_VT52__('A' ) : scr->cursorUp ( 1); break; //VT52<br> |
| 8923 |
|
| 8924 |
case TY_VT52__('B' ) : scr->cursorDown ( 1); break; //VT52<br> |
| 8925 |
|
| 8926 |
<br> |
| 8927 |
<!--atr2html}}--></p> |
| 8928 |
</blockquote> |
| 8929 |
</li> |
| 8930 |
|
| 8931 |
<li> |
| 8932 |
<p>Here is the fix:</p> |
| 8933 |
|
| 8934 |
<blockquote class="code-block100"> |
| 8935 |
<!--{{atr2html--> |
| 8936 |
|
| 8937 |
<p style="font-family: monospace; font-size: 10pt;"> |
| 8938 |
commit <a href= |
| 8939 |
"https://invent.kde.org/utilities/konsole/-/commit/d221e4719e48c67886b149c3412a52f9a5daf697">d221e4719e48c67886b149c3412a52f9a5daf697</a><br> |
| 8940 |
|
| 8941 |
Author: Waldo Bastian <[email protected]><br> |
| 8942 |
|
| 8943 |
Date: Thu Nov 1 02:50:59 2001 +0000<br> |
| 8944 |
|
| 8945 |
<br> |
| 8946 |
Fix "joe" under konsole:<br> |
| 8947 |
|
| 8948 |
* Setting a scroll region takes effect on both primary and alternate screen.<br> |
| 8949 |
|
| 8950 |
* Some cleanups to make konsole follow xterm behaviour more closely.<br> |
| 8951 |
|
| 8952 |
<br> |
| 8953 |
svn path=/trunk/kdebase/konsole/; revision=120208<br> |
| 8954 |
|
| 8955 |
<br> |
| 8956 |
diff --git a/konsole/TEmuVt102.cpp b/konsole/TEmuVt102.cpp<br> |
| 8957 |
|
| 8958 |
index 5aa088825..0b72224e9 100644<br> |
| 8959 |
<strong><span class= |
| 8960 |
"number">---</span></strong><span class="ident2"> a/konsole/TEmuVt102.cpp<br> |
| 8961 |
</span> <strong><span class= |
| 8962 |
"number">+++</span></strong><span class= |
| 8963 |
"ident2"> b/konsole/TEmuVt102.cpp<br></span> |
| 8964 |
<strong><span class="number">@@</span></strong><span class= |
| 8965 |
"ident2"> -100,7 +100,7 @@ void TEmuVt102::reset()<br> |
| 8966 |
</span> |
| 8967 |
//kdDebug(1211)<<"TEmuVt102::reset() resetCharSet()"<<endl;<br> |
| 8968 |
|
| 8969 |
resetCharset(1);<br> |
| 8970 |
//kdDebug(1211)<<"TEmuVt102::reset() reset screen 1"<<endl;<br> |
| 8971 |
|
| 8972 |
-<span class= |
| 8973 |
"comment"> screen[0]->reset();<br></span> |
| 8974 |
+<span class= |
| 8975 |
"preproc"> screen[1]->reset();<br></span> |
| 8976 |
//kdDebug(1211)<<"TEmuVt102::reset() setCodec()"<<endl;<br> |
| 8977 |
|
| 8978 |
setCodec(0);<br> |
| 8979 |
//kdDebug(1211)<<"TEmuVt102::reset() done"<<endl;<br> |
| 8980 |
|
| 8981 |
<strong><span class="number">@@</span></strong><span class= |
| 8982 |
"ident2"> -528,7 +528,7 @@ void TEmuVt102::tau( int token, int p, int q )<br> |
| 8983 |
</span> |
| 8984 |
case TY_CSI_PN('c' ) : reportTerminalType ( ); break; //VT100<br> |
| 8985 |
|
| 8986 |
case TY_CSI_PN('d' ) : scr->setCursorY (p ); break; //LINUX<br> |
| 8987 |
|
| 8988 |
case TY_CSI_PN('f' ) : scr->setCursorYX (p, q); break; //VT100<br> |
| 8989 |
|
| 8990 |
-<span class= |
| 8991 |
"comment"> case TY_CSI_PN('r' ) : scr->setMargins (p, q); break; //VT100<br> |
| 8992 |
</span> +<span class= |
| 8993 |
"preproc"> case TY_CSI_PN('r' ) : setMargins (p, q); break; //VT100<br> |
| 8994 |
</span> |
| 8995 |
case TY_CSI_PN('y' ) : /* IGNORED: Confidence test */ break; //VT100<br> |
| 8996 |
|
| 8997 |
<br> |
| 8998 |
case TY_CSI_PR('h', 1) : setMode (MODE_AppCuKeys); break; //VT100<br> |
| 8999 |
|
| 9000 |
<strong><span class="number">@@</span></strong><span class= |
| 9001 |
"ident2"> -573,6 +573,8 @@ void TEmuVt102::tau( int token, int p, int q )<br> |
| 9002 |
</span> <br> |
| 9003 |
case TY_CSI_PR('h', 47) : setMode (MODE_AppScreen); break; //VT100<br> |
| 9004 |
|
| 9005 |
case TY_CSI_PR('l', 47) : resetMode (MODE_AppScreen); break; //VT100<br> |
| 9006 |
|
| 9007 |
+<span class= |
| 9008 |
"preproc"> case TY_CSI_PR('s', 47) : saveMode (MODE_AppScreen); break; //XTERM<br> |
| 9009 |
</span> +<span class= |
| 9010 |
"preproc"> case TY_CSI_PR('r', 47) : restoreMode (MODE_AppScreen); break; //XTERM<br> |
| 9011 |
</span> <br> |
| 9012 |
// XTerm defines the following modes:<br> |
| 9013 |
|
| 9014 |
// SET_VT200_MOUSE 1000<br> |
| 9015 |
|
| 9016 |
<strong><span class="number">@@</span></strong><span class= |
| 9017 |
"ident2"> -604,16 +606,20 @@ void TEmuVt102::tau( int token, int p, int q )<br> |
| 9018 |
</span> |
| 9019 |
case TY_CSI_PR('r', 1003) : restoreMode (MODE_Mouse1000); break; //XTERM<br> |
| 9020 |
|
| 9021 |
<br> |
| 9022 |
case TY_CSI_PR('h', 1047) : setMode (MODE_AppScreen); break; //XTERM<br> |
| 9023 |
|
| 9024 |
-<span class= |
| 9025 |
"comment"> case TY_CSI_PR('l', 1047) : resetMode (MODE_AppScreen); break; //XTERM<br> |
| 9026 |
</span> +<span class= |
| 9027 |
"preproc"> case TY_CSI_PR('l', 1047) : screen[1]->clearEntireScreen(); resetMode(MODE_AppScreen); break; //XTERM<br> |
| 9028 |
</span> +<span class= |
| 9029 |
"preproc"> case TY_CSI_PR('s', 1047) : saveMode (MODE_AppScreen); break; //XTERM<br> |
| 9030 |
</span> +<span class= |
| 9031 |
"preproc"> case TY_CSI_PR('r', 1047) : restoreMode (MODE_AppScreen); break; //XTERM<br> |
| 9032 |
</span> <br> |
| 9033 |
//FIXME: Unitoken: save translations<br> |
| 9034 |
|
| 9035 |
case TY_CSI_PR('h', 1048) : saveCursor ( ); break; //XTERM<br> |
| 9036 |
|
| 9037 |
case TY_CSI_PR('l', 1048) : restoreCursor ( ); break; //XTERM<br> |
| 9038 |
|
| 9039 |
+<span class= |
| 9040 |
"preproc"> case TY_CSI_PR('s', 1048) : saveCursor ( ); break; //XTERM<br> |
| 9041 |
</span> +<span class= |
| 9042 |
"preproc"> case TY_CSI_PR('r', 1048) : restoreCursor ( ); break; //XTERM<br> |
| 9043 |
</span> <br> |
| 9044 |
//FIXME: every once new sequences like this pop up in xterm.<br> |
| 9045 |
|
| 9046 |
// Here's a guess of what they could mean.<br> |
| 9047 |
|
| 9048 |
-<span class= |
| 9049 |
"comment"> case TY_CSI_PR('h', 1049) : setMode (MODE_AppScreen); break; //XTERM<br> |
| 9050 |
</span> -<span class= |
| 9051 |
"comment"> case TY_CSI_PR('l', 1049) : resetMode (MODE_AppScreen); break; //XTERM<br> |
| 9052 |
</span> +<span class= |
| 9053 |
"preproc"> case TY_CSI_PR('h', 1049) : saveCursor(); screen[1]->clearEntireScreen(); setMode(MODE_AppScreen); break; //XTERM<br> |
| 9054 |
</span> +<span class= |
| 9055 |
"preproc"> case TY_CSI_PR('l', 1049) : resetMode(MODE_AppScreen); restoreCursor(); break; //XTERM<br> |
| 9056 |
</span> <br> |
| 9057 |
//FIXME: when changing between vt52 and ansi mode evtl do some resetting.<br> |
| 9058 |
|
| 9059 |
case TY_VT52__('A' ) : scr->cursorUp ( 1); break; //VT52<br> |
| 9060 |
|
| 9061 |
<strong><span class="number">@@</span></strong><span class= |
| 9062 |
"ident2"> -942,6 +948,12 @@ void TEmuVt102::useCharset(int n)<br> |
| 9063 |
</span> |
| 9064 |
CHARSET.pound = (CHARSET.charset[n&3] == 'A'); //This mode is obsolete<br> |
| 9065 |
|
| 9066 |
}<br> |
| 9067 |
<br> |
| 9068 |
+<span class= |
| 9069 |
"preproc">void TEmuVt102::setMargins(int t, int b)<br> |
| 9070 |
</span> +<span class="preproc">{<br></span> +<span class= |
| 9071 |
"preproc"> screen[0]->setMargins(t, b);<br> |
| 9072 |
</span> +<span class= |
| 9073 |
"preproc"> screen[1]->setMargins(t, b);<br> |
| 9074 |
</span> +<span class="preproc">}<br></span> +<span class= |
| 9075 |
"preproc"><br></span> |
| 9076 |
/*! Save the cursor position and the rendition attribute settings. */<br> |
| 9077 |
|
| 9078 |
<br> |
| 9079 |
void TEmuVt102::saveCursor()<br> |
| 9080 |
<strong><span class="number">@@</span></strong><span class= |
| 9081 |
"ident2"> -1001,10 +1013,10 @@ void TEmuVt102::setMode(int m)<br> |
| 9082 |
</span> {<br> |
| 9083 |
case MODE_Mouse1000 : gui->setMouseMarks(FALSE);<br> |
| 9084 |
|
| 9085 |
break;<br> |
| 9086 |
+<span class="preproc"><br></span> |
| 9087 |
case MODE_AppScreen : screen[1]->clearSelection();<br> |
| 9088 |
|
| 9089 |
-<span class= |
| 9090 |
"comment"> screen[1]->clearEntireScreen();<br> |
| 9091 |
</span> |
| 9092 |
setScreen(1);<br> |
| 9093 |
|
| 9094 |
-<span class= |
| 9095 |
"comment"> break;<br> |
| 9096 |
</span> +<span class= |
| 9097 |
"preproc"> break;<br></span> |
| 9098 |
}<br> |
| 9099 |
if (m < MODES_SCREEN || m == MODE_NewLine)<br> |
| 9100 |
|
| 9101 |
{<br> |
| 9102 |
<strong><span class="number">@@</span></strong><span class= |
| 9103 |
"ident2"> -1020,6 +1032,7 @@ void TEmuVt102::resetMode(int m)<br> |
| 9104 |
</span> {<br> |
| 9105 |
case MODE_Mouse1000 : gui->setMouseMarks(TRUE);<br> |
| 9106 |
|
| 9107 |
break;<br> |
| 9108 |
+<span class="preproc"><br></span> |
| 9109 |
case MODE_AppScreen : screen[0]->clearSelection();<br> |
| 9110 |
|
| 9111 |
setScreen(0);<br> |
| 9112 |
|
| 9113 |
break;<br> |
| 9114 |
diff --git a/konsole/TEmuVt102.h b/konsole/TEmuVt102.h<br> |
| 9115 |
|
| 9116 |
index 1ef4b19e0..9291ddb9c 100644<br> |
| 9117 |
<strong><span class= |
| 9118 |
"number">---</span></strong><span class="ident2"> a/konsole/TEmuVt102.h<br> |
| 9119 |
</span> <strong><span class= |
| 9120 |
"number">+++</span></strong><span class= |
| 9121 |
"ident2"> b/konsole/TEmuVt102.h<br></span> |
| 9122 |
<strong><span class="number">@@</span></strong><span class= |
| 9123 |
"ident2"> -128,6 +128,8 @@ protected:<br> |
| 9124 |
</span> void saveCursor();<br> |
| 9125 |
void restoreCursor();<br> |
| 9126 |
void resetCharset(int scrno);<br> |
| 9127 |
|
| 9128 |
+<span class= |
| 9129 |
"preproc"> void setMargins(int t, int b);<br> |
| 9130 |
</span> +<span class="preproc"> <br></span> |
| 9131 |
CharCodes charset[2];<br> |
| 9132 |
<br> |
| 9133 |
DECpar currParm;<br> |
| 9134 |
<br> |
| 9135 |
<!--atr2html}}--></p> |
| 9136 |
</blockquote> |
| 9137 |
</li> |
| 9138 |
|
| 9139 |
<li> |
| 9140 |
<p>Possibly the KDE developers had read this FAQ; I began |
| 9141 |
this page in April 1997. The control sequences document was |
| 9142 |
not a web page at that time. A knowledgeable X11 developer |
| 9143 |
would know that <em>ctlseqs.ms</em> was in |
| 9144 |
<tt>xc/doc/specs/xterm</tt>. The fix indicates that the |
| 9145 |
latter developer had read the documentation while the |
| 9146 |
original code demonstrates the reverse.</p> |
| 9147 |
|
| 9148 |
<p>At that point in time, the documentation said</p> |
| 9149 |
|
| 9150 |
<blockquote> |
| 9151 |
<pre class="code-block"> |
| 9152 |
CSI ? <em>Pm</em> h DEC Private Mode Set (DECSET) |
| 9153 |
... |
| 9154 |
<em>Ps</em> = 1 0 4 9 → Save cursor as in DECSC and use Alter‐ |
| 9155 |
nate Screen Buffer, clearing it first (unless disabled by |
| 9156 |
the <strong>titeInhibit</strong> resource) |
| 9157 |
CSI ? <em>Pm</em> l DEC Private Mode Reset (DECRST) |
| 9158 |
... |
| 9159 |
<em>Ps</em> = 1 0 4 9 → Use Normal Screen Buffer and restore |
| 9160 |
cursor as in DECRC (unless disabled by the <strong>titeInhibit</strong> |
| 9161 |
resource) |
| 9162 |
CSI ? <em>Pm</em> r Restore DEC Private Mode Values. The value of <em>Ps</em> previ‐ |
| 9163 |
ously saved is restored. <em>Ps</em> values are the same as for |
| 9164 |
DECSET. |
| 9165 |
CSI ? <em>Pm</em> s Save DEC Private Mode Values. <em>Ps</em> values are the same as |
| 9166 |
for DECSET. |
| 9167 |
</pre> |
| 9168 |
</blockquote> |
| 9169 |
</li> |
| 9170 |
|
| 9171 |
<li> |
| 9172 |
<p>The fix did not amend the unnecessary comment, which at |
| 9173 |
this time (2025) is still present in the <a href= |
| 9174 |
"https://invent.kde.org/utilities/konsole/-/blob/master/src/Vt102Emulation.cpp?ref_type=heads#L2103"> |
| 9175 |
source code</a>. But then, a lot of the comments in the code |
| 9176 |
are inaccurate, such as this, a few lines later:</p> |
| 9177 |
|
| 9178 |
<blockquote> |
| 9179 |
<pre class="code-block"> |
| 9180 |
// Set Cursor Style (DECSCUSR), VT520, with the extra xterm sequences |
| 9181 |
// the first one is a special case, 'ESC[ q', which mimics 'ESC[1 q' |
| 9182 |
// Using 0 to reset to default is matching VTE, but not any official standard. |
| 9183 |
</pre> |
| 9184 |
</blockquote> |
| 9185 |
|
| 9186 |
<p>Apparently, in the view of the <a href= |
| 9187 |
"https://invent.kde.org/utilities/konsole/-/commit/97f101af8a10b4f273775545ac53e7938b4b5c8e"> |
| 9188 |
KDE developer</a>, the VT520 reference manual is not an |
| 9189 |
official standard.</p> |
| 9190 |
</li> |
| 9191 |
</ul> |
| 9192 |
|
| 9193 |
<p>Like <a href="#bug_gnometerm">GNOME Terminal</a>, konsole's |
| 9194 |
documentation is incomplete and inaccurate. This <a href= |
| 9195 |
"https://invent.kde.org/utilities/konsole/-/commit/7acfe93e288e6dcf6836dac4727ec3fa481536dc"> |
| 9196 |
gem</a> from its handbook illustrates the problem:</p> |
| 9197 |
|
| 9198 |
<blockquote class="code-block"> |
| 9199 |
<p>After a decade, Konsole is the first rewrite from the ground |
| 9200 |
up. While xterm has definitely been hacked to death (its README |
| 9201 |
begins with the words Abandon All Hope, Ye Who Enter Here), |
| 9202 |
Konsole offers a fresh start using contemporary technologies |
| 9203 |
and understanding of X.</p> |
| 9204 |
</blockquote> |
| 9205 |
|
| 9206 |
<p>The problem:</p> |
| 9207 |
|
| 9208 |
<ul> |
| 9209 |
<li> |
| 9210 |
<p>the remark was apparently written in 1997. It was |
| 9211 |
inaccurate at that time, since it disregards the earlier |
| 9212 |
xvt/rxvt applications. Limiting it only to a plain statement |
| 9213 |
that konsole was a rewrite of <a href= |
| 9214 |
"xterm.faq.html#bug_kvt">kvt</a> would have been more |
| 9215 |
accurate. Lacking that context, we find nonfactual articles |
| 9216 |
such as <a href= |
| 9217 |
"https://everything2.com/index.pl?node=Konsole">this</a> on |
| 9218 |
the net.</p> |
| 9219 |
</li> |
| 9220 |
|
| 9221 |
<li> |
| 9222 |
<p>for those lacking a proper education, the README was |
| 9223 |
apparently intended to be a humorous reference to Dante's |
| 9224 |
<em>Inferno</em>.</p> |
| 9225 |
</li> |
| 9226 |
|
| 9227 |
<li> |
| 9228 |
<p>reading konsole's source code and considering "hacked to |
| 9229 |
death" can provide some occasion for humor. Enjoy.</p> |
| 9230 |
</li> |
| 9231 |
</ul> |
| 9232 |
|
| 9233 |
<h3 id="bug_kterm-id"><a name="bug_kterm" id= |
| 9234 |
"bug_kterm">KTERM</a> <a href= |
| 9235 |
"https://www.ibiblio.org/pub/X11/contrib/applications/kterm-6.2.0.tar.gz"> |
| 9236 |
download</a></h3> |
| 9237 |
|
| 9238 |
<p>KTerm stands for "Kanji term" (Japanese). This is based on the |
| 9239 |
X Consortium source, with the same bugs (though the list of |
| 9240 |
original authors has been removed; the modifications that |
| 9241 |
comprise kterm is relatively small).</p> |
| 9242 |
|
| 9243 |
<ul> |
| 9244 |
<li> |
| 9245 |
<p>implements non-bce color model</p> |
| 9246 |
</li> |
| 9247 |
|
| 9248 |
<li> |
| 9249 |
<p>implements status line, but uses non-DEC escape sequences |
| 9250 |
for this.</p> |
| 9251 |
</li> |
| 9252 |
</ul> |
| 9253 |
|
| 9254 |
<p>There is a variation of xvt (ancestor of rxvt) originally |
| 9255 |
known as <a name="bug_kvt" id="bug_kvt"><strong>kvt</strong></a> |
| 9256 |
bundled with <a href="https://kde.org/">KDE</a> which may be |
| 9257 |
referred to as “kterm”, but I do not find it |
| 9258 |
interesting, other than to comment that it was a poor choice of |
| 9259 |
name. For more information:</p> |
| 9260 |
|
| 9261 |
<ul> |
| 9262 |
<li> |
| 9263 |
<p><a href= |
| 9264 |
"https://invent.kde.org/historical/kde1-kdebase/-/tree/master/kvt?ref_type=heads"> |
| 9265 |
Source archive</a> starting in April 1997, which includes |
| 9266 |
rxvt sources.</p> |
| 9267 |
</li> |
| 9268 |
|
| 9269 |
<li> |
| 9270 |
<p>The <a href= |
| 9271 |
"https://invent.kde.org/historical/kde1-kdebase/-/blob/master/kvt/LICENSE.readme?ref_type=heads"> |
| 9272 |
LICENSE.readme</a> file indicates it was from rxvt version |
| 9273 |
2.08, which was released in October 1994.</p> |
| 9274 |
</li> |
| 9275 |
|
| 9276 |
<li> |
| 9277 |
<p>kvt's <a href= |
| 9278 |
"https://invent.kde.org/historical/kde1-kdebase/-/blob/master/kvt/README?ref_type=heads"> |
| 9279 |
README</a> (from <a href= |
| 9280 |
"https://invent.kde.org/historical/kde1-kdebase/-/commits/master/kvt/README?ref_type=heads"> |
| 9281 |
1997</a>) hints that kvt was written by different developers |
| 9282 |
than konsole.</p> |
| 9283 |
</li> |
| 9284 |
</ul> |
| 9285 |
|
| 9286 |
<h3 id="bug_mlterm-id"><a name="bug_mlterm" href= |
| 9287 |
"https://mlterm.sourceforge.net/" id="bug_mlterm">MLTERM</a></h3> |
| 9288 |
|
| 9289 |
<p>Mlterm is not based on xterm or rxvt source, though it |
| 9290 |
implements many of their features. It does fairly well with |
| 9291 |
<a href="/vttest/vttest.html">vttest</a>, except for some odd |
| 9292 |
misbehavior in operations that save/restore the cursor |
| 9293 |
position.</p> |
| 9294 |
|
| 9295 |
<h3 id="bug_mterm-id"><a name="bug_mterm" id= |
| 9296 |
"bug_mterm">MTERM</a></h3> |
| 9297 |
|
| 9298 |
<p>There are a few variants of this: the xterm bundled with some |
| 9299 |
Motif clients is more common. More interesting, however is one |
| 9300 |
(not Motif), attributed to "Der Mouse".</p> |
| 9301 |
|
| 9302 |
<blockquote> |
| 9303 |
<pre class="code-block"> |
| 9304 |
([email protected]) Available: |
| 9305 |
larry.mcrcim.mcgill.edu (132.206.1.1) in |
| 9306 |
/X/mterm.src/mterm.ball-o-wax. |
| 9307 |
</pre> |
| 9308 |
</blockquote> |
| 9309 |
|
| 9310 |
<p>I saw only an incomplete version of this while it was |
| 9311 |
advertised in the mid-90's. It was available by email from |
| 9312 |
<[email protected]>. or via ftp. Since 2010, |
| 9313 |
there is a <a href= |
| 9314 |
"git://git.rodents-montreal.org/Mouse/X/mterm">Git |
| 9315 |
repository</a>. This is not a patched version of xterm, though it |
| 9316 |
was apparently written, like rxvt, to emulate vt100's. While it |
| 9317 |
does have some interesting features (such as blinking |
| 9318 |
characters), overall it does not do as well with <a href= |
| 9319 |
"/vttest/vttest.html">vttest</a> as the more widely known |
| 9320 |
emulators.</p> |
| 9321 |
|
| 9322 |
<h3 id="bug_mxterm-id"><a name="bug_mxterm" id= |
| 9323 |
"bug_mxterm">MXTERM</a></h3> |
| 9324 |
|
| 9325 |
<p>There are several variants on this: xterm adapted for Motif |
| 9326 |
libraries. I have seen none that work properly:</p> |
| 9327 |
|
| 9328 |
<ul> |
| 9329 |
<li> |
| 9330 |
<p><a href= |
| 9331 |
"https://web.archive.org/web/20110202044334/http://www.cmbi.kun.nl/~schaft/mxterm/mxterm.html"> |
| 9332 |
MXTERM: a motif Xterm with character attributes color |
| 9333 |
rendered</a> I've noticed this one only recently. It is a |
| 9334 |
reworking of the earlier patches for color_xterm (credited to |
| 9335 |
Erik Fortune at SGI) and the Motif widgets (apparently first |
| 9336 |
done by Ivan M. Hajadi at SGI in 1991, but credited in this |
| 9337 |
release to Mahesh Neelakanta, for Motif 1.2.4).</p> |
| 9338 |
</li> |
| 9339 |
|
| 9340 |
<li> |
| 9341 |
<a href= |
| 9342 |
"https://www.muquit.com/muquit/software/ansi_xterm/ansi_xterm.html"> |
| 9343 |
ANSI Xterm with Motif Scrollbar</a> Usually seen as the |
| 9344 |
ansi-xterm-R6-motif-sb patch, I used this as the starting |
| 9345 |
point for changes to my #82 patch of xterm in August 1998. |
| 9346 |
<p>The original patch changes only the scrollbars to Motif, |
| 9347 |
leaving the popup menus in Athena widgets. That was not what |
| 9348 |
I wanted. My motivation for using Motif is not for |
| 9349 |
performance or esthetics, of course, but to make it simpler |
| 9350 |
to build on hosts that have no Athena widgets installed.</p> |
| 9351 |
|
| 9352 |
<p>I set those changes aside, having found (the hard way) |
| 9353 |
that the Motif library has hardcoded behavior regarding the |
| 9354 |
control right-mouse button. According to the O'Reilly book on |
| 9355 |
Motif programming (volume 6), it does a server grab when |
| 9356 |
processing menus. Making the menus behave just as in the |
| 9357 |
Athena widgets can cause the X server to hang. (I was able to |
| 9358 |
do this with both Lesstif and Motif libraries). Given that, I |
| 9359 |
decided to restructure the menus entirely, making a toolbar |
| 9360 |
which could support at compile-time either widget set.</p> |
| 9361 |
</li> |
| 9362 |
|
| 9363 |
<li> |
| 9364 |
<p><a href= |
| 9365 |
"https://web.archive.org/web/*/http://www.fh-wilhelmshaven.de/~akcaagaa/index_mxterm.html"> |
| 9366 |
mxterm</a> This is a different reworking of the Motif widget |
| 9367 |
patch, using a 1993 version (ignoring the more recent 1994 |
| 9368 |
patches noted above). However, it appears to have the same |
| 9369 |
technical defect that I noted above.</p> |
| 9370 |
</li> |
| 9371 |
</ul> |
| 9372 |
|
| 9373 |
<h3 id="bug_nxterm-id"><a name="bug_nxterm" id= |
| 9374 |
"bug_nxterm">NXTERM</a></h3> |
| 9375 |
|
| 9376 |
<p>Distributed with Redhat 5.2, it is a repackaging of <a href= |
| 9377 |
"#bug_ansi_xterm">xterm-sb_right-ansi</a>, to use the Xaw3d |
| 9378 |
widget set. This is based on the X Consortium X11R6 source, with |
| 9379 |
the same bugs.</p> |
| 9380 |
|
| 9381 |
<ul> |
| 9382 |
<li> |
| 9383 |
<p>implements non-bce color model</p> |
| 9384 |
</li> |
| 9385 |
|
| 9386 |
<li> |
| 9387 |
<p>does not implement SGR 39 and SGR 49, all attributes are |
| 9388 |
reset when changing colors.</p> |
| 9389 |
</li> |
| 9390 |
|
| 9391 |
<li> |
| 9392 |
<p>popup menus do not appear to work.</p> |
| 9393 |
</li> |
| 9394 |
</ul> |
| 9395 |
|
| 9396 |
<p>Starting with Redhat 6.0, <em>nxterm</em> is the XFree86 3.3.6 |
| 9397 |
xterm. Unfortunately Redhat neglected to update their termcap for |
| 9398 |
nxterm to match the program.</p> |
| 9399 |
|
| 9400 |
<h3 id="bug_rxvt-id"><a name="bug_rxvt" id="bug_rxvt">RXVT</a> |
| 9401 |
<a href= |
| 9402 |
"https://web.archive.org/web/20030206024553/https://www.rxvt.org/"> |
| 9403 |
link</a></h3> |
| 9404 |
|
| 9405 |
<p>Rxvt's manual page states the following unqualified |
| 9406 |
comment:</p> |
| 9407 |
|
| 9408 |
<blockquote class="code-block"> |
| 9409 |
<p>rxvt, version 2.6.2, is a colour vt102 terminal emulator |
| 9410 |
intended as an xterm(1) replacement for users who do not |
| 9411 |
require features such as Tektronix 4014 emulation and |
| 9412 |
toolkit-style configurability. As a result, rxvt uses much less |
| 9413 |
swap space -- a significant advantage on a machine serving many |
| 9414 |
X sessions.</p> |
| 9415 |
</blockquote> |
| 9416 |
|
| 9417 |
<p>How much is <em>much less</em>? Perhaps not as much as one |
| 9418 |
would think from reading that. The Tektronix emulation in xterm |
| 9419 |
(which has been optional since late 1997) accounts for about 25kb |
| 9420 |
of the code.</p> |
| 9421 |
|
| 9422 |
<p>The toolkit-style configurability glibly referenced is the |
| 9423 |
ability to redefine keys on the keyboard without recompiling the |
| 9424 |
program, i.e., the <a href="#how2_fkeys">translations</a> |
| 9425 |
resource. It also is the way mouse events and other actions are |
| 9426 |
passed to xterm.</p> |
| 9427 |
|
| 9428 |
<p>The toolkit-style configurability accounts for about 300kb, |
| 9429 |
which does add up if you happen to be running 50 xterm processes |
| 9430 |
(i.e., about 10Mb).</p> |
| 9431 |
|
| 9432 |
<p>This comment was topical in December 2001:</p> |
| 9433 |
|
| 9434 |
<blockquote class="code-block"> |
| 9435 |
<p>Compared with something like GNOME Terminal, which takes 2-3 |
| 9436 |
times, or KDE konsole, which takes 15-20 times as much memory |
| 9437 |
to run, xterm and rxvt memory requirements are |
| 9438 |
indistinguishable to the normal user.</p> |
| 9439 |
</blockquote> |
| 9440 |
|
| 9441 |
<p id="rxvt_sizes_2010">In June 2010, the numbers had changed |
| 9442 |
somewhat. Here is a table showing the total application and |
| 9443 |
library sizes needed for each of the terminal emulators on my |
| 9444 |
development machine. All sizes are in kb (1024 bytes).</p> |
| 9445 |
|
| 9446 |
<table border="1" summary="Comparing XTerm's size"> |
| 9447 |
<tr> |
| 9448 |
<th>program</th> |
| 9449 |
<th>base size</th> |
| 9450 |
<th>total size</th> |
| 9451 |
<th>libraries</th> |
| 9452 |
</tr> |
| 9453 |
|
| 9454 |
<tr> |
| 9455 |
<td>aterm</td> |
| 9456 |
<td>127</td> |
| 9457 |
<td>10763</td> |
| 9458 |
<td>45</td> |
| 9459 |
</tr> |
| 9460 |
|
| 9461 |
<tr> |
| 9462 |
<td>color_xterm</td> |
| 9463 |
<td>142</td> |
| 9464 |
<td>3647</td> |
| 9465 |
<td>13</td> |
| 9466 |
</tr> |
| 9467 |
|
| 9468 |
<tr> |
| 9469 |
<td>Eterm</td> |
| 9470 |
<td>1</td> |
| 9471 |
<td>5126</td> |
| 9472 |
<td>19</td> |
| 9473 |
</tr> |
| 9474 |
|
| 9475 |
<tr> |
| 9476 |
<td>fbiterm</td> |
| 9477 |
<td>6</td> |
| 9478 |
<td>2424</td> |
| 9479 |
<td>8</td> |
| 9480 |
</tr> |
| 9481 |
|
| 9482 |
<tr> |
| 9483 |
<td>gnome-terminal</td> |
| 9484 |
<td>292</td> |
| 9485 |
<td>14587</td> |
| 9486 |
<td>51</td> |
| 9487 |
</tr> |
| 9488 |
|
| 9489 |
<tr> |
| 9490 |
<td>hpterm</td> |
| 9491 |
<td>146</td> |
| 9492 |
<td>14386</td> |
| 9493 |
<td>31</td> |
| 9494 |
</tr> |
| 9495 |
|
| 9496 |
<tr> |
| 9497 |
<td>konsole</td> |
| 9498 |
<td>2</td> |
| 9499 |
<td>39815</td> |
| 9500 |
<td>71</td> |
| 9501 |
</tr> |
| 9502 |
|
| 9503 |
<tr> |
| 9504 |
<td>kterm</td> |
| 9505 |
<td>226</td> |
| 9506 |
<td>4194</td> |
| 9507 |
<td>17</td> |
| 9508 |
</tr> |
| 9509 |
|
| 9510 |
<tr> |
| 9511 |
<td>mlterm</td> |
| 9512 |
<td>316</td> |
| 9513 |
<td>6606</td> |
| 9514 |
<td>27</td> |
| 9515 |
</tr> |
| 9516 |
|
| 9517 |
<tr> |
| 9518 |
<td>mrxvt</td> |
| 9519 |
<td>298</td> |
| 9520 |
<td>4515</td> |
| 9521 |
<td>19</td> |
| 9522 |
</tr> |
| 9523 |
|
| 9524 |
<tr> |
| 9525 |
<td>multi-aterm</td> |
| 9526 |
<td>144</td> |
| 9527 |
<td>2821</td> |
| 9528 |
<td>7</td> |
| 9529 |
</tr> |
| 9530 |
|
| 9531 |
<tr> |
| 9532 |
<td>pterm</td> |
| 9533 |
<td>405</td> |
| 9534 |
<td>12817</td> |
| 9535 |
<td>42</td> |
| 9536 |
</tr> |
| 9537 |
|
| 9538 |
<tr> |
| 9539 |
<td>rxvt 2.6.4</td> |
| 9540 |
<td>108</td> |
| 9541 |
<td>2725</td> |
| 9542 |
<td>6</td> |
| 9543 |
</tr> |
| 9544 |
|
| 9545 |
<tr> |
| 9546 |
<td>rxvt 2.7.10</td> |
| 9547 |
<td>152</td> |
| 9548 |
<td>2829</td> |
| 9549 |
<td>7</td> |
| 9550 |
</tr> |
| 9551 |
|
| 9552 |
<tr> |
| 9553 |
<td>rxvt-unicode</td> |
| 9554 |
<td>1259</td> |
| 9555 |
<td>13641</td> |
| 9556 |
<td>49</td> |
| 9557 |
</tr> |
| 9558 |
|
| 9559 |
<tr> |
| 9560 |
<td>terminal.app</td> |
| 9561 |
<td>211</td> |
| 9562 |
<td>15274</td> |
| 9563 |
<td>29</td> |
| 9564 |
</tr> |
| 9565 |
|
| 9566 |
<tr> |
| 9567 |
<td>wterm</td> |
| 9568 |
<td>110</td> |
| 9569 |
<td>2922</td> |
| 9570 |
<td>11</td> |
| 9571 |
</tr> |
| 9572 |
|
| 9573 |
<tr> |
| 9574 |
<td>xfce4-terminal</td> |
| 9575 |
<td>148</td> |
| 9576 |
<td>14059</td> |
| 9577 |
<td>48</td> |
| 9578 |
</tr> |
| 9579 |
|
| 9580 |
<tr> |
| 9581 |
<td>xgterm</td> |
| 9582 |
<td>953</td> |
| 9583 |
<td>4602</td> |
| 9584 |
<td>14</td> |
| 9585 |
</tr> |
| 9586 |
|
| 9587 |
<tr> |
| 9588 |
<td>xhpterm</td> |
| 9589 |
<td>130</td> |
| 9590 |
<td>2748</td> |
| 9591 |
<td>6</td> |
| 9592 |
</tr> |
| 9593 |
|
| 9594 |
<tr> |
| 9595 |
<td>xiterm</td> |
| 9596 |
<td>12</td> |
| 9597 |
<td>3762</td> |
| 9598 |
<td>16</td> |
| 9599 |
</tr> |
| 9600 |
|
| 9601 |
<tr> |
| 9602 |
<td>xterm (everything)</td> |
| 9603 |
<td>346</td> |
| 9604 |
<td>5484</td> |
| 9605 |
<td>24</td> |
| 9606 |
</tr> |
| 9607 |
|
| 9608 |
<tr> |
| 9609 |
<td>xterm (minimal)</td> |
| 9610 |
<td>186</td> |
| 9611 |
<td>4123</td> |
| 9612 |
<td>15</td> |
| 9613 |
</tr> |
| 9614 |
|
| 9615 |
<tr> |
| 9616 |
<td>xterm-r5</td> |
| 9617 |
<td>135</td> |
| 9618 |
<td>4164</td> |
| 9619 |
<td>11</td> |
| 9620 |
</tr> |
| 9621 |
|
| 9622 |
<tr> |
| 9623 |
<td>xterm-r6</td> |
| 9624 |
<td>140</td> |
| 9625 |
<td>4169</td> |
| 9626 |
<td>11</td> |
| 9627 |
</tr> |
| 9628 |
</table> |
| 9629 |
|
| 9630 |
<p>Counting the libraries is appropriate, since some programs |
| 9631 |
such as xiterm and the VTE-based programs are implemented in |
| 9632 |
libraries.</p> |
| 9633 |
|
| 9634 |
<p>These comments apply to versions of <em>rxvt</em> through |
| 9635 |
2.21:</p> |
| 9636 |
|
| 9637 |
<ul> |
| 9638 |
<li> |
| 9639 |
<p>clearing the screen resets colors</p> |
| 9640 |
</li> |
| 9641 |
|
| 9642 |
<li> |
| 9643 |
<p>does not have a delete key</p> |
| 9644 |
</li> |
| 9645 |
|
| 9646 |
<li> |
| 9647 |
<p>the implementation of <code>ech</code> (erase characters) |
| 9648 |
does not follow DEC VT220 (also ISO 6429), causing |
| 9649 |
applications using this function to misbehave.</p> |
| 9650 |
</li> |
| 9651 |
</ul> |
| 9652 |
|
| 9653 |
<p>A newer version (upgraded to an beta as of 2.6.PRE3, however, |
| 9654 |
since it no longer dumps core in <a href= |
| 9655 |
"/vttest/vttest.html">vttest</a>) is reported to fix the |
| 9656 |
<code>ech</code> bug. However, it is less VT100-compatible than |
| 9657 |
the earlier versions such as 2.21b because it does not render |
| 9658 |
reverse video (<code>DECSCNM</code>) properly. All versions do |
| 9659 |
not update the screen frequently enough, making animation |
| 9660 |
ineffective. See <a href="/vttest/vttest.html">vttest</a>, tests |
| 9661 |
1 and 2.</p> |
| 9662 |
|
| 9663 |
<p>One longstanding issue with rxvt impacts use of xterm. While |
| 9664 |
rxvt does not use the X Toolkit (and corresponding X resource |
| 9665 |
matching), it does read your <code>.Xdefaults</code> and |
| 9666 |
app-defaults files to extract resource settings. That in itself |
| 9667 |
would not be a problem. However, since rxvt also looks for |
| 9668 |
resources in the <code>XTerm</code> class (a parasitic |
| 9669 |
relationship like setting $TERM to “xterm” based on |
| 9670 |
the presumption that it is a nuisance to install its |
| 9671 |
configuration files), there have been several occasions on which |
| 9672 |
xterm's app-defaults files have been modified to accommodate |
| 9673 |
rxvt's variant usage.</p> |
| 9674 |
|
| 9675 |
<p>That comment applies mainly to the resource |
| 9676 |
<strong>patterns</strong>. However, even when the pattern is |
| 9677 |
reasonably unambiguous, but overbroad, the results can be |
| 9678 |
conflicting. For example, some versions of rxvt may accept a |
| 9679 |
<code>font</code> resource which does not match the XLFD pattern. |
| 9680 |
It accepts a prefix of "xft:". This feature (apparently |
| 9681 |
introduced by <a href="#bug_konsole">konsole</a>) tells rxvt to |
| 9682 |
interpret the remainder of the string as a TrueType (Xft) font |
| 9683 |
rather than a bitmap font. xterm uses the <code>faceName</code> |
| 9684 |
resource for these values.</p> |
| 9685 |
|
| 9686 |
<p>Since 2003, <a href= |
| 9687 |
"/ncurses/ncurses-urxvt.html">rxvt-unicode</a> has supplanted |
| 9688 |
rxvt, but has the same comment:</p> |
| 9689 |
|
| 9690 |
<blockquote> |
| 9691 |
<p class="code-block">rxvt-unicode, version 9.31, is a colour |
| 9692 |
vt102 terminal emulator intended as an xterm(1) replacement for |
| 9693 |
users who do not require features such as Tektronix 4014 |
| 9694 |
emulation and toolkit-style configurability. As a result, |
| 9695 |
rxvt-unicode uses much less swap space -- a significant |
| 9696 |
advantage on a machine serving many X sessions.</p> |
| 9697 |
</blockquote> |
| 9698 |
|
| 9699 |
<h3 id="bug_st-id">st <a name="bug_st" href= |
| 9700 |
"https://st.suckless.org" id="bug_st">link</a></h3> |
| 9701 |
|
| 9702 |
<p>Rxvt revisited, this program originally depended only on the |
| 9703 |
X11 library. Since then, it has grown a lot, though the project |
| 9704 |
page does not mention it. As of January 2013, it was in heavy |
| 9705 |
development, and (according to comments on its developer's list) |
| 9706 |
growing steadily as the developers implemented useful features |
| 9707 |
adapted from xterm.</p> |
| 9708 |
|
| 9709 |
<p>For instance, in 2013, the size counting libraries for st 0.3 |
| 9710 |
on my Debian testing machine was on a par with rxvt (and half |
| 9711 |
that of xterm, which uses the <a href="xtoolkit/">X Toolkit |
| 9712 |
library</a>). Revisiting it late in 2015, it had left rxvt behind |
| 9713 |
and was nearly as large as xterm. Here are the sizes which I |
| 9714 |
found in Fedora 22:</p> |
| 9715 |
|
| 9716 |
<table summary="ldd-size-fedora22" border="1"> |
| 9717 |
<tr> |
| 9718 |
<th>LDD-Size</th> |
| 9719 |
<th>Program</th> |
| 9720 |
</tr> |
| 9721 |
|
| 9722 |
<tr> |
| 9723 |
<td align="right" style="font-family: monospace;"> |
| 9724 |
3452986</td> |
| 9725 |
<td>rxvt</td> |
| 9726 |
</tr> |
| 9727 |
|
| 9728 |
<tr> |
| 9729 |
<td align="right" style="font-family: monospace;"> |
| 9730 |
<em>6060960</em> |
| 9731 |
</td> |
| 9732 |
<td>st</td> |
| 9733 |
</tr> |
| 9734 |
|
| 9735 |
<tr> |
| 9736 |
<td align="right" style="font-family: monospace;"> |
| 9737 |
6771039</td> |
| 9738 |
<td>mrxvt</td> |
| 9739 |
</tr> |
| 9740 |
|
| 9741 |
<tr> |
| 9742 |
<td align="right" style="font-family: monospace;"> |
| 9743 |
<em>7785780</em> |
| 9744 |
</td> |
| 9745 |
<td>xterm</td> |
| 9746 |
</tr> |
| 9747 |
|
| 9748 |
<tr> |
| 9749 |
<td align="right" style="font-family: monospace;"> |
| 9750 |
15060195</td> |
| 9751 |
<td>urxvt</td> |
| 9752 |
</tr> |
| 9753 |
|
| 9754 |
<tr> |
| 9755 |
<td align="right" style="font-family: monospace;"> |
| 9756 |
20934874</td> |
| 9757 |
<td>lxterminal</td> |
| 9758 |
</tr> |
| 9759 |
|
| 9760 |
<tr> |
| 9761 |
<td align="right" style="font-family: monospace;"> |
| 9762 |
21089908</td> |
| 9763 |
<td>lilyterm</td> |
| 9764 |
</tr> |
| 9765 |
|
| 9766 |
<tr> |
| 9767 |
<td align="right" style="font-family: monospace;"> |
| 9768 |
21358156</td> |
| 9769 |
<td>xfce4-terminal</td> |
| 9770 |
</tr> |
| 9771 |
|
| 9772 |
<tr> |
| 9773 |
<td align="right" style="font-family: monospace;"> |
| 9774 |
25738679</td> |
| 9775 |
<td>roxterm</td> |
| 9776 |
</tr> |
| 9777 |
|
| 9778 |
<tr> |
| 9779 |
<td align="right" style="font-family: monospace;"> |
| 9780 |
31195794</td> |
| 9781 |
<td>gnome-terminal</td> |
| 9782 |
</tr> |
| 9783 |
|
| 9784 |
<tr> |
| 9785 |
<td align="right" style="font-family: monospace;"> |
| 9786 |
32780414</td> |
| 9787 |
<td>terminology</td> |
| 9788 |
</tr> |
| 9789 |
|
| 9790 |
<tr> |
| 9791 |
<td align="right" style="font-family: monospace;"> |
| 9792 |
87813125</td> |
| 9793 |
<td>konsole</td> |
| 9794 |
</tr> |
| 9795 |
</table> |
| 9796 |
|
| 9797 |
<p>By the way, the project page quotes the <a href= |
| 9798 |
"https://github.com/ThomasDickey/xterm-snapshots/blob/master/README"> |
| 9799 |
README</a> file from xterm's sources, omitting my editorial |
| 9800 |
comment at the top noting that the <a href= |
| 9801 |
"https://www.phrases.org.uk/meanings/abandon-all-hope-ye-who-enter-here.html"> |
| 9802 |
paraphrase</a> of the opening from Dante's <em>Inferno</em> dated |
| 9803 |
from 1991, and pointing to this FAQ to provide better |
| 9804 |
context.</p> |
| 9805 |
|
| 9806 |
<h3 id="bug_xgterm-id"><a name="bug_xgterm" id= |
| 9807 |
"bug_xgterm">XGTERM</a> <a href= |
| 9808 |
"https://iraf-community.github.io/x11iraf.html">link</a></h3> |
| 9809 |
|
| 9810 |
<p>It has some features which are also in color_xterm:(non-bce |
| 9811 |
ANSI color, colorBD and colorUL resources, cursor warping, etc. |
| 9812 |
The main feature is its Tektronix graphics emulation, which is |
| 9813 |
the main reason for this particular program. Neither program has |
| 9814 |
a change-log, so it is not easy to say which influenced the |
| 9815 |
other.</p> |
| 9816 |
|
| 9817 |
<p>That is from reading the source code. However testing under |
| 9818 |
Debian, something is wrong with the resource processing (neither |
| 9819 |
popup menus nor colors work).</p> |
| 9820 |
|
| 9821 |
<p>As of March 2022, Debian's <a href= |
| 9822 |
"https://packages.debian.org/challenge.html?original=%2fsearch%3fkeywords%3dxgterm"> |
| 9823 |
xgterm</a> package does not install the terminal description |
| 9824 |
which the IRAF developer provided. That was just an alias for |
| 9825 |
xterm-r5, which still needs some work. If the |
| 9826 |
“xgterm” terminal description is missing, xgterm |
| 9827 |
falls back to “xterm” which is not a close match. To |
| 9828 |
address this problem, ncurses provides a workable <a href= |
| 9829 |
"/ncurses/terminfo.src.html#tic-xgterm">xgterm</a> terminal |
| 9830 |
description.</p> |
| 9831 |
|
| 9832 |
<h3 id="bug_xiterm-id"><a name="bug_xiterm" id= |
| 9833 |
"bug_xiterm">XITERM</a> <a href= |
| 9834 |
"https://www.ibiblio.org/pub/linux/X11/terms/!INDEX.html">link</a></h3> |
| 9835 |
|
| 9836 |
<p>This appears to be rxvt 2.20, lightly reformatted, with a few |
| 9837 |
ifdef's changed.</p> |
| 9838 |
|
| 9839 |
<p>That is, it was. The name was later appropriated by a |
| 9840 |
different <a href= |
| 9841 |
"https://web.archive.org/web/*/http://oss.software.ibm.com/linux/projects/iterm/"> |
| 9842 |
program</a>, which also uses the name <code>iterm</code>. Like |
| 9843 |
gnome-terminal, iterm aims to be an xterm-emulator rather than a |
| 9844 |
VT102- or VT220-emulator.</p> |
| 9845 |
|
| 9846 |
<p>An earlier <a href= |
| 9847 |
"https://web.archive.org/web/*/http://www.openi18n.org">attempt</a> |
| 9848 |
by the same author (the "CSI-xterm") incorporated in 2002 some of |
| 9849 |
the changes I made for XFree86 xterm via cut and paste (but does |
| 9850 |
not mention this in its README). The “borrowed” |
| 9851 |
changes comprised about 10% of the patch provided for X11R6.5.1, |
| 9852 |
summarized here:</p> |
| 9853 |
|
| 9854 |
<blockquote> |
| 9855 |
<pre class="code-block"> |
| 9856 |
xterm-6.5.1-i18n-0.7.patch.gz |
| 9857 |
Imakefile | 25 + |
| 9858 |
RELNOTES-I18N | 104 ++++++ |
| 9859 |
XTerm.ad | 1 |
| 9860 |
button.c | 155 ++++++++- |
| 9861 |
charproc.c | 979 ++++++++++++++++++++++++++++++++++++++++++++++++++++------ |
| 9862 |
data.c | 6 |
| 9863 |
data.h | 4 |
| 9864 |
error.h | 8 |
| 9865 |
fontutils.c | 78 ++++ |
| 9866 |
fontutils.h | 8 |
| 9867 |
input.c | 11 |
| 9868 |
main.c | 40 +- |
| 9869 |
main.h | 1 |
| 9870 |
misc.c | 46 ++ |
| 9871 |
ptyx.h | 156 ++++++++- |
| 9872 |
screen.c | 513 +++++++++++++++++++++++++++--- |
| 9873 |
scrollbar.c | 36 +- |
| 9874 |
util.c | 218 +++++++++++- |
| 9875 |
18 files changed, 2183 insertions(+), 206 deletions(-) |
| 9876 |
</pre> |
| 9877 |
</blockquote> |
| 9878 |
|
| 9879 |
<p>This patch was said to be the basis for Solaris 10 xterm, and |
| 9880 |
was briefly referred to as the Solaris "color xterm". It did not |
| 9881 |
use the <code>bce</code> color model however, and Sun provided no |
| 9882 |
terminal description for it.</p> |
| 9883 |
|
| 9884 |
<p>Back to <em>iterm</em>: the author's README in the patch used |
| 9885 |
the same terminology as in the later work, demonstrating their |
| 9886 |
relationship:</p> |
| 9887 |
|
| 9888 |
<blockquote> |
| 9889 |
<pre class="code-block"> |
| 9890 |
This is a patch for the xterm of X11 release 6.5.1 to fix its |
| 9891 |
internationalization defects. This patch enables xterm to handle |
| 9892 |
whatever the character set encodings and scripts support underlining |
| 9893 |
operating system supports via the technology called CSI(Code Set |
| 9894 |
Independence) and XOM(X Output Method). Traditionally, several |
| 9895 |
X terminal emulators which are hard-wired to specific languages and |
| 9896 |
encodings were introduced to support local language requirements, such |
| 9897 |
as kterm, hanterm, cxterm, UTF-8 xterm and so on. This truly |
| 9898 |
internationalized terminal emulator supersedes the needs of those |
| 9899 |
multiple locale specific terminalemulators. |
| 9900 |
</pre> |
| 9901 |
</blockquote> |
| 9902 |
|
| 9903 |
<p>The key to understanding the "code set independence" is that |
| 9904 |
the author intended to treat existing character encodings on an |
| 9905 |
equal basis with Unicode and UTF-8. Some of that is reflected in |
| 9906 |
the Solaris <em><a href= |
| 9907 |
"https://docs.oracle.com/cd/E19253-01/817-2521/os-1208/index.html"> |
| 9908 |
International Language Environments Guide</a></em>, but in |
| 9909 |
explaining <em>how</em> this is done, the documentation is weak, |
| 9910 |
lacking detail.</p> |
| 9911 |
|
| 9912 |
<p>Either version of <em>iterm</em> has similar problems running |
| 9913 |
<a href="/vttest/vttest.html">vttest</a>.</p> |
| 9914 |
|
| 9915 |
<h2 id="building_it-id"><a name="building_it" id= |
| 9916 |
"building_it">How do I build <strong>XTerm</strong>?</a></h2> |
| 9917 |
|
| 9918 |
<p>Building a copy of xterm is simple, provided that you have a |
| 9919 |
development configuration for X11:</p> |
| 9920 |
|
| 9921 |
<ul> |
| 9922 |
<li> |
| 9923 |
<p>Header files and libraries. If you do not have the header |
| 9924 |
files (usually under /usr/include/X11) for your system, you |
| 9925 |
are better off building the libraries yourself. Xterm can be |
| 9926 |
built with either X11R5 or X11R6 libraries; however X11R6 |
| 9927 |
requires much more data to be installed before xterm will |
| 9928 |
run. Xterm uses the <code>Xaw</code> library for popup |
| 9929 |
menus.</p> |
| 9930 |
</li> |
| 9931 |
|
| 9932 |
<li> |
| 9933 |
<p>imake and <code>xmkmf</code>. These utilities produce a |
| 9934 |
Makefile from the Imakefile. They are not essential, but |
| 9935 |
useful, particularly on systems with unusual |
| 9936 |
configurations.</p> |
| 9937 |
</li> |
| 9938 |
</ul> |
| 9939 |
|
| 9940 |
<p>If you have a working <code>xmkmf</code> script (or correctly |
| 9941 |
configured imake utility), all you need to do is type</p> |
| 9942 |
|
| 9943 |
<blockquote> |
| 9944 |
<pre class="code-block"> |
| 9945 |
xmkmf |
| 9946 |
make |
| 9947 |
</pre> |
| 9948 |
</blockquote> |
| 9949 |
|
| 9950 |
<p>I have written a <em>configure</em> script for xterm which can |
| 9951 |
use <code>imake</code> (or <code>xmkmf</code>) to generate a |
| 9952 |
Makefile from the Makefile.in. Or it can do without |
| 9953 |
<code>imake</code> entirely. I have restructured xterm to |
| 9954 |
eliminate most hardcoded <code>#ifdef</code>'s, replacing them |
| 9955 |
with definitions that can be derived with the configuration |
| 9956 |
script. The <em>configure</em> script is more flexible than |
| 9957 |
<em>xmkmf</em>, since it allows you to enable or disable a |
| 9958 |
variety of features. Type</p> |
| 9959 |
|
| 9960 |
<blockquote> |
| 9961 |
<pre class="code-block"> |
| 9962 |
configure --help |
| 9963 |
</pre> |
| 9964 |
</blockquote> |
| 9965 |
|
| 9966 |
<p>to get a list of options.</p> |
| 9967 |
|
| 9968 |
<p>Though I have replaced most hardcoded ifdef's with |
| 9969 |
autoconfigured values, it will still continue to build properly |
| 9970 |
with the imake environment.</p> |
| 9971 |
|
| 9972 |
<p>However, I usually build xterm using the configure script. By |
| 9973 |
default, it looks for imake and will use it to help with a few |
| 9974 |
places where a reliable configure check cannot be created. One of |
| 9975 |
these (see <a href="#narrowproto">Why doesn't the scrollbar |
| 9976 |
work?</a>) can be a problem.</p> |
| 9977 |
|
| 9978 |
<p>As with all of my projects, I routinely check for strict |
| 9979 |
compiler warnings. For gcc, that is done with the "gcc-stricter" |
| 9980 |
script which you can find <a href= |
| 9981 |
"/scripts/readme.html">here</a>. The X libraries had a |
| 9982 |
longstanding issue which had been ignored (as of mid-2012). To |
| 9983 |
work around this (and get useful warnings), I applied this |
| 9984 |
patch:</p> |
| 9985 |
|
| 9986 |
<blockquote> |
| 9987 |
<pre class="code-block"> |
| 9988 |
--- Intrinsic.h.orig 2009-08-25 13:22:15.000000000 -0400 |
| 9989 |
+++ Intrinsic.h 2009-12-06 09:48:39.000000000 -0500 |
| 9990 |
@@ -66,7 +66,11 @@ |
| 9991 |
|
| 9992 |
#define XtSpecificationRelease 6 |
| 9993 |
|
| 9994 |
+#ifdef _CONST_X_STRING |
| 9995 |
+typedef const char *String; |
| 9996 |
+#else |
| 9997 |
typedef char *String; |
| 9998 |
+#endif |
| 9999 |
|
| 10000 |
/* We do this in order to get "const" declarations to work right. We |
| 10001 |
* use _XtString instead of String so that C++ applications can |
| 10002 |
--- Xresource.h.orig 2009-07-19 14:43:21.000000000 -0400 |
| 10003 |
+++ Xresource.h 2009-12-06 10:11:19.000000000 -0500 |
| 10004 |
@@ -338,8 +338,8 @@ |
| 10005 |
} XrmOptionKind; |
| 10006 |
|
| 10007 |
typedef struct { |
| 10008 |
- char *option; /* Option abbreviation in argv */ |
| 10009 |
- char *specifier; /* Resource specifier */ |
| 10010 |
+ _Xconst char *option; /* Option abbreviation in argv */ |
| 10011 |
+ _Xconst char *specifier; /* Resource specifier */ |
| 10012 |
XrmOptionKind argKind; /* Which style of option it is */ |
| 10013 |
XPointer value; /* Value to provide if XrmoptionNoArg */ |
| 10014 |
} XrmOptionDescRec, *XrmOptionDescList; |
| 10015 |
</pre> |
| 10016 |
</blockquote> |
| 10017 |
|
| 10018 |
<p>I made note of it on the Xorg <a href= |
| 10019 |
"https://lists.x.org/archives/xorg-devel/2010-May/009052.html">mailing |
| 10020 |
list</a>, but as you can see, there was no response.</p> |
| 10021 |
|
| 10022 |
<p>Finally, I spent the requisitve time to integrate the |
| 10023 |
change—and complete the process of transforming the |
| 10024 |
<a href="xtoolkit/"><em>X Toolkit</em></a> documentation from |
| 10025 |
nroff to docbook/xml.</p> |
| 10026 |
|
| 10027 |
<h2 id="report_bugs-id"><a name="report_bugs" id= |
| 10028 |
"report_bugs">How do I report bugs?</a></h2> |
| 10029 |
|
| 10030 |
<p>You should report bugs to <a href= |
| 10031 |
"mailto:[email protected]">me</a>. I also respond to |
| 10032 |
bug reports in a number of bug-tracking systems, though some are |
| 10033 |
less open to searches than others. See also:</p> |
| 10034 |
|
| 10035 |
<ul> |
| 10036 |
<li> |
| 10037 |
<p><a href= |
| 10038 |
"/personal/bug-reports.html">reporting/patching</a> |
| 10039 |
procedures.</p> |
| 10040 |
</li> |
| 10041 |
|
| 10042 |
<li> |
| 10043 |
<p><a href="/scripts/readme.html">analyzing problems with |
| 10044 |
configure scripts</a></p> |
| 10045 |
</li> |
| 10046 |
</ul> |
| 10047 |
|
| 10048 |
<h2 id="more_info-id"><a name="more_info" id= |
| 10049 |
"more_info">Additional Information</a></h2> |
| 10050 |
|
| 10051 |
<p>There appears to be no comprehensive source of information on |
| 10052 |
xterm better than the documentation which comes with the source |
| 10053 |
code</p> |
| 10054 |
|
| 10055 |
<ul> |
| 10056 |
<li> |
| 10057 |
<a href="/xterm/xterm.log.html">XTerm change log</a> |
| 10058 |
<ul> |
| 10059 |
<li> |
| 10060 |
<p><a href="#xterm_man">The XTerm Manual</a></p> |
| 10061 |
</li> |
| 10062 |
|
| 10063 |
<li> |
| 10064 |
<p><a href="#ctlseqs_ms">XTerm Control Sequences</a></p> |
| 10065 |
</li> |
| 10066 |
|
| 10067 |
<li> |
| 10068 |
<p><a href="#resize_man">resize</a> – set TERMCAP |
| 10069 |
and terminal settings to current xterm window size</p> |
| 10070 |
</li> |
| 10071 |
|
| 10072 |
<li> |
| 10073 |
<p><a href="#uxterm_man">uxterm</a> – a UTF-8 |
| 10074 |
wrapper for XTerm</p> |
| 10075 |
</li> |
| 10076 |
|
| 10077 |
<li> |
| 10078 |
<p><a href="#koi8rxterm_man">koi8rxterm</a> – a |
| 10079 |
KOI8-R wrapper for XTerm</p> |
| 10080 |
</li> |
| 10081 |
|
| 10082 |
<li> |
| 10083 |
<p><a href="#luit_prog">luit</a> – Locale and ISO |
| 10084 |
2022 support for Unicode terminals</p> |
| 10085 |
</li> |
| 10086 |
</ul> |
| 10087 |
</li> |
| 10088 |
|
| 10089 |
<li> |
| 10090 |
<p><a href="#other_sites">Other Sites</a></p> |
| 10091 |
</li> |
| 10092 |
|
| 10093 |
<li> |
| 10094 |
<p><a href="#ref_misleading">Interesting but misleading</a></p> |
| 10095 |
</li> |
| 10096 |
</ul> |
| 10097 |
|
| 10098 |
<h4 id="xterm_man-id"><a name="xterm_man" id="xterm_man">The |
| 10099 |
XTerm Manual</a></h4> |
| 10100 |
|
| 10101 |
<p>The command-line options, X resources and similar configurable |
| 10102 |
options of xterm are documented in the manual page.</p> |
| 10103 |
|
| 10104 |
<p>Here are copies of the file in various forms: <a href= |
| 10105 |
"/xterm/manpage/xterm.html">html</a>, <a href= |
| 10106 |
"/xterm/manpage/xterm.pdf">pdf</a>, <a href= |
| 10107 |
"/xterm/manpage/xterm.ps">ps</a> and <a href= |
| 10108 |
"/xterm/manpage/xterm.txt">text</a>.</p> |
| 10109 |
|
| 10110 |
<h4 id="ctlseqs_ms-id"><a name="ctlseqs_ms" id="ctlseqs_ms">Xterm |
| 10111 |
Control Sequences</a></h4> |
| 10112 |
|
| 10113 |
<p>Control sequences, i.e., programming information are in the |
| 10114 |
<code>ctlseqs.ms</code> file which I bundle with the <a href= |
| 10115 |
"xterm.faq.html#latest_version">program source</a>. (It used to |
| 10116 |
be in the same directory in the X distribution, but was moved to |
| 10117 |
a different part of the tree long ago). Note that you must format |
| 10118 |
this file with different options than a manpage, e.g.,</p> |
| 10119 |
|
| 10120 |
<blockquote> |
| 10121 |
<pre class="code-block"> |
| 10122 |
tbl ctlseqs.ms | nroff -ms >ctlseqs.txt |
| 10123 |
tbl ctlseqs.ms | groff -ms >ctlseqs.ps |
| 10124 |
</pre> |
| 10125 |
</blockquote> |
| 10126 |
|
| 10127 |
<p>As a PostScript or PDF file, the individual letters of the |
| 10128 |
control sequences are all boxed, for emphasis, but I find the |
| 10129 |
text file equally readable.</p> |
| 10130 |
|
| 10131 |
<p>Here are copies of the file in various forms: <a href= |
| 10132 |
"ctlseqs/ctlseqs.html">html</a>, <a href= |
| 10133 |
"ctlseqs/ctlseqs.pdf">pdf</a>, <a href= |
| 10134 |
"ctlseqs/ctlseqs.ps">ps</a> and <a href= |
| 10135 |
"ctlseqs/ctlseqs.txt">text</a>.</p> |
| 10136 |
|
| 10137 |
<h4 id="resize_man-id"><a name="resize_man" id= |
| 10138 |
"resize_man">resize – set TERMCAP and terminal settings to |
| 10139 |
current xterm window size</a></h4> |
| 10140 |
|
| 10141 |
<p><em>resize</em> is useful by itself, but is maintained for |
| 10142 |
historical reasons as part of xterm. <a href= |
| 10143 |
"/xterm/manpage/resize.html">html</a>, <a href= |
| 10144 |
"/xterm/manpage/resize.pdf">pdf</a>, <a href= |
| 10145 |
"/xterm/manpage/resize.ps">ps</a> and <a href= |
| 10146 |
"/xterm/manpage/resize.txt">text</a>.</p> |
| 10147 |
|
| 10148 |
<h4 id="uxterm_man-id"><a name="uxterm_man" id= |
| 10149 |
"uxterm_man">uxterm – a UTF-8 wrapper for xterm</a></h4> |
| 10150 |
|
| 10151 |
<p>XTerm does not automatically <em>set</em> your locale. It can |
| 10152 |
be told to <em>use</em> your locale settings. This is a shell |
| 10153 |
script which sets xterm's resources to use UTF-8 encoding, and |
| 10154 |
use UTF-8 fonts. There is a similar <em>lxterm</em> script, but |
| 10155 |
it relies upon non-portable applications, unlike uxterm.</p> |
| 10156 |
|
| 10157 |
<p>Here are copies of uxterm's documentation: <a href= |
| 10158 |
"/xterm/manpage/uxterm.html">html</a>, <a href= |
| 10159 |
"/xterm/manpage/uxterm.pdf">pdf</a>, <a href= |
| 10160 |
"/xterm/manpage/uxterm.ps">ps</a> and <a href= |
| 10161 |
"/xterm/manpage/uxterm.txt">text</a>.</p> |
| 10162 |
|
| 10163 |
<p>Incidentally, there was a different program named |
| 10164 |
“uxterm” before the shell script was added to xterm |
| 10165 |
in <a href="xterm.log.html#xterm_137">mid-2000</a>. <a href= |
| 10166 |
"https://web.archive.org/web/20130328091052/http://czyborra.com/unicode/terminals.html"> |
| 10167 |
Roman Czyborra commented</a> in 1998 that it was based on the |
| 10168 |
original X11 xterm source (very likely, since |
| 10169 |
“strings” run on the executable shows the xterm |
| 10170 |
actions, resources and even the Tek4014 support). There are few |
| 10171 |
references to it to provide details: the first appearance was in |
| 10172 |
<a href= |
| 10173 |
"https://www.unicode.org/mail-arch/unicode-ml/Archives-Old/UML001/0042.html"> |
| 10174 |
1994</a>, and the last was Czyborra's page in 1998. For the |
| 10175 |
curious, there is a copy on <a href= |
| 10176 |
"https://www.ibiblio.org/pub/packages/ccic/software/x-win/uxterm/uxterm.README"> |
| 10177 |
ibiblio.org</a> (no Linux executables, no source, however).</p> |
| 10178 |
|
| 10179 |
<h4 id="koi8rxterm_man-id"><a name="koi8rxterm_man" id= |
| 10180 |
"koi8rxterm_man">koi8rxterm – a KOI8-R wrapper for |
| 10181 |
xterm</a></h4> |
| 10182 |
|
| 10183 |
<p>As a special case, this wrapper is packaged with xterm to |
| 10184 |
provide KOI8-R encoding.</p> |
| 10185 |
|
| 10186 |
<p>Here are copies of koi8rxterm's documentation: <a href= |
| 10187 |
"/xterm/manpage/koi8rxterm.html">html</a>, <a href= |
| 10188 |
"/xterm/manpage/koi8rxterm.pdf">pdf</a>, <a href= |
| 10189 |
"/xterm/manpage/koi8rxterm.ps">ps</a> and <a href= |
| 10190 |
"/xterm/manpage/koi8rxterm.txt">text</a>.</p> |
| 10191 |
|
| 10192 |
<h4 id="luit_prog-id"><a name="luit_prog" id="luit_prog">luit |
| 10193 |
– Locale and ISO 2022 support for Unicode terminals</a></h4> |
| 10194 |
|
| 10195 |
<p><a href="/luit/luit.html">luit</a> also is maintained as part |
| 10196 |
of xterm, since its original developer is inactive, and the |
| 10197 |
ostensible Xorg maintainers more than once delivered unusable |
| 10198 |
versions, causing many bug reports to be issued against |
| 10199 |
xterm.</p> |
| 10200 |
|
| 10201 |
<h3 id="other_sites-id"><a name="other_sites" id= |
| 10202 |
"other_sites">Other Sites</a></h3> |
| 10203 |
|
| 10204 |
<ul> |
| 10205 |
<li> |
| 10206 |
<p>I have found Richard Shuford's archive to be invaluable |
| 10207 |
for notes on the DEC VT220 and related terminals. This was a |
| 10208 |
webpage:</p> |
| 10209 |
|
| 10210 |
<blockquote> |
| 10211 |
<pre class="code-block"> |
| 10212 |
http://web.eecs.utk.edu/~shuford/terminal_index.html |
| 10213 |
</pre> |
| 10214 |
</blockquote> |
| 10215 |
|
| 10216 |
<p>but was last seen via ftp:</p> |
| 10217 |
|
| 10218 |
<blockquote> |
| 10219 |
<pre class="code-block"> |
| 10220 |
ftp://cs.utk.edu/pub/shuford/ |
| 10221 |
</pre> |
| 10222 |
</blockquote> |
| 10223 |
|
| 10224 |
<p>I have a snapshot of the ftp site, here:</p> |
| 10225 |
|
| 10226 |
<ul> |
| 10227 |
<li> |
| 10228 |
<p><a href= |
| 10229 |
"https://shuford.invisible-island.net">https://shuford.invisible-island.net/</a></p> |
| 10230 |
</li> |
| 10231 |
|
| 10232 |
<li> |
| 10233 |
<p><a href= |
| 10234 |
"https://shuford.invisible-mirror.net/">https://shuford.invisible-mirror.net</a></p> |
| 10235 |
</li> |
| 10236 |
</ul> |
| 10237 |
</li> |
| 10238 |
|
| 10239 |
<li> |
| 10240 |
<p>Though not available at the time that I was collecting |
| 10241 |
most of my notes, <a href="https://vt100.net">VT100.net</a> |
| 10242 |
is also a good source of primary information.</p> |
| 10243 |
</li> |
| 10244 |
|
| 10245 |
<li> |
| 10246 |
<p>As part of my <a href="/personal/git-exports.html"><em>Git |
| 10247 |
exports</em></a> work in 2016, I made a repository of the |
| 10248 |
major X release copies of <a href= |
| 10249 |
"https://github.com/ThomasDickey/old-xterm">xterm source</a>. |
| 10250 |
Alan Coopersmith has a more extensive repository of the |
| 10251 |
<a href= |
| 10252 |
"https://cgit.freedesktop.org/~alanc/xc-historical/log/">X |
| 10253 |
source</a>, which is also useful although it does not cover |
| 10254 |
the full timespan. In my repository, I combined the |
| 10255 |
controls-sequences document which was in <em>specs</em> with |
| 10256 |
the program:</p> |
| 10257 |
|
| 10258 |
<ul> |
| 10259 |
<li> |
| 10260 |
<p>xterm was first released in X10R3, with a manual page |
| 10261 |
in the <code>man</code> directory, and program in the |
| 10262 |
<code>xterm</code> directory.</p> |
| 10263 |
</li> |
| 10264 |
|
| 10265 |
<li> |
| 10266 |
<p>The developers (re)organized the directory tree in |
| 10267 |
X11, moving some manual pages under the <code>doc</code> |
| 10268 |
tree, others went along with the source-code, and moving |
| 10269 |
the programs such as xterm under a <code>clients</code> |
| 10270 |
directory.</p> |
| 10271 |
</li> |
| 10272 |
|
| 10273 |
<li> |
| 10274 |
<p>The control-sequences document was first released in |
| 10275 |
X11R4.</p> |
| 10276 |
</li> |
| 10277 |
|
| 10278 |
<li> |
| 10279 |
<p>When making the repository, I overlooked the X10 |
| 10280 |
manual page. Git isn't flexible enough to add that later, |
| 10281 |
without re-creating the repository.</p> |
| 10282 |
</li> |
| 10283 |
</ul> |
| 10284 |
|
| 10285 |
<p>I use RCS as a starting point for creating Git |
| 10286 |
repositories because it is the simplest way to capture each |
| 10287 |
file's timestamp. Since the X developers switched source |
| 10288 |
repositories between X10 and X11, and the RCS identifiers |
| 10289 |
were no longer in sequence, I used a script to change those |
| 10290 |
identifiers to a form that would not interfere with checking |
| 10291 |
the sources into RCS.</p> |
| 10292 |
|
| 10293 |
<p>The dates shown are, of course, for the xterm |
| 10294 |
source-code:</p> |
| 10295 |
|
| 10296 |
<table summary="historical xterm source code"> |
| 10297 |
<tr> |
| 10298 |
<th rowspan="2">Date</th> |
| 10299 |
<th rowspan="2">Release</th> |
| 10300 |
<th>Mine</th> |
| 10301 |
<th>Alan's</th> |
| 10302 |
</tr> |
| 10303 |
|
| 10304 |
<tr> |
| 10305 |
<th><a href= |
| 10306 |
"https://github.com/ThomasDickey/old-xterm/commits/8c1136d1b2593d44ef5e0c31f9917a8fb336443a/main.c"> |
| 10307 |
old-xterm</a> |
| 10308 |
</th> |
| 10309 |
<th><a href= |
| 10310 |
"https://cgit.freedesktop.org/~alanc/xc-historical/log/xc/programs/xterm"> |
| 10311 |
Program</a> |
| 10312 |
</th> |
| 10313 |
<th><a href= |
| 10314 |
"https://cgit.freedesktop.org/~alanc/xc-historical/log/xc/doc/specs/xterm"> |
| 10315 |
Specs</a> |
| 10316 |
</th> |
| 10317 |
</tr> |
| 10318 |
|
| 10319 |
<tr> |
| 10320 |
<td>2005-12-14</td> |
| 10321 |
<td><em>X11R6.9.0</em> |
| 10322 |
</td> |
| 10323 |
<td><a href= |
| 10324 |
"https://github.com/ThomasDickey/old-xterm/tree/8c1136d1b2593d44ef5e0c31f9917a8fb336443a"> |
| 10325 |
link</a> |
| 10326 |
</td> |
| 10327 |
<td><em>n/a</em> |
| 10328 |
</td> |
| 10329 |
<td><em>n/a</em> |
| 10330 |
</td> |
| 10331 |
</tr> |
| 10332 |
|
| 10333 |
<tr> |
| 10334 |
<td>2005-01-12</td> |
| 10335 |
<td><em>X11R6.8.2</em> |
| 10336 |
</td> |
| 10337 |
<td><a href= |
| 10338 |
"https://github.com/ThomasDickey/old-xterm/tree/8f53683fb3286c4b9f7e56b035657c019a8b510c"> |
| 10339 |
link</a> |
| 10340 |
</td> |
| 10341 |
<td><em>n/a</em> |
| 10342 |
</td> |
| 10343 |
<td><em>n/a</em> |
| 10344 |
</td> |
| 10345 |
</tr> |
| 10346 |
|
| 10347 |
<tr> |
| 10348 |
<td>2004-08-20</td> |
| 10349 |
<td><em>X11R6.8.0</em> |
| 10350 |
</td> |
| 10351 |
<td><a href= |
| 10352 |
"https://github.com/ThomasDickey/old-xterm/tree/244c3c87895b75f50d994c8ed0b0b0b570acb02b"> |
| 10353 |
link</a> |
| 10354 |
</td> |
| 10355 |
<td><em>n/a</em> |
| 10356 |
</td> |
| 10357 |
<td><em>n/a</em> |
| 10358 |
</td> |
| 10359 |
</tr> |
| 10360 |
|
| 10361 |
<tr> |
| 10362 |
<td>2004-04-02</td> |
| 10363 |
<td><em>X11R6.7</em> |
| 10364 |
</td> |
| 10365 |
<td><a href= |
| 10366 |
"https://github.com/ThomasDickey/old-xterm/tree/72f78591baaef305e639393c8570f33154801342"> |
| 10367 |
link</a> |
| 10368 |
</td> |
| 10369 |
<td><em>n/a</em> |
| 10370 |
</td> |
| 10371 |
<td><em>n/a</em> |
| 10372 |
</td> |
| 10373 |
</tr> |
| 10374 |
|
| 10375 |
<tr> |
| 10376 |
<td>2001-02-09</td> |
| 10377 |
<td><em>X11R6.6</em> |
| 10378 |
</td> |
| 10379 |
<td><a href= |
| 10380 |
"https://github.com/ThomasDickey/old-xterm/tree/588551b210f997e94d7062068e473b03dd7f7adc"> |
| 10381 |
link</a> |
| 10382 |
</td> |
| 10383 |
<td><em>n/a</em> |
| 10384 |
</td> |
| 10385 |
<td><em>n/a</em> |
| 10386 |
</td> |
| 10387 |
</tr> |
| 10388 |
|
| 10389 |
<tr> |
| 10390 |
<td>2000-08-21</td> |
| 10391 |
<td><em>X11R6.5.1</em> |
| 10392 |
</td> |
| 10393 |
<td><a href= |
| 10394 |
"https://github.com/ThomasDickey/old-xterm/tree/6171bddbd473ca531a927f98253b617200a2f7de"> |
| 10395 |
link</a> |
| 10396 |
</td> |
| 10397 |
<td><em>n/a</em> |
| 10398 |
</td> |
| 10399 |
<td><em>n/a</em> |
| 10400 |
</td> |
| 10401 |
</tr> |
| 10402 |
|
| 10403 |
<tr> |
| 10404 |
<td>1998-02-09</td> |
| 10405 |
<td><em>X11R6.4</em> |
| 10406 |
</td> |
| 10407 |
<td><a href= |
| 10408 |
"https://github.com/ThomasDickey/old-xterm/tree/09772a9703eeaf63ab990189453f64ea718c7005"> |
| 10409 |
link</a> |
| 10410 |
</td> |
| 10411 |
<td><em>n/a</em> |
| 10412 |
</td> |
| 10413 |
<td><em>n/a</em> |
| 10414 |
</td> |
| 10415 |
</tr> |
| 10416 |
|
| 10417 |
<tr> |
| 10418 |
<td>1996-12-09</td> |
| 10419 |
<td><em>X11R6.3</em> |
| 10420 |
</td> |
| 10421 |
<td><a href= |
| 10422 |
"https://github.com/ThomasDickey/old-xterm/tree/593e9a29ebed6609b07f4133e034b43400e8cc51"> |
| 10423 |
link</a> |
| 10424 |
</td> |
| 10425 |
<td><em>n/a</em> |
| 10426 |
</td> |
| 10427 |
<td><em>n/a</em> |
| 10428 |
</td> |
| 10429 |
</tr> |
| 10430 |
|
| 10431 |
<tr> |
| 10432 |
<td>1996-02-02</td> |
| 10433 |
<td><em>X11R6.1</em> |
| 10434 |
</td> |
| 10435 |
<td><a href= |
| 10436 |
"https://github.com/ThomasDickey/old-xterm/tree/1f18f60614c20fce722891b772017b5647eb9259"> |
| 10437 |
link</a> |
| 10438 |
</td> |
| 10439 |
<td><em>n/a</em> |
| 10440 |
</td> |
| 10441 |
<td><em>n/a</em> |
| 10442 |
</td> |
| 10443 |
</tr> |
| 10444 |
|
| 10445 |
<tr> |
| 10446 |
<td>1995-01-30</td> |
| 10447 |
<td><em>X11R6</em> |
| 10448 |
</td> |
| 10449 |
<td><a href= |
| 10450 |
"https://github.com/ThomasDickey/old-xterm/tree/279c9960fc4d19e249ec7af2fb7c7d9c2987d369"> |
| 10451 |
link</a> |
| 10452 |
</td> |
| 10453 |
<td><a href= |
| 10454 |
"https://cgit.freedesktop.org/~alanc/xc-historical/tree/xc/programs/xterm?id=9d5f53a3923a1a4bd6fa8afb3d7afdd448767187"> |
| 10455 |
link</a> |
| 10456 |
</td> |
| 10457 |
<td><a href= |
| 10458 |
"https://cgit.freedesktop.org/~alanc/xc-historical/tree/xc/doc/specs/xterm/ctlseqs.ms?id=68409e15e071bae349d54111b27d9b78c1dd6c5a"> |
| 10459 |
link</a> |
| 10460 |
</td> |
| 10461 |
</tr> |
| 10462 |
|
| 10463 |
<tr> |
| 10464 |
<td>1993-11-11</td> |
| 10465 |
<td><em>X11R5</em> |
| 10466 |
</td> |
| 10467 |
<td><a href= |
| 10468 |
"https://github.com/ThomasDickey/old-xterm/tree/5534cf360d381e75057bef3eaf401acad5a6360e"> |
| 10469 |
link</a> |
| 10470 |
</td> |
| 10471 |
<td><a href= |
| 10472 |
"https://cgit.freedesktop.org/~alanc/xc-historical/tree/xc/programs/xterm?id=8dd835dffa5a2928cec818fb0148c9c2838caa4b"> |
| 10473 |
link</a> |
| 10474 |
</td> |
| 10475 |
<td><a href= |
| 10476 |
"https://cgit.freedesktop.org/~alanc/xc-historical/tree/xc/doc/specs/xterm/ctlseqs.ms?id=f9475442485638537e74bd44ea38d792eecdbecc"> |
| 10477 |
link</a> |
| 10478 |
</td> |
| 10479 |
</tr> |
| 10480 |
|
| 10481 |
<tr> |
| 10482 |
<td>1989-12-23</td> |
| 10483 |
<td><em>X11R4</em> |
| 10484 |
</td> |
| 10485 |
<td><a href= |
| 10486 |
"https://github.com/ThomasDickey/old-xterm/tree/aff055339109b8fe7bf146aecc340a622bae235e"> |
| 10487 |
link</a> |
| 10488 |
</td> |
| 10489 |
<td><a href= |
| 10490 |
"https://cgit.freedesktop.org/~alanc/xc-historical/tree/xc/programs/xterm?id=ad6566ec83c49abca29536932627a41c9a1004da"> |
| 10491 |
link</a> |
| 10492 |
</td> |
| 10493 |
<td><a href= |
| 10494 |
"https://cgit.freedesktop.org/~alanc/xc-historical/commit/xc/doc/specs/xterm?id=9b99668bad70ce523d88920d98ae7b686d9c3289"> |
| 10495 |
link</a> |
| 10496 |
</td> |
| 10497 |
</tr> |
| 10498 |
|
| 10499 |
<tr> |
| 10500 |
<td>1988-10-27</td> |
| 10501 |
<td><em>X11R3</em> |
| 10502 |
</td> |
| 10503 |
<td><a href= |
| 10504 |
"https://github.com/ThomasDickey/old-xterm/tree/1c2422714c26256ff4c3717d1529cec141f22b49"> |
| 10505 |
link</a> |
| 10506 |
</td> |
| 10507 |
<td><a href= |
| 10508 |
"https://cgit.freedesktop.org/~alanc/xc-historical/tree/xc/programs/xterm?id=009e20249100057a1ae15f0c1c04f6d964c0dd81"> |
| 10509 |
link</a> |
| 10510 |
</td> |
| 10511 |
<td><em>n/a</em> |
| 10512 |
</td> |
| 10513 |
</tr> |
| 10514 |
|
| 10515 |
<tr> |
| 10516 |
<td>1988-03-01</td> |
| 10517 |
<td><em>X11R2</em> |
| 10518 |
</td> |
| 10519 |
<td><a href= |
| 10520 |
"https://github.com/ThomasDickey/old-xterm/tree/aaf6f073d6039955fa7fa56675a5ea10dc9e21b6"> |
| 10521 |
link</a> |
| 10522 |
</td> |
| 10523 |
<td><a href= |
| 10524 |
"https://cgit.freedesktop.org/~alanc/xc-historical/tree/xc/programs/xterm?id=243d9b2d557b95812e51097e98d8f4be79df78d5"> |
| 10525 |
link</a> |
| 10526 |
</td> |
| 10527 |
<td><em>n/a</em> |
| 10528 |
</td> |
| 10529 |
</tr> |
| 10530 |
|
| 10531 |
<tr> |
| 10532 |
<td>1987-09-15</td> |
| 10533 |
<td><em>X11R1</em> |
| 10534 |
</td> |
| 10535 |
<td><a href= |
| 10536 |
"https://github.com/ThomasDickey/old-xterm/tree/6bf1714f13b7811c3e28d186bfc9942d971edd9b"> |
| 10537 |
link</a> |
| 10538 |
</td> |
| 10539 |
<td><em>n/a</em> |
| 10540 |
</td> |
| 10541 |
<td><em>n/a</em> |
| 10542 |
</td> |
| 10543 |
</tr> |
| 10544 |
|
| 10545 |
<tr> |
| 10546 |
<td>1986-12-25</td> |
| 10547 |
<td><em>X10R4</em> |
| 10548 |
</td> |
| 10549 |
<td><a href= |
| 10550 |
"https://github.com/ThomasDickey/old-xterm/tree/d448c6d7373c3bc3df4c75e815baa1e645462893"> |
| 10551 |
link</a> |
| 10552 |
</td> |
| 10553 |
<td><em>n/a</em> |
| 10554 |
</td> |
| 10555 |
<td><em>n/a</em> |
| 10556 |
</td> |
| 10557 |
</tr> |
| 10558 |
|
| 10559 |
<tr> |
| 10560 |
<td>1986-05-17</td> |
| 10561 |
<td><em>X10R3</em> |
| 10562 |
</td> |
| 10563 |
<td><a href= |
| 10564 |
"https://github.com/ThomasDickey/old-xterm/tree/28267a54e0b2f5daf75846ba8ee5030a1d177a52"> |
| 10565 |
link</a> |
| 10566 |
</td> |
| 10567 |
<td><em>n/a</em> |
| 10568 |
</td> |
| 10569 |
<td><em>n/a</em> |
| 10570 |
</td> |
| 10571 |
</tr> |
| 10572 |
</table> |
| 10573 |
</li> |
| 10574 |
</ul> |
| 10575 |
|
| 10576 |
<h3 id="ref_misleading-id"><a name="ref_misleading" id= |
| 10577 |
"ref_misleading">Interesting but misleading:</a></h3> |
| 10578 |
|
| 10579 |
<ul> |
| 10580 |
<li id="mis:vt100-color"> |
| 10581 |
<p>The ncurses FAQ <em><a href= |
| 10582 |
"/ncurses/ncurses.faq.html#vt100_color" id="vt100_color" |
| 10583 |
name="vt100_color">How do I get color with VT100?</a></em> |
| 10584 |
discusses a widely cited bit of misinformation.<br> |
| 10585 |
For instance, this <a href= |
| 10586 |
"https://www.google.com/search?q=%22http%3A%2F%2Fwww.termsys.demon.co.uk%2Fvtansi.htm%22"> |
| 10587 |
web search</a> gave 3,000 hits in March 2015.</p> |
| 10588 |
</li> |
| 10589 |
|
| 10590 |
<li id="mis:backspace-delete"> |
| 10591 |
<p>Also widely cited, <a href= |
| 10592 |
"https://web.archive.org/web/20041212103553/http://www.afterstep.org/keyboard.html"> |
| 10593 |
Consistent BackSpace and Delete Configuration</a> gave advice |
| 10594 |
regarding <a href="#xterm_erase">backspace and delete</a> |
| 10595 |
keys which was heavily biased toward Linux. For instance:</p> |
| 10596 |
|
| 10597 |
<ul> |
| 10598 |
<li> |
| 10599 |
<p>the <em>console</em> referred to is the Linux console, |
| 10600 |
which initially had as a goal <em>VT220</em> emulation. |
| 10601 |
Linux never came close to meeting that goal, which was |
| 10602 |
abandoned in the late 1990s when UTF-8 became more |
| 10603 |
important.</p> |
| 10604 |
|
| 10605 |
<p>As part of that, Linux's keyboard was (actually |
| 10606 |
modelled on xterm) said to be <em>VT220</em>, and its |
| 10607 |
coding for the backspace key sent <code>DEL</code>. In |
| 10608 |
contrast, ncurses' terminal database says |
| 10609 |
<code>kbs</code> for the <a href= |
| 10610 |
"/ncurses/terminfo.src.html#tic-vt220">vt220</a> sends |
| 10611 |
<code>^H</code> (<code>BS</code>).</p> |
| 10612 |
</li> |
| 10613 |
|
| 10614 |
<li> |
| 10615 |
<p>the guideline uses “newer”, |
| 10616 |
“right” and “correct” in the part |
| 10617 |
which describes <code>DEL</code>, versus |
| 10618 |
“dirty” and “break”, |
| 10619 |
“broken” in that addressing |
| 10620 |
<code>BS</code>.</p> |
| 10621 |
</li> |
| 10622 |
</ul> |
| 10623 |
|
| 10624 |
<p>In addition to bias, the technical remedies are unsuitable |
| 10625 |
for generic advice. In particular, the comments about |
| 10626 |
terminfo, <code>xmodmap</code> and xterm's translations |
| 10627 |
resource are suitable only for special cases because the |
| 10628 |
proposed solutions create problems of their own.</p> |
| 10629 |
|
| 10630 |
<p>The page itself was written in 1997, with only minor fixes |
| 10631 |
since then. Thus, it does not reflect any of the improvements |
| 10632 |
made to xterm. Its lack of relevance does not prevent people |
| 10633 |
from citing it. For instance, <a href= |
| 10634 |
"https://unix.stackexchange.com/questions/180087/why-pressing-ctrl-h-in-xterm-tmux-sends/180106#180106"> |
| 10635 |
this page</a>'s <em>accepted answer</em> recommends that |
| 10636 |
(although neither gives a useful answer to the question). |
| 10637 |
Here are a few clues:</p> |
| 10638 |
|
| 10639 |
<ul> |
| 10640 |
<li> |
| 10641 |
<p>Debian's current package for ncurses uses the |
| 10642 |
<code>--with-xterm-kbs</code> configure option which I |
| 10643 |
added in <a href="/ncurses/NEWS.html#t20120211">2012</a>. |
| 10644 |
Debian also applies patches to many of the terminal |
| 10645 |
descriptions, including adding a patched copy of xterm's |
| 10646 |
terminfo file to ncurses's terminfo file.</p> |
| 10647 |
|
| 10648 |
<p>The patched copy is redundant and a source of problems |
| 10649 |
(since the two overlap, with slightly different goals |
| 10650 |
regarding PC- and VT220-style keyboards). My intent in |
| 10651 |
adding the configure option to ncurses was to wean them |
| 10652 |
away from the patch. That has not happened yet.</p> |
| 10653 |
</li> |
| 10654 |
|
| 10655 |
<li> |
| 10656 |
<a href="https://github.com/tmux">tmux</a> is (mostly) a |
| 10657 |
terminfo application. However, it does not use the |
| 10658 |
terminal database's <code>kbs</code> value. Rather |
| 10659 |
(referring to the source for 1.9a), it uses the termios |
| 10660 |
setting: |
| 10661 |
<blockquote> |
| 10662 |
<!--{{atr2html--> |
| 10663 |
|
| 10664 |
<p style="font-family: monospace; font-size: 10pt;" |
| 10665 |
class="code-block"> |
| 10666 |
<span class="comment">/*<br> |
| 10667 |
</span> |
| 10668 |
<span class="comment">* Check for backspace key using termios VERASE - the terminfo<br> |
| 10669 |
</span> |
| 10670 |
<span class="comment">* kbs entry is extremely unreliable, so cannot be safely<br> |
| 10671 |
</span> |
| 10672 |
<span class="comment">* used. termios should have a better idea.<br> |
| 10673 |
</span> |
| 10674 |
<span class="comment">*/</span><br> |
| 10675 |
|
| 10676 |
bspace = tty->tio.c_cc[VERASE];<br> |
| 10677 |
|
| 10678 |
<span class="keyword">if</span> (bspace != _POSIX_VDISABLE && key == bspace)<br> |
| 10679 |
|
| 10680 |
key = KEYC_BSPACE;<br> |
| 10681 |
|
| 10682 |
<!--atr2html}}--></p> |
| 10683 |
</blockquote> |
| 10684 |
|
| 10685 |
<p>At the same time, <code>tmux</code> sets |
| 10686 |
<code>$TERM</code> to “screen”, by default. |
| 10687 |
Debian patches that terminal description, too. |
| 10688 |
Applications running inside <code>tmux</code> use that |
| 10689 |
terminal description. If instead <code>tmux</code> |
| 10690 |
translated the backspace key to match the value from |
| 10691 |
<a href= |
| 10692 |
"/ncurses/man/curs_termattrs.3x.html">erasechar</a> (for |
| 10693 |
the given <code>$TERM</code>), its clients would receive |
| 10694 |
consistent information.</p> |
| 10695 |
|
| 10696 |
<p>Thus, rather than blaming the user (for a "badly |
| 10697 |
configured" xterm), the actual problem is a design flaw |
| 10698 |
in <code>tmux</code> which should have been sent to its |
| 10699 |
developers in a bug report.</p> |
| 10700 |
</li> |
| 10701 |
</ul> |
| 10702 |
</li> |
| 10703 |
|
| 10704 |
<li id="mis:all-escapes"> |
| 10705 |
<p>One of the PuTTY developers has a list named |
| 10706 |
“all-escapes” which begins</p> |
| 10707 |
|
| 10708 |
<blockquote> |
| 10709 |
<pre class="code-block"> |
| 10710 |
# This file is hoped to document all the escape sequences supported by |
| 10711 |
# terminals that are vaguely compliant with ECMA-48 and friends. |
| 10712 |
</pre> |
| 10713 |
</blockquote> |
| 10714 |
|
| 10715 |
<p>It has been an occasional topic for comment:</p> |
| 10716 |
|
| 10717 |
<ul> |
| 10718 |
<li> |
| 10719 |
<a href= |
| 10720 |
"https://comp.os.vms.narkive.com/xY2s5Mns/decterm-special-escape-sequences"> |
| 10721 |
DECterm special escape sequences ?</a> (Fri Dec 29 |
| 10722 |
08:28:11 2006 on <em>comp.os.vms</em>): |
| 10723 |
<blockquote> |
| 10724 |
<pre class="code-block"> |
| 10725 |
Michael Unger <[email protected]> wrote: |
| 10726 |
> On 2006-12-28 06:20, "JF Mezei" wrote: |
| 10727 |
>> [...] |
| 10728 |
>> |
| 10729 |
>> I tried google, and there are so many sites that list one or two espape |
| 10730 |
>> sequence that it is nearly impossible to find out whether what I am looking |
| 10731 |
>> for exists or not. |
| 10732 |
|
| 10733 |
> There are quite a lot of escape sequences documented in |
| 10734 |
> <<a rel="nofollow" href= |
| 10735 |
"https://bjh21.me.uk/all-escapes/all-escapes.txt">https://bjh21.me.uk/all-escapes/all-escapes.txt</a>> ... |
| 10736 |
|
| 10737 |
...unfortunately, they're just heaped together in one place, without |
| 10738 |
a cross-reference (which would show that they're from several types |
| 10739 |
of terminals). |
| 10740 |
|
| 10741 |
For a clue regarding the depth of this file, note the first line |
| 10742 |
|
| 10743 |
# $Id: all-escapes.txt,v 1.32 2005/09/14 12:00:06 ben Exp @ |
| 10744 |
|
| 10745 |
and the 1999's pervading the text. It's basically a cut/paste job |
| 10746 |
from 1999 with a handful of changes past that point. Compare with |
| 10747 |
|
| 10748 |
<a href= |
| 10749 |
"/archives/ncurses/terminfo.src.gz">https://invisible-island.net/archives/ncurses/terminfo.src.gz</a> |
| 10750 |
|
| 10751 |
or any of the references cited. |
| 10752 |
</pre> |
| 10753 |
</blockquote> |
| 10754 |
</li> |
| 10755 |
|
| 10756 |
<li> |
| 10757 |
<a href= |
| 10758 |
"https://unix.stackexchange.com/questions/295871/why-does-cating-an-executable-keep-changing-the-title-of-putty?rq=1"> |
| 10759 |
Why does cating an executable keep changing the title of |
| 10760 |
PuTTY?</a> (July 14, 2016 on StackOverflow) |
| 10761 |
<blockquote> |
| 10762 |
<pre class="code-block"> |
| 10763 |
PuTTY recognizes many (by no means all) of the escape sequences used for xterm, |
| 10764 |
Linux console and some less familiar terminals. One of PuTTY's developers |
| 10765 |
compiled a list of all of the ones that might be of interest, about 650 items. |
| 10766 |
... |
| 10767 |
For whatever reason, they disliked the notion of referring directly to the |
| 10768 |
documentation for Linux and xterm, but used secondary sources. |
| 10769 |
</pre> |
| 10770 |
</blockquote> |
| 10771 |
|
| 10772 |
<p>The comment about secondary sources was prompted by |
| 10773 |
noticing that although xterm and vttest are mentioned |
| 10774 |
more than a hundred times within the document, neither is |
| 10775 |
listed in the header. Also, the references within the |
| 10776 |
document are all from September 1999 (<a href= |
| 10777 |
"xterm.log.html#xterm_116">xterm #116</a>). For DEC |
| 10778 |
terminals as well, this uses secondary sources (perhaps |
| 10779 |
just as well, since including all of the sequences listed |
| 10780 |
in DEC's manuals would make the file much larger). Most |
| 10781 |
of the links listed in the header are dead anyway.</p> |
| 10782 |
|
| 10783 |
<p>The file changes infrequently, but did change within |
| 10784 |
2020. There is an <a rel="nofollow" href= |
| 10785 |
"https://bjh21.me.uk/all-escapes/all-escapes.xhtml">xhtml |
| 10786 |
version</a>, perhaps inspired by <a rel="nofollow" href= |
| 10787 |
"https://web.archive.org/web/20160710032545/https://rtfm.etla.org/xterm/ctlseq.html"> |
| 10788 |
this old page</a> (also from 1999).</p> |
| 10789 |
</li> |
| 10790 |
</ul> |
| 10791 |
</li> |
| 10792 |
|
| 10793 |
<li id="mis:ncdware"> |
| 10794 |
<p>Noted <a href= |
| 10795 |
"https://stackoverflow.com/questions/24833129/how-to-change-the-window-title-of-te-based-on-vt320"> |
| 10796 |
here</a>, someone pointed out an <a href= |
| 10797 |
"https://web.archive.org/web/20151129210122/https://bio.gsi.de/DOCS/NCDWARE/V5.0.000/HTML/term_em8.htm"> |
| 10798 |
NCDware document</a> describing its terminal control |
| 10799 |
sequences.</p> |
| 10800 |
|
| 10801 |
<p>Disregarding the title <em>Using VT320 Terminal Emulator |
| 10802 |
Escape Sequences</em>, it described some variant of xterm |
| 10803 |
rather than a DEC VT320. VT320s for example had no "alternate |
| 10804 |
screen". Nor did it have a feature for the "curses (1) |
| 10805 |
fix".</p> |
| 10806 |
|
| 10807 |
<p>The NCD documentation (dated December 12, 1997) does not |
| 10808 |
mention xterm. A <a href= |
| 10809 |
"https://www.bitsavers.org/pdf/ncd/9300584A_NCDware_Reference_Manual_Oct1997.pdf"> |
| 10810 |
related manual</a> does mention xterm, but only in other |
| 10811 |
sections. There are other issues with the manual. For |
| 10812 |
example, aixterm (<a href= |
| 10813 |
"/xterm/xterm.log.html#xterm_39">16-color</a>) control |
| 10814 |
sequences are documented as "NCD-specific values". NCD did |
| 10815 |
add escape sequences for status line (<a href= |
| 10816 |
"#bug_kterm">kterm</a> did this as well, according to the |
| 10817 |
6.2.0 sources dated July 1996), as well as VT220 national |
| 10818 |
replacement characters (which I added early in <a href= |
| 10819 |
"/xterm/xterm.log.html#xterm_70">1998</a>).</p> |
| 10820 |
</li> |
| 10821 |
|
| 10822 |
<li id="mis:geekery"> |
| 10823 |
<p><em><a href= |
| 10824 |
"https://aperiodic.net/pip/archives/Geekery/term-function-keys/"> |
| 10825 |
Terminal Function Key Escape Codes</a></em> has good |
| 10826 |
intentions, but falls astray in several respects.<br> |
| 10827 |
For a different treatment of the same material, see my |
| 10828 |
notes:</p> |
| 10829 |
|
| 10830 |
<blockquote> |
| 10831 |
<p><em><a href="/xterm/xterm-function-keys.html">Table of |
| 10832 |
function-keys for XTerm and other Terminal |
| 10833 |
Emulators</a></em> |
| 10834 |
</p> |
| 10835 |
</blockquote> |
| 10836 |
|
| 10837 |
<p>First off, it (like the the <a href= |
| 10838 |
"#vte:xconsortium">documentation</a> for GNOME Terminal) |
| 10839 |
misattributes work which I did, crediting the X |
| 10840 |
Consortium:</p> |
| 10841 |
|
| 10842 |
<blockquote class="code-block"> |
| 10843 |
<p>This brings me to xterm. xterm has a long history, and |
| 10844 |
the function key definitions have changed over time. The |
| 10845 |
<strong>original</strong> xterm from the X Consortium (even |
| 10846 |
before they were absorbed by The Open Group) used escape |
| 10847 |
codes based on the VT220, but extended to cover the range |
| 10848 |
from F1 to <strong>F48</strong>. F1 through F12 generated, |
| 10849 |
respectively, codes <code>^[[11~</code> to |
| 10850 |
<code>^[[15~</code>, <code>^[[17~</code> to |
| 10851 |
<code>^[[21~</code>, <code>^[[23~</code>, and |
| 10852 |
<code>^[[24~</code>. <em><code>Shift-F1</code></em> through |
| 10853 |
<em><code>Shift-F12</code></em> were used for F13 through |
| 10854 |
F24, and generated codes from <code>^[[11;2~</code> to |
| 10855 |
<code>^[[24;2~</code>. Similarly |
| 10856 |
<em><code>Ctrl-F1</code></em> through |
| 10857 |
<em><code>Ctrl-F12</code></em> were used for F25 through |
| 10858 |
F36 and generated codes <code>^[[11;5~</code> to |
| 10859 |
<code>^[[24;5~</code>, and |
| 10860 |
<em><code>Ctrl-Shift-F1</code></em> through |
| 10861 |
<em><code>Ctrl-Shift-F12</code></em> were used for F37 |
| 10862 |
through F48 and generated codes <code>^[[11;6~</code> to |
| 10863 |
<code>^[[24;6~</code>. None of the base xterm |
| 10864 |
<code>$TERM</code> types on my system correspond to this |
| 10865 |
series of escape codes, though you can still get xterm to |
| 10866 |
exhibit the old behavior by setting the |
| 10867 |
<code>OldXtermFKeys</code> resource to 'true'.</p> |
| 10868 |
</blockquote> |
| 10869 |
|
| 10870 |
<p>Not only that, but the comment (and much of the page) is |
| 10871 |
inaccurate. For instance:</p> |
| 10872 |
|
| 10873 |
<ul> |
| 10874 |
<li> |
| 10875 |
<p>The X Consortium went out of business late in 1996 |
| 10876 |
(see <a href= |
| 10877 |
"https://web.archive.org/web/20161017192453/https://www.opengroup.org/tech/desktop/Press_Releases/xccloses.htm"> |
| 10878 |
press release</a> from July 1996).</p> |
| 10879 |
|
| 10880 |
<ul> |
| 10881 |
<li> |
| 10882 |
<p>The first release of X11R6 was done <a href= |
| 10883 |
"https://www.x.org/releases/X11R6.1/RELNOTES.TXT">early |
| 10884 |
in 1996</a> by X Consortium.</p> |
| 10885 |
</li> |
| 10886 |
|
| 10887 |
<li> |
| 10888 |
<p>I've been working on xterm since before that (see |
| 10889 |
<a href="#my_history">history</a>).</p> |
| 10890 |
</li> |
| 10891 |
</ul> |
| 10892 |
</li> |
| 10893 |
|
| 10894 |
<li> |
| 10895 |
<p>The X Consortium xterm only knew about function keys |
| 10896 |
up to <strong>F20</strong>.</p> |
| 10897 |
|
| 10898 |
<ul> |
| 10899 |
<li> |
| 10900 |
<p>X11R5 defined only 20 function keys, and xterm |
| 10901 |
used only those since May 1991.<br> |
| 10902 |
X11R6 changes to xterm did not take advantage of |
| 10903 |
additional keys aside from the |
| 10904 |
<em><code>Insert</code></em> and |
| 10905 |
<em><code>Delete</code></em> on the keypad.</p> |
| 10906 |
</li> |
| 10907 |
|
| 10908 |
<li> |
| 10909 |
<p>Further changes by The Open Group through X11R6.6 |
| 10910 |
made no changes to xterm's handling of special |
| 10911 |
keys.</p> |
| 10912 |
</li> |
| 10913 |
|
| 10914 |
<li> |
| 10915 |
<p>That came in xterm <a href= |
| 10916 |
"/xterm/xterm.log.html#xterm_130">patch #130</a> |
| 10917 |
(2000/3/1), starting with the SCO function-keys |
| 10918 |
feature.</p> |
| 10919 |
</li> |
| 10920 |
</ul> |
| 10921 |
</li> |
| 10922 |
|
| 10923 |
<li> |
| 10924 |
<p>The X Consortium xterm didn't know about using |
| 10925 |
<em><code>Shift</code></em> to get F13 through F24.</p> |
| 10926 |
|
| 10927 |
<ul> |
| 10928 |
<li> |
| 10929 |
<p>I introduced a similar feature (using |
| 10930 |
<em><code>Control</code></em>) in <a href= |
| 10931 |
"/xterm/xterm.log.html#xterm_51">patch #51</a> |
| 10932 |
(1997/9/15) as the <a href= |
| 10933 |
"#how2_fkeys"><code>sunKeyboard</code></a> |
| 10934 |
resource.<br> |
| 10935 |
I did this to leave <em><code>Shift</code></em> for |
| 10936 |
the VT220 UDK (user-defined keys).</p> |
| 10937 |
</li> |
| 10938 |
|
| 10939 |
<li> |
| 10940 |
<p><strong>rxvt</strong> used |
| 10941 |
<em><code>Shift</code></em>; the key combination was |
| 10942 |
popular.</p> |
| 10943 |
</li> |
| 10944 |
|
| 10945 |
<li> |
| 10946 |
<p>Alexander V Lukyanov's changes in <a href= |
| 10947 |
"/xterm/xterm.log.html#xterm_121">patch #121</a> to |
| 10948 |
update the terminal descriptions for these keys took |
| 10949 |
that into account.</p> |
| 10950 |
</li> |
| 10951 |
</ul> |
| 10952 |
</li> |
| 10953 |
|
| 10954 |
<li> |
| 10955 |
<p>The X Consortium xterm didn't know about using |
| 10956 |
<em><code>Control</code></em> to get F25 through F36.</p> |
| 10957 |
|
| 10958 |
<ul> |
| 10959 |
<li> |
| 10960 |
<p>Even with X11R6, the last function key was |
| 10961 |
<em><code>XK_F35</code></em>.</p> |
| 10962 |
</li> |
| 10963 |
|
| 10964 |
<li> |
| 10965 |
<p>However, since xterm <a href= |
| 10966 |
"/xterm/xterm.log.html#xterm_94">patch #94</a> |
| 10967 |
(1999/3/27), it accepts modifiers (shift, control, |
| 10968 |
alt) to extend the actual set of keys to generate |
| 10969 |
different escape sequences.</p> |
| 10970 |
</li> |
| 10971 |
</ul> |
| 10972 |
</li> |
| 10973 |
|
| 10974 |
<li> |
| 10975 |
<p>The escape sequences described all date from 2002 |
| 10976 |
(xterm <a href="/xterm/xterm.log.html#xterm_167">patch |
| 10977 |
#167</a>).</p> |
| 10978 |
|
| 10979 |
<ul> |
| 10980 |
<li> |
| 10981 |
<p>Besides function-keys, there are two other groups |
| 10982 |
of special keys on the keyboard: cursor and |
| 10983 |
editing-keypad.</p> |
| 10984 |
</li> |
| 10985 |
|
| 10986 |
<li> |
| 10987 |
<p>Before then, the “2” and |
| 10988 |
“5” in cursor- and home/end sequences |
| 10989 |
would be first (before the semicolon).</p> |
| 10990 |
</li> |
| 10991 |
|
| 10992 |
<li> |
| 10993 |
<p>By that point, GNOME Terminal and KDE Konsole had |
| 10994 |
copied the earlier behavior, and failed to follow |
| 10995 |
this change.</p> |
| 10996 |
</li> |
| 10997 |
|
| 10998 |
<li> |
| 10999 |
<p>At the time, I preferred the VT220 keyboard (that |
| 11000 |
does not support modified special keys).</p> |
| 11001 |
</li> |
| 11002 |
|
| 11003 |
<li> |
| 11004 |
<p>However, the <em>app-defaults</em> file which I |
| 11005 |
provided with xterm did not set the |
| 11006 |
<code>sunKeyboard</code> resource to do this.<br> |
| 11007 |
Packagers routinely altered the recommended |
| 11008 |
configuration, so this difference was not noticed for |
| 11009 |
a while.</p> |
| 11010 |
</li> |
| 11011 |
|
| 11012 |
<li> |
| 11013 |
<p>In response to a <a href= |
| 11014 |
"https://bugzilla.redhat.com/show_bug.cgi?id=122815">bug |
| 11015 |
report</a>, I switched to the Sun/PC keyboard, using |
| 11016 |
the <a href= |
| 11017 |
"/ncurses/NEWS.html#t20040717">xterm-pc-fkeys</a> |
| 11018 |
building blocks in ncurses' terminfo description for |
| 11019 |
xterm.</p> |
| 11020 |
</li> |
| 11021 |
</ul> |
| 11022 |
</li> |
| 11023 |
|
| 11024 |
<li> |
| 11025 |
<p>The X Consortium xterm had incomplete support for |
| 11026 |
VT100 keypad.</p> |
| 11027 |
|
| 11028 |
<ul> |
| 11029 |
<li> |
| 11030 |
<p>I added a resource <code>sunKeyboard</code> to |
| 11031 |
tell xterm to look at other keyboards to simulate the |
| 11032 |
keypad.</p> |
| 11033 |
</li> |
| 11034 |
|
| 11035 |
<li> |
| 11036 |
<p>To do this, I made F1 through F4 act like the |
| 11037 |
VT100 PF1 through PF4.</p> |
| 11038 |
</li> |
| 11039 |
|
| 11040 |
<li> |
| 11041 |
<p>That came in xterm <a href= |
| 11042 |
"/xterm/xterm.log.html#xterm_79">patch #79</a> |
| 11043 |
(1998/6/28).</p> |
| 11044 |
</li> |
| 11045 |
|
| 11046 |
<li> |
| 11047 |
<p>Not everyone liked that, so I added another |
| 11048 |
resource to allow turning off the change to F1 |
| 11049 |
through F4.</p> |
| 11050 |
</li> |
| 11051 |
|
| 11052 |
<li> |
| 11053 |
<p>Actually <code>OldXtermFKeys</code> is the |
| 11054 |
resource <em>class</em>; the actual resource is |
| 11055 |
<code>oldXtermFKeys</code>.</p> |
| 11056 |
</li> |
| 11057 |
</ul> |
| 11058 |
</li> |
| 11059 |
</ul> |
| 11060 |
|
| 11061 |
<p>By the way, although The Open Group made changes, none of |
| 11062 |
those have been incorporated in this version of xterm. That |
| 11063 |
was intentional (see <a href= |
| 11064 |
"https://invisible-island.net/personal/copyrights.html">discussion</a>). |
| 11065 |
Consequently, the xterm copyright makes no mention of The |
| 11066 |
Open Group.</p> |
| 11067 |
</li> |
| 11068 |
</ul> |
| 11069 |
|
| 11070 |
<h2 id="future_work-id"><a name="future_work" id= |
| 11071 |
"future_work">Ongoing/future work</a></h2> |
| 11072 |
|
| 11073 |
<ul> |
| 11074 |
<li> |
| 11075 |
<p>soft (downloadable) fonts</p> |
| 11076 |
</li> |
| 11077 |
|
| 11078 |
<li> |
| 11079 |
<p>printer interface</p> |
| 11080 |
|
| 11081 |
<p>Done, except for the corresponding support in the VT52 |
| 11082 |
emulation. It would be nice to have a dialog to control |
| 11083 |
this.</p> |
| 11084 |
</li> |
| 11085 |
|
| 11086 |
<li> |
| 11087 |
<p>allow alternate libraries for popup-menus and dialogs</p> |
| 11088 |
|
| 11089 |
<p>My configure script currently provides tests for the |
| 11090 |
variations of Athena widgets (Xaw3D, neXtaw). I intend to |
| 11091 |
make additional changes to support <a href= |
| 11092 |
"xterm.faq.html#bug_mxterm">Motif scrollbars and menus</a>. |
| 11093 |
Motif requires a different style of interface for the menus: |
| 11094 |
binding a popup menu to control right mouse may cause the |
| 11095 |
server to hang. As an intermediate step, I implemented a |
| 11096 |
toolbar for the Athena widgets. In turn, that works well |
| 11097 |
enough except with XFree86 4.x: the Xaw library geometry |
| 11098 |
management is broken. (Other implementations of the Athena |
| 11099 |
widgets work well enough).</p> |
| 11100 |
</li> |
| 11101 |
|
| 11102 |
<li> |
| 11103 |
<p>popup window that shows hex code for content of a |
| 11104 |
character cell and hexadecimal keyboard entry for all Unicode |
| 11105 |
characters (ISO 14755)</p> |
| 11106 |
</li> |
| 11107 |
|
| 11108 |
<li> |
| 11109 |
<p>correct cut&paste of TAB character</p> |
| 11110 |
</li> |
| 11111 |
</ul> |
| 11112 |
</body> |
| 11113 |
</html> |