summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-05-17 18:27:18 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-05-17 18:27:18 +0000
commit0c33b73db0266f03271340596806423a9ecad66e (patch)
tree82fcdb0a78217de23594ba3c307f0a35454362b7 /tools
parent8dc73f2df54ccb0c019e5e5a96ae238765158b0c (diff)
Move some crap into the attic, and some other stuff into tools/.
Diffstat (limited to 'tools')
-rw-r--r--tools/256colors.pl63
-rw-r--r--tools/UTF-8-demo.txt212
-rw-r--r--tools/ansicode.txt779
3 files changed, 1054 insertions, 0 deletions
diff --git a/tools/256colors.pl b/tools/256colors.pl
new file mode 100644
index 00000000..c97c2be9
--- /dev/null
+++ b/tools/256colors.pl
@@ -0,0 +1,63 @@
+#!/usr/bin/perl
+# Author: Todd Larason <jtl@molehill.org>
+# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $
+
+# use the resources for colors 0-15 - usually more-or-less a
+# reproduction of the standard ANSI colors, but possibly more
+# pleasing shades
+
+# colors 16-231 are a 6x6x6 color cube
+for ($red = 0; $red < 6; $red++) {
+ for ($green = 0; $green < 6; $green++) {
+ for ($blue = 0; $blue < 6; $blue++) {
+ printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\",
+ 16 + ($red * 36) + ($green * 6) + $blue,
+ ($red ? ($red * 40 + 55) : 0),
+ ($green ? ($green * 40 + 55) : 0),
+ ($blue ? ($blue * 40 + 55) : 0));
+ }
+ }
+}
+
+# colors 232-255 are a grayscale ramp, intentionally leaving out
+# black and white
+for ($gray = 0; $gray < 24; $gray++) {
+ $level = ($gray * 10) + 8;
+ printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\",
+ 232 + $gray, $level, $level, $level);
+}
+
+
+# display the colors
+
+# first the system ones:
+print "System colors:\n";
+for ($color = 0; $color < 8; $color++) {
+ print "\x1b[48;5;${color}m ";
+}
+print "\x1b[0m\n";
+for ($color = 8; $color < 16; $color++) {
+ print "\x1b[48;5;${color}m ";
+}
+print "\x1b[0m\n\n";
+
+# now the color cube
+print "Color cube, 6x6x6:\n";
+for ($green = 0; $green < 6; $green++) {
+ for ($red = 0; $red < 6; $red++) {
+ for ($blue = 0; $blue < 6; $blue++) {
+ $color = 16 + ($red * 36) + ($green * 6) + $blue;
+ print "\x1b[48;5;${color}m ";
+ }
+ print "\x1b[0m ";
+ }
+ print "\n";
+}
+
+
+# now the grayscale ramp
+print "Grayscale ramp:\n";
+for ($color = 232; $color < 256; $color++) {
+ print "\x1b[48;5;${color}m ";
+}
+print "\x1b[0m\n";
diff --git a/tools/UTF-8-demo.txt b/tools/UTF-8-demo.txt
new file mode 100644
index 00000000..4363f27b
--- /dev/null
+++ b/tools/UTF-8-demo.txt
@@ -0,0 +1,212 @@
+
+UTF-8 encoded sample plain-text file
+‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+
+Markus Kuhn [ˈmaʳkʊs kuːn] <http://www.cl.cam.ac.uk/~mgk25/> — 2002-07-25
+
+
+The ASCII compatible UTF-8 encoding used in this plain-text file
+is defined in Unicode, ISO 10646-1, and RFC 2279.
+
+
+Using Unicode/UTF-8, you can write in emails and source code things such as
+
+Mathematics and sciences:
+
+ ∮ E⋅da = Q, n → ∞, ∑ f(i) = ∏ g(i), ⎧⎡⎛┌─────┐⎞⎤⎫
+ ⎪⎢⎜│a²+b³ ⎟⎥⎪
+ ∀x∈ℝ: ⌈x⌉ = −⌊−x⌋, α ∧ ¬β = ¬(¬α ∨ β), ⎪⎢⎜│───── ⎟⎥⎪
+ ⎪⎢⎜⎷ c₈ ⎟⎥⎪
+ ℕ ⊆ ℕ₀ ⊂ ℤ ⊂ ℚ ⊂ ℝ ⊂ ℂ, ⎨⎢⎜ ⎟⎥⎬
+ ⎪⎢⎜ ∞ ⎟⎥⎪
+ ⊥ < a ≠ b ≡ c ≤ d ≪ ⊤ ⇒ (⟦A⟧ ⇔ ⟪B⟫), ⎪⎢⎜ ⎲ ⎟⎥⎪
+ ⎪⎢⎜ ⎳aⁱ-bⁱ⎟⎥⎪
+ 2H₂ + O₂ ⇌ 2H₂O, R = 4.7 kΩ, ⌀ 200 mm ⎩⎣⎝i=1 ⎠⎦⎭
+
+Linguistics and dictionaries:
+
+ ði ıntəˈnæʃənəl fəˈnɛtık əsoʊsiˈeıʃn
+ Y [ˈʏpsilɔn], Yen [jɛn], Yoga [ˈjoːgɑ]
+
+APL:
+
+ ((V⍳V)=⍳⍴V)/V←,V ⌷←⍳→⍴∆∇⊃‾⍎⍕⌈
+
+Nicer typography in plain text files:
+
+ ╔══════════════════════════════════════════╗
+ ║ ║
+ ║ • ‘single’ and “double” quotes ║
+ ║ ║
+ ║ • Curly apostrophes: “We’ve been here” ║
+ ║ ║
+ ║ • Latin-1 apostrophe and accents: '´` ║
+ ║ ║
+ ║ • ‚deutsche‘ „Anführungszeichen“ ║
+ ║ ║
+ ║ • †, ‡, ‰, •, 3–4, —, −5/+5, ™, … ║
+ ║ ║
+ ║ • ASCII safety test: 1lI|, 0OD, 8B ║
+ ║ ╭─────────╮ ║
+ ║ • the euro symbol: │ 14.95 € │ ║
+ ║ ╰─────────╯ ║
+ ╚══════════════════════════════════════════╝
+
+Combining characters:
+
+ STARGΛ̊TE SG-1, a = v̇ = r̈, a⃑ ⊥ b⃑
+
+Greek (in Polytonic):
+
+ The Greek anthem:
+
+ Σὲ γνωρίζω ἀπὸ τὴν κόψη
+ τοῦ σπαθιοῦ τὴν τρομερή,
+ σὲ γνωρίζω ἀπὸ τὴν ὄψη
+ ποὺ μὲ βία μετράει τὴ γῆ.
+
+ ᾿Απ᾿ τὰ κόκκαλα βγαλμένη
+ τῶν ῾Ελλήνων τὰ ἱερά
+ καὶ σὰν πρῶτα ἀνδρειωμένη
+ χαῖρε, ὦ χαῖρε, ᾿Ελευθεριά!
+
+ From a speech of Demosthenes in the 4th century BC:
+
+ Οὐχὶ ταὐτὰ παρίσταταί μοι γιγνώσκειν, ὦ ἄνδρες ᾿Αθηναῖοι,
+ ὅταν τ᾿ εἰς τὰ πράγματα ἀποβλέψω καὶ ὅταν πρὸς τοὺς
+ λόγους οὓς ἀκούω· τοὺς μὲν γὰρ λόγους περὶ τοῦ
+ τιμωρήσασθαι Φίλιππον ὁρῶ γιγνομένους, τὰ δὲ πράγματ᾿
+ εἰς τοῦτο προήκοντα, ὥσθ᾿ ὅπως μὴ πεισόμεθ᾿ αὐτοὶ
+ πρότερον κακῶς σκέψασθαι δέον. οὐδέν οὖν ἄλλο μοι δοκοῦσιν
+ οἱ τὰ τοιαῦτα λέγοντες ἢ τὴν ὑπόθεσιν, περὶ ἧς βουλεύεσθαι,
+ οὐχὶ τὴν οὖσαν παριστάντες ὑμῖν ἁμαρτάνειν. ἐγὼ δέ, ὅτι μέν
+ ποτ᾿ ἐξῆν τῇ πόλει καὶ τὰ αὑτῆς ἔχειν ἀσφαλῶς καὶ Φίλιππον
+ τιμωρήσασθαι, καὶ μάλ᾿ ἀκριβῶς οἶδα· ἐπ᾿ ἐμοῦ γάρ, οὐ πάλαι
+ γέγονεν ταῦτ᾿ ἀμφότερα· νῦν μέντοι πέπεισμαι τοῦθ᾿ ἱκανὸν
+ προλαβεῖν ἡμῖν εἶναι τὴν πρώτην, ὅπως τοὺς συμμάχους
+ σώσομεν. ἐὰν γὰρ τοῦτο βεβαίως ὑπάρξῃ, τότε καὶ περὶ τοῦ
+ τίνα τιμωρήσεταί τις καὶ ὃν τρόπον ἐξέσται σκοπεῖν· πρὶν δὲ
+ τὴν ἀρχὴν ὀρθῶς ὑποθέσθαι, μάταιον ἡγοῦμαι περὶ τῆς
+ τελευτῆς ὁντινοῦν ποιεῖσθαι λόγον.
+
+ Δημοσθένους, Γ´ ᾿Ολυνθιακὸς
+
+Georgian:
+
+ From a Unicode conference invitation:
+
+ გთხოვთ ახლავე გაიაროთ რეგისტრაცია Unicode-ის მეათე საერთაშორისო
+ კონფერენციაზე დასასწრებად, რომელიც გაიმართება 10-12 მარტს,
+ ქ. მაინცში, გერმანიაში. კონფერენცია შეჰკრებს ერთად მსოფლიოს
+ ექსპერტებს ისეთ დარგებში როგორიცაა ინტერნეტი და Unicode-ი,
+ ინტერნაციონალიზაცია და ლოკალიზაცია, Unicode-ის გამოყენება
+ ოპერაციულ სისტემებსა, და გამოყენებით პროგრამებში, შრიფტებში,
+ ტექსტების დამუშავებასა და მრავალენოვან კომპიუტერულ სისტემებში.
+
+Russian:
+
+ From a Unicode conference invitation:
+
+ Зарегистрируйтесь сейчас на Десятую Международную Конференцию по
+ Unicode, которая состоится 10-12 марта 1997 года в Майнце в Германии.
+ Конференция соберет широкий круг экспертов по вопросам глобального
+ Интернета и Unicode, локализации и интернационализации, воплощению и
+ применению Unicode в различных операционных системах и программных
+ приложениях, шрифтах, верстке и многоязычных компьютерных системах.
+
+Thai (UCS Level 2):
+
+ Excerpt from a poetry on The Romance of The Three Kingdoms (a Chinese
+ classic 'San Gua'):
+
+ [----------------------------|------------------------]
+ ๏ แผ่นดินฮั่นเสื่อมโทรมแสนสังเวช พระปกเกศกองบู๊กู้ขึ้นใหม่
+ สิบสองกษัตริย์ก่อนหน้าแลถัดไป สององค์ไซร้โง่เขลาเบาปัญญา
+ ทรงนับถือขันทีเป็นที่พึ่ง บ้านเมืองจึงวิปริตเป็นนักหนา
+ โฮจิ๋นเรียกทัพทั่วหัวเมืองมา หมายจะฆ่ามดชั่วตัวสำคัญ
+ เหมือนขับไสไล่เสือจากเคหา รับหมาป่าเข้ามาเลยอาสัญ
+ ฝ่ายอ้องอุ้นยุแยกให้แตกกัน ใช้สาวนั้นเป็นชนวนชื่นชวนใจ
+ พลันลิฉุยกุยกีกลับก่อเหตุ ช่างอาเพศจริงหนาฟ้าร้องไห้
+ ต้องรบราฆ่าฟันจนบรรลัย ฤๅหาใครค้ำชูกู้บรรลังก์ ฯ
+
+ (The above is a two-column text. If combining characters are handled
+ correctly, the lines of the second column should be aligned with the
+ | character above.)
+
+Ethiopian:
+
+ Proverbs in the Amharic language:
+
+ ሰማይ አይታረስ ንጉሥ አይከሰስ።
+ ብላ ካለኝ እንደአባቴ በቆመጠኝ።
+ ጌጥ ያለቤቱ ቁምጥና ነው።
+ ደሀ በሕልሙ ቅቤ ባይጠጣ ንጣት በገደለው።
+ የአፍ ወለምታ በቅቤ አይታሽም።
+ አይጥ በበላ ዳዋ ተመታ።
+ ሲተረጉሙ ይደረግሙ።
+ ቀስ በቀስ፥ ዕንቁላል በእግሩ ይሄዳል።
+ ድር ቢያብር አንበሳ ያስር።
+ ሰው እንደቤቱ እንጅ እንደ ጉረቤቱ አይተዳደርም።
+ እግዜር የከፈተውን ጉሮሮ ሳይዘጋው አይድርም።
+ የጎረቤት ሌባ፥ ቢያዩት ይስቅ ባያዩት ያጠልቅ።
+ ሥራ ከመፍታት ልጄን ላፋታት።
+ ዓባይ ማደሪያ የለው፥ ግንድ ይዞ ይዞራል።
+ የእስላም አገሩ መካ የአሞራ አገሩ ዋርካ።
+ ተንጋሎ ቢተፉ ተመልሶ ባፉ።
+ ወዳጅህ ማር ቢሆን ጨርስህ አትላሰው።
+ እግርህን በፍራሽህ ልክ ዘርጋ።
+
+Runes:
+
+ ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ
+
+ (Old English, which transcribed into Latin reads 'He cwaeth that he
+ bude thaem lande northweardum with tha Westsae.' and means 'He said
+ that he lived in the northern land near the Western Sea.')
+
+Braille:
+
+ ⡌⠁⠧⠑ ⠼⠁⠒ ⡍⠜⠇⠑⠹⠰⠎ ⡣⠕⠌
+
+ ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠙⠑⠁⠙⠒ ⠞⠕ ⠃⠑⠛⠔ ⠺⠊⠹⠲ ⡹⠻⠑ ⠊⠎ ⠝⠕ ⠙⠳⠃⠞
+ ⠱⠁⠞⠑⠧⠻ ⠁⠃⠳⠞ ⠹⠁⠞⠲ ⡹⠑ ⠗⠑⠛⠊⠌⠻ ⠕⠋ ⠙⠊⠎ ⠃⠥⠗⠊⠁⠇ ⠺⠁⠎
+ ⠎⠊⠛⠝⠫ ⠃⠹ ⠹⠑ ⠊⠇⠻⠛⠹⠍⠁⠝⠂ ⠹⠑ ⠊⠇⠻⠅⠂ ⠹⠑ ⠥⠝⠙⠻⠞⠁⠅⠻⠂
+ ⠁⠝⠙ ⠹⠑ ⠡⠊⠑⠋ ⠍⠳⠗⠝⠻⠲ ⡎⠊⠗⠕⠕⠛⠑ ⠎⠊⠛⠝⠫ ⠊⠞⠲ ⡁⠝⠙
+ ⡎⠊⠗⠕⠕⠛⠑⠰⠎ ⠝⠁⠍⠑ ⠺⠁⠎ ⠛⠕⠕⠙ ⠥⠏⠕⠝ ⠰⡡⠁⠝⠛⠑⠂ ⠋⠕⠗ ⠁⠝⠹⠹⠔⠛ ⠙⠑
+ ⠡⠕⠎⠑ ⠞⠕ ⠏⠥⠞ ⠙⠊⠎ ⠙⠁⠝⠙ ⠞⠕⠲
+
+ ⡕⠇⠙ ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲
+
+ ⡍⠔⠙⠖ ⡊ ⠙⠕⠝⠰⠞ ⠍⠑⠁⠝ ⠞⠕ ⠎⠁⠹ ⠹⠁⠞ ⡊ ⠅⠝⠪⠂ ⠕⠋ ⠍⠹
+ ⠪⠝ ⠅⠝⠪⠇⠫⠛⠑⠂ ⠱⠁⠞ ⠹⠻⠑ ⠊⠎ ⠏⠜⠞⠊⠊⠥⠇⠜⠇⠹ ⠙⠑⠁⠙ ⠁⠃⠳⠞
+ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ ⡊ ⠍⠊⠣⠞ ⠙⠁⠧⠑ ⠃⠑⠲ ⠔⠊⠇⠔⠫⠂ ⠍⠹⠎⠑⠇⠋⠂ ⠞⠕
+ ⠗⠑⠛⠜⠙ ⠁ ⠊⠕⠋⠋⠔⠤⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙⠑⠁⠙⠑⠌ ⠏⠊⠑⠊⠑ ⠕⠋ ⠊⠗⠕⠝⠍⠕⠝⠛⠻⠹
+ ⠔ ⠹⠑ ⠞⠗⠁⠙⠑⠲ ⡃⠥⠞ ⠹⠑ ⠺⠊⠎⠙⠕⠍ ⠕⠋ ⠳⠗ ⠁⠝⠊⠑⠌⠕⠗⠎
+ ⠊⠎ ⠔ ⠹⠑ ⠎⠊⠍⠊⠇⠑⠆ ⠁⠝⠙ ⠍⠹ ⠥⠝⠙⠁⠇⠇⠪⠫ ⠙⠁⠝⠙⠎
+ ⠩⠁⠇⠇ ⠝⠕⠞ ⠙⠊⠌⠥⠗⠃ ⠊⠞⠂ ⠕⠗ ⠹⠑ ⡊⠳⠝⠞⠗⠹⠰⠎ ⠙⠕⠝⠑ ⠋⠕⠗⠲ ⡹⠳
+ ⠺⠊⠇⠇ ⠹⠻⠑⠋⠕⠗⠑ ⠏⠻⠍⠊⠞ ⠍⠑ ⠞⠕ ⠗⠑⠏⠑⠁⠞⠂ ⠑⠍⠏⠙⠁⠞⠊⠊⠁⠇⠇⠹⠂ ⠹⠁⠞
+ ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲
+
+ (The first couple of paragraphs of "A Christmas Carol" by Dickens)
+
+Compact font selection example text:
+
+ ABCDEFGHIJKLMNOPQRSTUVWXYZ /0123456789
+ abcdefghijklmnopqrstuvwxyz £©µÀÆÖÞßéöÿ
+ –—‘“”„†•…‰™œŠŸž€ ΑΒΓΔΩαβγδω АБВГДабвгд
+ ∀∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi�⑀₂ἠḂӥẄɐː⍎אԱა
+
+Greetings in various languages:
+
+ Hello world, Καλημέρα κόσμε, コンニチハ
+
+Box drawing alignment tests: █
+ ▉
+ ╔══╦══╗ ┌──┬──┐ ╭──┬──╮ ╭──┬──╮ ┏━━┳━━┓ ┎┒┏┑ ╷ ╻ ┏┯┓ ┌┰┐ ▊ ╱╲╱╲╳╳╳
+ ║┌─╨─┐║ │╔═╧═╗│ │╒═╪═╕│ │╓─╁─╖│ ┃┌─╂─┐┃ ┗╃╄┙ ╶┼╴╺╋╸┠┼┨ ┝╋┥ ▋ ╲╱╲╱╳╳╳
+ ║│╲ ╱│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╿ │┃ ┍╅╆┓ ╵ ╹ ┗┷┛ └┸┘ ▌ ╱╲╱╲╳╳╳
+ ╠╡ ╳ ╞╣ ├╢ ╟┤ ├┼─┼─┼┤ ├╫─╂─╫┤ ┣┿╾┼╼┿┫ ┕┛┖┚ ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳
+ ║│╱ ╲│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╽ │┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▎
+ ║└─╥─┘║ │╚═╤═╝│ │╘═╪═╛│ │╙─╀─╜│ ┃└─╂─┘┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▏
+ ╚══╩══╝ └──┴──┘ ╰──┴──╯ ╰──┴──╯ ┗━━┻━━┛ ▗▄▖▛▀▜ └╌╌┘ ╎ ┗╍╍┛ ┋ ▁▂▃▄▅▆▇█
+ ▝▀▘▙▄▟
diff --git a/tools/ansicode.txt b/tools/ansicode.txt
new file mode 100644
index 00000000..8767b9e7
--- /dev/null
+++ b/tools/ansicode.txt
@@ -0,0 +1,779 @@
+Summary of ANSI standards for ASCII terminals Joe Smith, 18-May-84
+
+Contents:
+ 1. Overview and Definitions
+ 2. General rules for interpreting an ESCape Sequence
+ 3. General rules for interpreting a Control Sequence
+ 4. C0 and C1 control codes in numeric order
+ 5. Two and three-character ESCape Sequences in numeric order
+ 6. Control Sequences in numeric order
+ 7. VT100 emulation requirements
+
+The VT100 USER GUIDE and ANSI standard X3.64-1979 both list the ANSI ESCape
+sequences in alphabetic order by mnemonic, but do not have a have a cross
+reference in order by ASCII code. This paper lists the combination of all
+definitions from the three ANSI standards in numeric order. For a description
+of the advantages of using these standards, see the article "Toward
+Standardized Video Terminals" in the April-1984 issue of BYTE magazine.
+
+ANSI X3.4-1977 defines the 7-bit ASCII character set (C0 and G0). It was
+written in 1968, revised in 1977, and explains the decisions made in laying out
+the ASCII code. In particular, it explains why ANSI chose to make ASCII
+incompatible with EBCDIC in order to make it self-consistant.
+
+ANSI X3.41-1974 introduces the idea of an 8-bit ASCII character set (C1 and G1
+in addition to the existing C0 and G0). It describes how to use the 8-bit
+features in a 7-bit environment. X3.41 defines the format of all ESCape
+sequences, but defines only the 3-character ones with a parameter character
+in the middle. These instruct the terminal how to interpret the C0, G0, C1,
+and G1 characters (such as by selecting different character-set ROMs).
+
+ Note: NAPLPS does videotex graphics by redefining the C1 set and
+ selecting alternate G0, G1, G2, and G3 sets.
+ See the February 1983 issue of BYTE magazine for details.
+
+ANSI X3.64-1979 defines the remaining ESCape sequences. It defines all the C1
+control characters, and specifies that certain two-character ESCape sequences
+in the 7-bit environment are to act exactly like the 8-bit C1 control set.
+X3.64 introduces the idea of a Control-Sequence, which starts with CSI
+character, has an indefinite length, and is terminated by an alphabetic
+character. The VT100 was one of the first terminals to implement this
+standard.
+
+Definitions:
+
+ Control Character - A single character with an ASCII code with the range
+ of 000 to 037 and 200 to 237 octal, 00 to 1F and 80 to 9F hex.
+
+ Escape Sequence - A two or three character string staring with ESCape.
+ (Four or more character strings are allowed but not defined.)
+
+ Control Sequence - A string starting with CSI (233 octal, 9B hex) or
+ with ESCape Left-Bracket, and terminated by an alphabetic character.
+ Any number of parameter characters (digits 0 to 9, semicolon, and
+ question mark) may appear within the Control Sequence. The terminating
+ character may be preceded by an intermediate character (such as space).
+ Character classifications:
+
+C0 Control 000-037 octal, 00-1F hex (G0 is 041-176 octal, 21-7E hex)
+SPACE 040+240 octal, 20+A0 hex Always and everywhere a blank space
+Intermediate 040-057 octal, 20-2F hex !"#$%&'()*+,-./
+Parameters 060-077 octal, 30-3F hex 0123456789:;<=>?
+Uppercase 100-137 octal, 40-5F hex @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
+Lowercase 140-176 octal, 60-7E hex `abcdefghijlkmnopqrstuvwxyz{|}~
+Alphabetic 100-176 octal, 40-7E hex (all of upper and lower case)
+Delete 177 octal, 7F hex Always and everywhere ignored
+C1 Control 200-237 octal, 80-9F hex 32 additional control characters
+G1 Displayable 241-376 octal, A1-FE hex 94 additional displayable characters
+Special 240+377 octal, A0+FF hex Same as SPACE and DELETE
+
+Note that in this paper, the terms uppercase, lowercase, and alphabetics
+include more characters than just A to Z.
+
+------------------------------------------------------------------------------
+
+General rules for interpreting an ESCape Sequence:
+
+ An ESCape Sequence starts with the ESC character (033 octal, 1B hex).
+The length of the ESCape Sequence depends on the character that immediately
+follows the ESCape.
+
+If the next character is
+ C0 control: Interpret it first, then resume processing ESCape sequence.
+ Example: CR, LF, XON, and XOFF work as normal within an ESCape sequence.
+ Intermediate: Expect zero or more intermediates, a parameter terminates
+ a private function, an alphabetic terminates a standard sequence.
+ Example: ESC ( A defines standard character set, ESC ( 0 a DEC set.
+ Parameter: End of a private 2-character escape sequence.
+ Example: ESC = sets special keypad mode, ESC > clears it.
+ Uppercase: Translate it into a C1 control character and act on it.
+ Example: ESC D does indexes down, ESC M indexes up. (CSI is special)
+ Lowercase: End of a standard 2-character escape sequence.
+ Example: ESC c resets the terminal.
+ Delete: Ignore it, and continue interpreting the ESCape sequence
+ C1 and G1: Treat the same as their 7-bit counterparts
+
+ Note that CSI is the two-character sequence ESCape left-bracket or the 8-bit
+C1 code of 233 octal, 9B hex. CSI introduces a Control Sequence, which
+continues until an alphabetic character is received.
+
+General rules for interpreting a Control Sequence:
+
+1) It starts with CSI, the Control Sequence Introducer.
+2) It contains any number of parameter characters (0123456789:;<=>?).
+3) It terminates with an alphabetic character.
+4) Intermediate characters (if any) immediately precede the terminator.
+
+If the first character after CSI is one of "<=>?" (074-077 octal, 3C-3F hex),
+then Control Sequence is to be interpreted according to private standards (such
+as setting and resetting modes not defined by ANSI). The terminal should
+expect any number of numeric parameters, separated by semicolons (073 octal,
+3B hex). Only after the terminating alphabetic character is received should
+the terminal act on the Control Sequence.
+
+=============================================================================
+ C0 set of 7-bit control characters (from ANSI X3.4-1977).
+
+Oct Hex Name * (* marks function used in DEC VT series or LA series terminals)
+--- -- - --- - --------------------------------------------------------------
+000 00 @ NUL * Null filler, terminal should ignore this character
+001 01 A SOH Start of Header
+002 02 B STX Start of Text, implied end of header
+003 03 C ETX End of Text, causes some terminal to respond with ACK or NAK
+004 04 D EOT End of Transmission
+005 05 E ENQ * Enquiry, causes terminal to send ANSWER-BACK ID
+006 06 F ACK Acknowledge, usually sent by terminal in response to ETX
+007 07 G BEL * Bell, triggers the bell, buzzer, or beeper on the terminal
+010 08 H BS * Backspace, can be used to define overstruck characters
+011 09 I HT * Horizontal Tabulation, move to next predetermined position
+012 0A J LF * Linefeed, move to same position on next line (see also NL)
+013 0B K VT * Vertical Tabulation, move to next predetermined line
+014 0C L FF * Form Feed, move to next form or page
+015 0D M CR * Carriage Return, move to first character of current line
+016 0E N SO * Shift Out, switch to G1 (other half of character set)
+017 0F O SI * Shift In, switch to G0 (normal half of character set)
+020 10 P DLE Data Link Escape, interpret next control character specially
+021 11 Q XON * (DC1) Terminal is allowed to resume transmitting
+022 12 R DC2 Device Control 2, causes ASR-33 to activate paper-tape reader
+023 13 S XOFF* (DC2) Terminal must pause and refrain from transmitting
+024 14 T DC4 Device Control 4, causes ASR-33 to deactivate paper-tape reader
+025 15 U NAK Negative Acknowledge, used sometimes with ETX and ACK
+026 16 V SYN Synchronous Idle, used to maintain timing in Sync communication
+027 17 W ETB End of Transmission block
+030 18 X CAN * Cancel (makes VT100 abort current escape sequence if any)
+031 19 Y EM End of Medium
+032 1A Z SUB * Substitute (VT100 uses this to display parity errors)
+033 1B [ ESC * Prefix to an ESCape sequence
+034 1C \ FS File Separator
+035 1D ] GS Group Separator
+036 1E ^ RS * Record Separator (sent by VT132 in block-transfer mode)
+037 1F _ US Unit Separator
+
+040 20 SP * Space (should never be defined to be otherwise)
+177 7F DEL * Delete, should be ignored by terminal
+
+==============================================================================
+ C1 set of 8-bit control characters (from ANSI X3.64-1979)
+
+Oct Hex Name * (* marks function used in DEC VT series or LA series terminals)
+--- -- - --- - --------------------------------------------------------------
+200 80 @ Reserved for future standardization
+201 81 A Reserved
+202 82 B Reserved
+203 83 C Reserved
+204 84 D IND * Index, moves down one line same column regardless of NL
+205 85 E NEL * NEw Line, moves done one line and to first column (CR+LF)
+206 86 F SSA Start of Selected Area to be sent to auxiliary output device
+207 87 G ESA End of Selected Area to be sent to auxiliary output device
+210 88 H HTS * Horizontal Tabulation Set at current position
+211 89 I HTJ Hor Tab Justify, moves string to next tab position
+212 8A J VTS Vertical Tabulation Set at current line
+213 8B K PLD Partial Line Down (subscript)
+214 8C L PLU Partial Line Up (superscript)
+215 8D M RI * Reverse Index, go up one line, reverse scroll if necessary
+216 8E N SS2 * Single Shift to G2
+217 8F O SS3 * Single Shift to G3 (VT100 uses this for sending PF keys)
+220 90 P DCS * Device Control String, terminated by ST (VT125 enters graphics)
+221 91 Q PU1 Private Use 1
+222 92 R PU2 Private Use 2
+223 93 S STS Set Transmit State
+224 94 T CCH Cancel CHaracter, ignore previous character
+225 95 U MW Message Waiting, turns on an indicator on the terminal
+226 96 V SPA Start of Protected Area
+227 97 W EPA End of Protected Area
+230 98 X Reserved for for future standard
+231 99 Y Reserved
+232 9A Z * Reserved, but causes DEC terminals to respond with DA codes
+233 9B [ CSI * Control Sequence Introducer (described in a seperate table)
+234 9C \ ST * String Terminator (VT125 exits graphics)
+235 9D ] OSC Operating System Command (reprograms intelligent terminal)
+236 9E ^ PM Privacy Message (password verification), terminated by ST
+237 9F _ APC Application Program Command (to word processor), term by ST
+
+==============================================================================
+ Character set selection sequences (from ANSI X3.41-1974)
+ All are 3 characters long (including the ESCape). Alphabetic characters
+ as 3rd character are defined by ANSI, parameter characters as 3rd character
+ may be interpreted differently by each terminal manufacturer.
+
+Oct Hex * (* marks function used in DEC VT series or LA series terminals)
+--- -- -- - ------------------------------------------------------------------
+040 20 ANNOUNCER - Determines whether to use 7-bit or 8-bit ASCII
+ A G0 only will be used. Ignore SI, SO, and G1.
+ B G0 and G1 used internally. SI and SO affect G0, G1 is ignored.
+ C G0 and G1 in an 8-bit only environment. SI and SO are ignored.
+ D G0 and G1 are used, SI and SO affect G0.
+ E
+ F * 7-bit transmission, VT240/PRO350 sends CSI as two characters ESC [
+ G * 8-bit transmission, VT240/PRO350 sends CSI as single 8-bit character
+041 21 ! Select C0 control set (choice of 63 standard, 16 private)
+042 22 " Select C1 control set (choice of 63 standard, 16 private)
+043 23 # Translate next character to a special single character
+ #3 * DECDHL1 - Double height line, top half
+ #4 * DECDHL2 - Double height line, bottom half
+ #5 * DECSWL - Single width line
+ #6 * DECDWL - Double width line
+ #7 * DECHCP - Make a hardcopy of the graphics screen (GIGI,VT125,VT241)
+ #8 * DECALN - Alignment display, fill screen with "E" to adjust focus
+044 24 $ MULTIBYTE CHARACTERS - Displayable characters require 2-bytes each
+045 25 % SPECIAL INTERPRETATION - Such as 9-bit data
+046 26 & Reserved for future standardization
+047 27 ' Reserved for future standardization
+050 28 ( * SCS - Select G0 character set (choice of 63 standard, 16 private)
+ (0 * DEC VT100 line drawing set (affects lowercase characters)
+ (1 * DEC Alternate character ROM set (RAM set on GIGI and VT220)
+ (2 * DEC Alternate character ROM set with line drawing
+ (5 * DEC Finnish on LA100
+ (6 * DEC Norwegian/Danish on LA100
+ (7 * DEC Swedish on LA100
+ (9 * DEC French Canadian
+ (< * DEC supplemental graphics (everything not in USASCII)
+ (A * UKASCII (British pound sign)
+ (B * USASCII (American pound sign)
+ (C * ISO Finnish on LA120
+ (E * ISO Norwegian/Danish on LA120
+ (H * ISO Swedish on LA120
+ (K * ISO German on LA100,LA120
+ (R * ISO French on LA100,LA120
+ (Y * ISO Italian on LA100
+ (Z * ISO Spanish on LA100
+051 29 ) * SCS - Select G1 character set (choice of 63 standard, 16 private)
+ * (same character sets as listed under G0)
+052 2A * * SCS - Select G2 character set
+ * (same character sets as listed under G0)
+053 2B + * SCS - Select G3 character set
+ * (same character sets as listed under G0)
+054 2C , SCS - Select G0 character set (additional 63+16 sets)
+055 2D - SCS - Select G1 character set (additional 63+16 sets)
+056 2E . SCS - Select G2 character set
+057 2F / SCS - Select G3 character set
+
+==============================================================================
+ Private two-character escape sequences (allowed by ANSI X3.41-1974)
+ These can be defined differently by each terminal manufacturer.
+
+Oct Hex * (* marks function used in DEC VT series or LA series terminals)
+--- -- - - ------------------------------------------------------------------
+060 30 0
+061 31 1 DECGON graphics on for VT105, DECHTS horiz tab set for LA34/LA120
+062 32 2 DECGOFF graphics off VT105, DECCAHT clear all horz tabs LA34/LA120
+063 33 3 DECVTS - set vertical tab for LA34/LA120
+064 34 4 DECCAVT - clear all vertical tabs for LA34/LA120
+065 35 5 * DECXMT - Host requests that VT132 transmit as if ENTER were pressed
+066 36 6
+067 37 7 * DECSC - Save cursor position and character attributes
+070 38 8 * DECRC - Restore cursor and attributes to previously saved position
+071 39 9
+072 3A :
+073 3B ;
+074 3C < * DECANSI - Switch from VT52 mode to VT100 mode
+075 3D = * DECKPAM - Set keypad to applications mode (ESCape instead of digits)
+076 3E > * DECKPNM - Set keypad to numeric mode (digits intead of ESCape seq)
+077 3F ?
+
+ DCS Device Control Strings used by DEC terminals (ends with ST)
+
+Pp = Start ReGIS graphics (VT125, GIGI, VT240, PRO350)
+Pq = Start SIXEL graphics (screen dump to LA34, LA100, screen load to VT125)
+Pr = SET-UP data for GIGI, $PrVC0$\ disables both visible cursors.
+Ps = Reprogram keys on the GIGI, $P0sDIR<CR>$\ makes keypad 0 send "DIR<CR>"
+ 0-9=digits on keypad, 10=ENTER, 11=minus, 12=comma, 13=period,
+ 14-17=PF1-PF4, 18-21=cursor keys. Enabled by $[?23h (PK1).
+Pt = Start VT105 graphics on a VT125
+
+==============================================================================
+
+ Standard two-character escape sequences (defined by ANSI X3.64-1979)
+
+100 40 @ See description of C1 control characters
+ An ESCape followed by one of these uppercase characters is translated
+ to an 8-bit C1 control character before being interpreted.
+220 90 P DCS - Device Control String, terminated by ST - see table above.
+133 5B [ CSI - Control Sequence Introducer - see table below.
+137 5F _ See description of C1 control characters
+
+==============================================================================
+
+ Indepenent control functions (from Appendix E of X3.64-1977).
+ These four controls have the same meaning regardless of the current
+ definition of the C0 and C1 control sets. Each control is a two-character
+ ESCape sequence, the 2nd character is lowercase.
+
+Oct Hex * (* marks function used in DEC VT series or LA series terminals)
+--- -- - - --------------------------------------------------------------------
+140 60 ` DMI - Disable Manual Input
+141 61 a INT - INTerrupt the terminal and do special action
+142 62 b EMI - Enable Manual Input
+143 63 c * RIS - Reset to Initial State (VT100 does a power-on reset)
+ ... The remaining lowercase characters are reserved by ANSI.
+153 6B k NAPLPS lock-shift G1 to GR
+154 6C l NAPLPS lock-shift G2 to GR
+155 6D m NAPLPS lock-shift G3 to GR
+156 6E n * LS2 - Shift G2 to GL (extension of SI) VT240,NAPLPS
+157 6F o * LS3 - Shift G3 to GL (extension of SO) VT240,NAPLPS
+ ... The remaining lowercase characters are reserved by ANSI.
+174 7C | * LS3R - VT240 lock-shift G3 to GR
+175 7D } * LS2R - VT240 lock-shift G2 to GR
+176 7E ~ * LS1R - VT240 lock-shift G1 to GR
+
+==============================================================================
+ Control Sequences (defined by ANSI X3.64-1979)
+
+Control Sequences are started by either ESC [ or CSI and are terminated by an
+"alphabetic" character (100 to 176 octal, 40 to 7E hex). Intermediate
+characters are space through slash (40 to 57 octal, 20 to 2F hex) and parameter
+characters are zero through question mark (60 to 77 octal, 30 to 3F hex,
+including digits and semicolon). Parameters consist of zero or more decimal
+numbers separated by semicolons. Leading zeros are optional, leading blanks
+are not allowed. If no digits precede the final character, the default
+parameter is used. Many functions treat a parameter of 0 as if it were 1.
+
+Oct Hex * (* marks function used in DEC VT series or LA series terminals)
+--- -- - - --------------------------------------------------------------------
+100 40 @ ICH - Insert CHaracter
+ [10@ = Make room for 10 characters at current position
+101 41 A * CUU - CUrsor Up
+ * [A = Move up one line, stop at top of screen, [9A = move up 9
+102 42 B * CUD - CUrsor Down
+ * [B = Move down one line, stop at bottom of screen
+103 43 C * CUF - CUrsor Forward
+ * [C = Move forward one position, stop at right edge of screen
+104 44 D * CUB - CUrsor Backward
+ * [D = Same as BackSpace, stop at left edge of screen
+105 45 E CNL - Cursor to Next Line
+ [5E = Move to first position of 5th line down
+106 46 F CPL - Cursor to Previous Line
+ [5F = Move to first position of 5th line previous
+107 47 G CHA - Cursor Horizontal position Absolute
+ [40G = Move to column 40 of current line
+110 48 H * CUP - CUrsor Position
+ * [H = Home, [24;80H = Row 24, Column 80
+111 49 I CHT - Cursor Horizontal Tabulation
+ [I = Same as HT (Control-I), [3I = Go forward 3 tabs
+112 4A J * ED - Erase in Display (cursor does not move)
+ * [J = [0J = Erase from current position to end (inclusive)
+ * [1J = Erase from beginning to current position (inclusive)
+ * [2J = Erase entire display
+ * [?0J = Selective erase in display ([?1J, [?2J similar)
+113 4B K * EL - Erase in Line (cursor does not move)
+ * [K = [0K = Erase from current position to end (inclusive)
+ * [1K = Erase from beginning to current position
+ * [2K = Erase entire current line
+ * [?0K = Selective erase to end of line ([?1K, [?2K similar)
+114 4C L * IL - Insert Line, current line moves down (VT102 series)
+ [3L = Insert 3 lines if currently in scrolling region
+115 4D M * DL - Delete Line, lines below current move up (VT102 series)
+ [2M = Delete 2 lines if currently in scrolling region
+116 4E N EF - Erase in Field (as bounded by protected fields)
+ [0N, [1N, [2N act like [L but within currend field
+117 4F O EA - Erase in qualified Area (defined by DAQ)
+ [0O, [1O, [2O act like [J but within current area
+120 50 P * DCH - Delete Character, from current position to end of field
+ [4P = Delete 4 characters, VT102 series
+121 51 Q SEM - Set Editing extent Mode (limits ICH and DCH)
+ [0Q = [Q = Insert/delete character affects rest of display
+ [1Q = ICH/DCH affect the current line only
+ [2Q = ICH/DCH affect current field (between tab stops) only
+ [3Q = ICH/DCH affect qualified area (between protected fields)
+122 52 R * CPR - Cursor Position Report (from terminal to host)
+ * [24;80R = Cursor is positioned at line 24 column 80
+123 53 S SU - Scroll up, entire display is moved up, new lines at bottom
+ [3S = Move everything up 3 lines, bring in 3 new lines
+124 54 T SD - Scroll down, new lines inserted at top of screen
+ [4T = Scroll down 4, bring previous lines back into view
+125 55 U NP - Next Page (if terminal has more than 1 page of memory)
+ [2U = Scroll forward 2 pages
+126 56 V PP - Previous Page (if terminal remembers lines scrolled off top)
+ [1V = Scroll backward 1 page
+127 57 W CTC - Cursor Tabulation Control
+ [0W = Set horizontal tab for current line at current position
+ [1W = Set vertical tab stop for current line of current page
+ [2W = Clear horiz tab stop at current position of current line
+ [3W = Clear vert tab stop at current line of current page
+ [4W = Clear all horiz tab stops on current line only
+ [5W = Clear all horiz tab stops for the entire terminal
+ [6W = Clear all vert tabs stops for the entire terminal
+130 58 X ECH - Erase CHaracter
+ [4X = Change next 4 characters to "erased" state
+131 59 Y CVT - Cursor Vertical Tab
+ [2Y = Move forward to 2nd following vertical tab stop
+132 5A Z CBT - Cursor Back Tab
+ [3Z = Move backwards to 3rd previous horizontal tab stop
+133 5B [ Reserved for future standardization left bracket
+134 5C \ Reserved reverse slant
+135 5D ] Reserved right bracket
+136 5E ^ Reserved circumflex
+137 5F _ Reserved underscore
+140 60 ` * HPA - Horizontal Position Absolute (depends on PUM)
+ [720` = Move to 720 decipoints (1 inch) from left margin
+ * [80` = Move to column 80 on LA120
+141 61 a * HPR - Horizontal Position Relative (depends on PUM)
+ [360a = Move 360 decipoints (1/2 inch) from current position
+ * [40a = Move 40 columns to right of current position on LA120
+142 62 b REP - REPeat previous displayable character
+ [80b = Repeat character 80 times
+143 63 c * DA - Device Attributes
+ * [c = Terminal will identify itself
+ * [?1;2c = Terminal is saying it is a VT100 with AVO
+ * [>0c = Secondary DA request (distinguishes VT240 from VT220)
+144 64 d * VPA - Vertical Position Absolute (depends on PUM)
+ [90d = Move to 90 decipoints (1/8 inch) from top margin
+ * [10d = Move to line 10 if before that else line 10 next page
+145 65 e * VPR - Vertical Position Relative (depends on PUM)
+ [720e = Move 720 decipoints (1 inch) down from current position
+ * [6e = Advance 6 lines forward on LA120
+146 66 f * HVP - Horizontal and Vertical Position (depends on PUM)
+ [720,1440f = Move to 1 inch down and 2 inches over (decipoints)
+ * [24;80f = Move to row 24 column 80 if PUM is set to character
+147 67 g * TBC - Tabulation Clear
+ * [0g = Clear horizontal tab stop at current position
+ * [1g = Clear vertical tab stop at current line (LA120)
+ * [2g = Clear all horizontal tab stops on current line only LA120
+ * [3g = Clear all horizontal tab stops in the terminal
+150 68 h * SM - Set Mode (. means permanently set on VT100)
+ [0h = Error, this command is ignored
+ * [1h = GATM - Guarded Area Transmit Mode, send all (VT132)
+ [2h = KAM - Keyboard Action Mode, disable keyboard input
+ [3h = CRM - Control Representation Mode, show all control chars
+ * [4h = IRM - Insertion/Replacement Mode, set insert mode (VT102)
+ [5h = SRTM - Status Report Transfer Mode, report after DCS
+ * [6h = ERM - ERasure Mode, erase protected and unprotected
+ [7h = VEM - Vertical Editing Mode, IL/DL affect previous lines
+ [8h, [9h are reserved
+ [10h = HEM - Horizontal Editing mode, ICH/DCH/IRM go backwards
+ [11h = PUM - Positioning Unit Mode, use decipoints for HVP/etc
+ . [12h = SRM - Send Receive Mode, transmit without local echo
+ [13h = FEAM - Format Effector Action Mode, FE's are stored
+ [14h = FETM - Format Effector Transfer Mode, send only if stored
+ [15h = MATM - Multiple Area Transfer Mode, send all areas
+ * [16h = TTM - Transmit Termination Mode, send scrolling region
+ [17h = SATM - Send Area Transmit Mode, send entire buffer
+ [18h = TSM - Tabulation Stop Mode, lines are independent
+ [19h = EBM - Editing Boundry Mode, all of memory affected
+ * [20h = LNM - Linefeed Newline Mode, LF interpreted as CR LF
+ * [?1h = DECCKM - Cursor Keys Mode, send ESC O A for cursor up
+ * [?2h = DECANM - ANSI Mode, use ESC < to switch VT52 to ANSI
+ * [?3h = DECCOLM - COLumn mode, 132 characters per line
+ * [?4h = DECSCLM - SCrolL Mode, smooth scrolling
+ * [?5h = DECSCNM - SCreeN Mode, black on white background
+ * [?6h = DECOM - Origin Mode, line 1 is relative to scroll region
+ * [?7h = DECAWM - AutoWrap Mode, start newline after column 80
+ * [?8h = DECARM - Auto Repeat Mode, key will autorepeat
+ * [?9h = DECINLM - INterLace Mode, interlaced for taking photos
+ * [?10h = DECEDM - EDit Mode, VT132 is in EDIT mode
+ * [?11h = DECLTM - Line Transmit Mo