-# if ( $?TERM && $?TERM_PROGRAM && $?TERM_PROGRAM_VERSION) then
-# if ( :"$TERM" == :"vt100" && :"$TERM_PROGRAM" == :"Apple_Terminal" ) then
-# if ( :"$TERM_PROGRAM_VERSION" == :41 ) then
-# setenv TERM "nsterm-old"
-# else
-# setenv TERM "nsterm-c-7"
-# endif
-# endif
-# endif
-
-# The '+' entries are building blocks
-nsterm+7|AppKit Terminal.app v41+ basic capabilities w/ASCII charset,
- am, bw, msgr, xenl, xon,
- cols#80, it#8, lines#24,
- bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[J, cr=\r,
- csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
- cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
- cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
- dim=\E[2m, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K,
- el1=\E[1K, home=\E[H, ht=^I, hts=\EH, il=\E[%p1%dL, il1=\E[L,
- ind=\n, invis=\E[8m, kbs=^?, kcub1=\EOD, kcud1=\EOB,
- kcuf1=\EOC, kcuu1=\EOA, kent=\EOM, rc=\E8, rev=\E[7m, ri=\EM,
- rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m,
- rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
- sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?
- %p5%t;2%;%?%p7%t;8%;m,
- sgr0=\E[m, smam=\E[?7h, smkx=\E[?1h\E=, smso=\E[7m,
- smul=\E[4m, tbc=\E[3g, use=vt100+enq, use=vt100+pfkeys,
-
-nsterm+acs|AppKit Terminal.app v41+ basic capabilities w/VT100 alternate-charset,
- acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
- enacs=\E(B\E)0, rmacs=^O,
- sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?
- %p5%t;2%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
- sgr0=\E[m\017, smacs=^N, use=nsterm+7,
-
-nsterm+mac|AppKit Terminal.app v41+ basic capabilities w/MacRoman alternate-charset,
- acsc=+\335\,\334-\366.\3770#`\327a\:f\241g\261h#i
- \360jjkkllmmnno\370p\370q\321rrssttuuvvwwxxy\262z\263{
- \271|\255}\243~\245,
- enacs=\E(B\E)0, rmacs=^O,
- sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?
- %p5%t;2%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
- sgr0=\E[m\017, smacs=^N, use=nsterm+7,
-
-# compare with xterm+sl-twm
-nsterm+s|AppKit Terminal.app v41+ status-line (window titlebar) support,
- wsl#50, use=xterm+sl-twm,
-
-nsterm+c|AppKit Terminal.app v51+ full color support (including 16 colors),
- op=\E[0m, use=ibm+16color,
-
-nsterm+c41|AppKit Terminal.app v41 color support,
- colors#8, ncv#37, pairs#64,
- op=\E[0m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
-
-# These are different combinations of the building blocks
-
-# ASCII charset (-7)
-nsterm-m-7|nsterm-7-m|AppKit Terminal.app v41+ w/ASCII charset (monochrome),
- use=nsterm+7,
-
-nsterm-m-s-7|nsterm-7-m-s|AppKit Terminal.app v41+ w/ASCII charset (monochrome w/statusline),
- use=nsterm+s, use=nsterm+7,
-
-nsterm-7|AppKit Terminal.app v41+ w/ASCII charset (color),
- use=nsterm+c41, use=nsterm+7,
-
-nsterm-7-c|nsterm-c-7|AppKit Terminal.app v51+ w/ASCII charset (full color),
- use=nsterm+c, use=nsterm+7,
-
-nsterm-s-7|nsterm-7-s|AppKit Terminal.app v41+ w/ASCII charset (color w/statusline),
- use=nsterm+s, use=nsterm+c41, use=nsterm+7,
-
-nsterm-c-s-7|nsterm-7-c-s|AppKit Terminal.app v51+ w/ASCII charset (full color w/statusline),
- use=nsterm+s, use=nsterm+c, use=nsterm+7,
-
-# VT100 alternate-charset (-acs)
-nsterm-m-acs|nsterm-acs-m|AppKit Terminal.app v41+ w/VT100 alternate-charset (monochrome),
- use=nsterm+acs,
-
-nsterm-m-s-acs|nsterm-acs-m-s|AppKit Terminal.app v41+ w/VT100 alternate-charset (monochrome w/statusline),
- use=nsterm+s, use=nsterm+acs,
-
-nsterm-acs|AppKit Terminal.app v41+ w/VT100 alternate-charset (color),
- use=nsterm+c41, use=nsterm+acs,
-
-nsterm-c-acs|nsterm-acs-c|AppKit Terminal.app v51+ w/VT100 alternate-charset (full color),
- use=nsterm+c, use=nsterm+acs,
-
-nsterm-s-acs|nsterm-acs-s|AppKit Terminal.app v41+ w/VT100 alternate-charset (color w/statusline),
- use=nsterm+s, use=nsterm+c41, use=nsterm+acs,
-
-nsterm-c-s-acs|nsterm-acs-c-s|AppKit Terminal.app v51+ w/VT100 alternate-charset (full color w/statusline),
- use=nsterm+s, use=nsterm+c, use=nsterm+acs,
-
-# MacRoman charset
-nsterm-m|AppKit Terminal.app v41+ w/MacRoman charset (monochrome),
- use=nsterm+mac,
-
-nsterm-m-s|AppKit Terminal.app v41+ w/MacRoman charset (monochrome w/statusline),
- use=nsterm+s, use=nsterm+mac,
-
-nsterm-old|AppKit Terminal.app v41+ w/MacRoman charset (color),
- use=nsterm+c41, use=nsterm+mac,
-
-nsterm-c|AppKit Terminal.app v51+ w/MacRoman charset (full color),
- use=nsterm+c, use=nsterm+mac,
-
-nsterm-s|AppKit Terminal.app v41+ w/MacRoman charset (color w/statusline),
- use=nsterm+s, use=nsterm+c41, use=nsterm+mac,
-
-nsterm-c-s|AppKit Terminal.app v51+ w/MacRoman charset (full color w/statusline),
- use=nsterm+s, use=nsterm+c, use=nsterm+mac,
-
-# In Mac OS X version 10.5 the format of the preferences has changed
-# and a new, more complex technique is needed, e.g.,
-#
-# python -c 'import sys,objc;NSUserDefaults=objc.lookUpClass(
-# "NSUserDefaults");ud=NSUserDefaults.alloc();
-# ud.init();prefs=ud.persistentDomainForName_(
-# "com.apple.Terminal");prefs["Window Settings"][
-# prefs["Default Window Settings"]]["TerminalType"
-# ]=sys.argv[1];ud.setPersistentDomain_forName_(prefs,
-# "com.apple.Terminal")' nsterm-16color
-#
-# and it is still not settable from the preferences dialog. This is
-# tracked under rdar://problem/7365108 and rdar://problem/7365134
-# in Apple's bug reporter.
-#
-# In OS X 10.7 (Leopard) the TERM which can be set in the preferences dialog
-# defaults to xterm-color. Alternative selections are ansi, dtterm, rxvt,
-# vt52, vt100, vt102 and xterm.
-nsterm-16color|AppKit Terminal.app v240.2+ with Mac OS X version 10.5,
- bw@, mir, npc,
- civis=\E[?25l, cnorm=\E[?25h, dch=\E[%p1%dP, dch1=\E[P,
- flash=\E[?5h$<200/>\E[?5l, hpa=\E[%i%p1%dG,
- ich=\E[%p1%d@, ich1=\E[@, kdch1=\E[3~, kend=\E[F,
- kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~,
- kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, kf17=\E[31~,
- kf18=\E[22~, kf19=\E[33~, kf20=\E[34~, kf5=\E[15~,
- kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, khome=\E[H,
- knp=\E[6~, kpp=\E[5~, rmcup=\E[2J\E[?47l\E8, rmir=\E[4l,
- smcup=\E7\E[?47h, smir=\E[4h, vpa=\E[%i%p1%dd,
- kLFT5=\E[5D, kRIT5=\E[5C, use=nsterm-c-s-acs,
-
-# The versions of Terminal.app in Mac OS X version 10.3.x seem to have
-# the background color erase feature. The newer version 240.2 in Mac OS X
-# version 10.5 does not.
-#
-# This entry is based on newsgroup comments by Alain Bench, Christian Ebert,
-# and D P Schreber comparing to nsterm-c-s-acs.
-#
-# In Mac OS X version 10.4 and earlier, D P Schreber notes that $TERM
-# can be set in Terminal.app, e.g.,
-#
-# defaults write com.apple.Terminal TermCapString nsterm-bce
-#
-# and that it is not set in Terminal's preferences dialog.
-#
-# Modified for OS X 10.8, omitting bw based on testing with tack -TD
-#
-# Notes:
-# * The terminal description matches the default settings.
-# * The keyboard is configurable via a dialog.
-# * By default khome, kend, knext and kprev are honored only with a
-# shift-modifier.
-# * There are bindings for control left/right arrow (but not up/down).
-# Added those to nsterm-16color, which is the version used for OS X 10.6
-# * "Allow VT100 application keypage mode" is by default disabled.
-# There is no way to press keypad-comma unless application mode is enabled
-# and used.
-# * 132-column mode stopped working during vttest's tests. Consider it broken.
-# * CHT, REP, SU, SD are buggy.
-# * ECH works (also in Leopard), but is not used here for compatibility.
-# * The terminal preferences dialog replaces xterm-color by xterm-16color and
-# xterm-256color. However, it adds "nsterm", so it is possible to use the
-# nsterm entry from this file to override the MacPorts (20110404) or
-# system (20081102) copy of this file.
-# + In OS X 10.8 (Mountain Lion) the TERM which can be set in the preferences
-# dialog defaults to xterm-256color. Alternative selections are ansi,
-# dtterm, rxvt, vt52, vt100, vt102, xterm and xterm-16color. However,
-# the menu says "Declare terminal as" without promising to actually emulate
-# the corresponding terminals. Indeed, changing TERM does not affect the
-# emulation itself. This means that
-# + the function-keys do not match for dtterm for kf1-kf4 as well as
-# khome/kend
-# + the color model is the same for each setting of TERM (does not match
-# ansi or dtterm).
-# + the shift/control/meta key modifiers from rxvt and xterm variants are not
-# recognised except for a few special cases, i.e., kRIT5 and kLFT5.
-# + the vt52 emulation does not give a usable shell because screen-clearing
-# does not work as expected.
-# + selecting "xterm" or "xterm-16color" sets TERM to "xterm-256color".
-# + OSX 10.9 (Yosemite) added more extended keys in the default configuration
-# as well as unmasking F10 (which had been used in the window manager). Those
-# keys are listed in this entry.
-nsterm-bce|AppKit Terminal.app v71+/v100.1.8+ with Mac OS X version 10.3/10.4 (bce),
- bce, use=nsterm-16color,
-
-# This is tested with OS X 10.8 (Mountain Lion), 2012/08/11
-# TERM_PROGRAM_VERSION=309
-# Earlier reports state that these differences also apply to OS X 10.7 (Lion),
-# TERM_PROGRAM_VERSION=303
-nsterm-256color|Terminal.app in OS X 10.8,
- use=xterm+256setaf, use=nsterm-bce,
-
-# removed bogus kDC7 -TD
-nsterm-build326|Terminal.app in OS X 10.9,
- kDC=\E[3;2~, kLFT=\E[1;2D, kRIT=\E[1;2C, kcbt=\E[Z,
- kf18=\E[32~, kDC5=\E[3;5~, kLFT3=\Eb, kLFT5=\E[1;5D,
- kRIT3=\Ef, kRIT5=\E[1;5C, use=nsterm-256color,
-
-# actually "343.7"
-nsterm-build343|Terminal.app in OS X 10.10,
- kend=\EOF, khome=\EOH, use=nsterm-build326,
-
-# reviewed Terminal.app in El Capitan (version 2.6 build 361) -TD
-# Using vttest:
-# + no vt52 mode for cursor keys, though vt52 screen works in vttest
-# + f1-f4 map to pf1-pf4
-# + no vt220 support aside from DECTCEM and ECH
-# + there are no protected areas. Forget about anything above vt220.
-# + in ECMA-48 cursor movement, VPR and HPR fail. Others work.
-# + vttest color 11.6.4 and 11.6.5 (bce for ED/EL and ECH/indexing) are bce
-# + but bce fails for 11.6.7.2 (test repeat).
-# + SD (11.6.7.3) also fails, but SL/SR/SU work.
-# + 11.6.6 (test insert/delete char/line with bce) has several failures.
-# + normal (not X10 or Highlight tracking) mouse now works.
-# + mouse any-event works
-# + mouse button-event works
-# + in alternate screen:
-# mode 47/48 work
-# mode 1047 fails to restore cursor position (do not use)
-# mode 1049 fails to restore screen contents (do not use)
-# + dtterm window-modify operations work (some messages are not printed)
-# + dtterm window-report gives size of window in characters/pixels as
-# well as state of window.
-# Using tack:
-# + there is no difference between cnorm/cvvis
-# + has dim/invis/blink (no protect of course)
-# + most function keys with shift/control modifiers give beep
-# (user can configure, but out-of-the-box is what I record)
-# + shift-F5 is \E[25~ through shift-F12 is \E[34~ (skips \E[30~ between
-# F8 and F9).
-# + kLFT5/kRIT5 work, but not up/down with control-modifier
-# + kLFT/kRIT work, but not up/down with shift-modifier
-# + there are a few predefined bindings with Alt, but no clear pattern.
-# + uses alt-key as UTF-8 "meta" something like xterm altSendsEscape
-# Using ncurses test-program with xterm-new:
-# + no italics
-# Using xterm's scripts:
-# + palette for 256-colors is hardcoded.
-# + no support for "dynamic colors"
-# + no support for tcap-query.
-nsterm-build361|Terminal.app in OS X 10.11,
- XT,
- kmous=\E[M, use=nsterm-build343,
-
-# reviewed Terminal.app in High Sierra (version 2.8 build 400) -TD
-# Comparing with build361, little has changed, except that italics work.
-# Direct-color is not supported, by the way.
-#
-# Improved rmso/rmul -TD
-nsterm-build400|Terminal.app in OS X 10.13,
- rmso=\E[27m, rmul=\E[24m, use=xterm+sm+1006,
- use=ecma+italics, use=nsterm-build361,
-
-# This is an alias which should always point to the "current" version
-nsterm|Apple_Terminal|AppKit Terminal.app,
- use=nsterm-build400,
-
-######## iTerm, iTerm2
-
-# iTerm 0.10
-#
-# iTerm.app from http://iterm.sourceforge.net/ is an alternative (and more
-# featureful) terminal emulator for Mac OS X. It is similar enough in
-# capabilities to nsterm-16color that I have derived this description from that
-# one, but as far as I know they share no code. Many of the features are
-# user-configurable, but I attempt only to describe the default configuration
-# (B. Sittler).
-#
-# According to its documentation, iTerm uses terminfo to obtain function key
-# definitions. For example, if it is started with TERM=xterm, it uses key
-# definitons from that terminal description from the local OSX machine. Those
-# $TERM settings may be augmented using the bookmark and profile dialogs.
-# However, the behavior seen with tack does not agree with either the terminfo
-# description or the function keys in its "xterm" profile.
-#
-# NOTES:
-# with vttest:
-# reports primary DA as VT100 with AVO: \E[?1;2c
-# reports secondary DA as "\E[>0;95;c"
-# supports blink and underline
-# displays bold text as red
-# recognizes all dtterm controls for modifying/querying window
-# resizing via escape sequence is very slow
-# supports X11R5 mouse (no X10) and XFree86 mouse (button- and event-tracking)
-# supports X11R5 alternate screen and XFree86 1049 (no 1047/1048)
-# supports CHA, VPA, VPR, but no other ECMA-48 cursor movement such as HPA
-# with tack:
-# .
-# with ncurses test-program:
-# ncurses 'k' has problem in second screen; light background does not fill
-# with xterm scripts
-# can display/alter xterm-256color cube
-# can display/alter xterm-88color cube
-iTerm.app|iterm|iTerm.app terminal emulator for Mac OS X,
- am, bce, hs, mir, msgr, npc, xenl, xon,
- cols#80, it#8, lines#24, wsl#50,
- acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
- bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
- clear=\E[H\E[J, cnorm=\E[?25h, cr=\r,
- csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
- cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
- cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
- dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J,
- el=\E[K, el1=\E[1K, enacs=\E(B\E)0,
- flash=\E[?5h$<200/>\E[?5l, home=\E[H, hpa=\E[%i%p1%dG,
- ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL,
- il1=\E[L, ind=\n, kLFT=\E[1;2D, kRIT=\E[1;2C, kbs=^?,
- kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
- kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~,
- kf11=\E[23~, kf12=\E[24~, kf2=\EOQ, kf3=\EOR, kf4=\EOS,
- kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
- khome=\EOH, knp=\E[6~, kpp=\E[5~, op=\E[0m, rc=\E8,
- rev=\E[7m, ri=\EM, rmacs=^O, rmam=\E[?7l,
- rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>,
- rmso=\E[m, rmul=\E[m,
- rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
- sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?
- %p9%t\016%e\017%;,
- sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smcup=\E7\E[?47h,
- smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m,
- tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c,
- vpa=\E[%i%p1%dd, kEND5=\E[1;5F, kHOM5=\E[1;5H,
- use=xterm+sl-twm, use=vt100+keypad, use=xterm+x11mouse,
- use=xterm+256setaf,