{"id":17101311,"url":"https://github.com/hackerb9/tandy-terminfo","last_synced_at":"2025-04-13T00:03:25.889Z","repository":{"id":43200342,"uuid":"178579082","full_name":"hackerb9/Tandy-Terminfo","owner":"hackerb9","description":"UNIX terminfo for TRS-80 Model 100 and Tandy 200 allowing screen control for TELCOM","archived":false,"fork":false,"pushed_at":"2023-08-03T07:12:47.000Z","size":41537,"stargazers_count":27,"open_issues_count":4,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-13T00:02:22.194Z","etag":null,"topics":["m100","model100","t102","t200","tandy","tandy102","tandy200","telcom","termcap","terminfo","trs80","trs80m100","vt52"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hackerb9.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-03-30T15:51:24.000Z","updated_at":"2025-03-08T07:03:12.000Z","dependencies_parsed_at":"2025-04-13T00:02:13.491Z","dependency_job_id":null,"html_url":"https://github.com/hackerb9/Tandy-Terminfo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerb9%2FTandy-Terminfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerb9%2FTandy-Terminfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerb9%2FTandy-Terminfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerb9%2FTandy-Terminfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hackerb9","download_url":"https://codeload.github.com/hackerb9/Tandy-Terminfo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647222,"owners_count":21139085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["m100","model100","t102","t200","tandy","tandy102","tandy200","telcom","termcap","terminfo","trs80","trs80m100","vt52"],"created_at":"2024-10-14T15:24:44.153Z","updated_at":"2025-04-13T00:03:25.854Z","avatar_url":"https://github.com/hackerb9.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg align=\"right\" src=\"README.md.d/worms-lowres.gif\"\u003e\n\n# Tandy-Terminfo\nTandy Model 100, 102, 200 Terminfo for screen control on UNIX machines\n\n\n## What is this?\n\nWhen using the TELCOM terminal program on a Tandy portable computer\nsuch as the Tandy 200, the remote host needs to know how to send\nescape sequences to do things like clear the screen, move the cursor,\nshow text in reverse, and so on. In UNIX, that information is stored\nin the TERMINFO database and then used by setting the TERM environment\nvariable. \n\nThis repository provides both the [source TERMINFO](tandy.terminfo)\nfile and the [compiled versions](.terminfo/t/). \n\n## Installation\n\nDownload the [source TERMINFO](tandy.terminfo) file and compile it\nwith `tic` on your UNIX host.\n\n    tic tandy.terminfo\n\nThat will create the proper files in your `.terminfo` directory so\nthey can be used immediately.\n\n\n## Usage\n\nSet your TERM environment variable to one of the available terminal\ntypes (see below) to inform programs how to talk to your Tandy. For\nexample,\n\n    export TERM=td200\n\nThere are different terminal types for the Model 100 (`m100`) and the\nModel 200 (`td200`) as those have a different number of lines.\n\n\u003cimg src=\"README.md.d/labelbutton.jpg\" align=\"right\"\u003e\nThere are also different types depending upon whether you have your\nstatus line (\"labels\") disabled or not. By default it is presumed you\nwill disable the status line by pressing the LABEL button. If you do\nnot wish to disable the status line, use the `-s` variant, like so,\n\n    export TERM=td200-s\n\nFor convenience, there are aliases so you can refer to the TERM by\nnumber of lines instead of whether it has a status line (`td200-15`).\n\n\n## The list of available terminals\n\n* `td200`: Tandy Model 200 (no status line). 40 columns x 16 rows.\n  Aliases: `td200-ns`, `td200-16`.\n* `td200-s`: Tandy Model 200 (has status line). 40 columns x 15 rows.\n  Alias:`td200-15`.\n* `m100`: Tandy Model 100 (no status line). 40 columns x 8 rows.\n  Aliases: `m100-ns`, `m100-8`\n* `m100-s`: Tandy Model 100 (has status line). 40 columns x 7 rows.\n  Alias: `m100-7`\n\n\n## Testing\n\nYou can test whether it worked by pressing Control-L. If it clears the\nscreen, then you have correctly installed the TERMINFO files. You can\nalso try running a `curses` program, such as the BSD game \"worms\"\nwhich animates ASCII worms crawling on your screen. (`apt install\nbsdgames`).\n\n\n## Suggestions\n\nWhile setting the `TERM` environment variable will get you most of the\nway to a usable interface, there are some other commands which the\nauthor, hackerb9, recommends running when using a Tandy portable as a\nterminal. You can put these in your `.bash_profile` so they'll be\nsourced when you login or you can put them in a file and use `source\nfilename` to read the commands into your current shell.\n\n### td200 or .bash_profile\n\nHere is a shell script, [td200](td200),\nwhich configures the teminal and sets\nup workarounds for some programs.\nBecause it sets environment variables,\nyou must source it by `source td200` or\n`. td200`.\n\n\u003cdetails\u003e\u003csummary\u003etd200 script\u003c/summary\u003e\n\n    # Set terminal type to Tandy 200\n    export TERM=td200\n    # Send ASCII, not Unicode UTF-8 chars\n    export LANG=C\n    # Reset the terminal (turns off labels)\n    reset\n    # Turn on software flow control (^S/^Q)\n    stty ixon ixoff\n    # Some apps ignore the size in TERMINFO\n    stty rows 16 cols 40\n    # Backspace key sends ^H not ^?\n    stty erase ^H\n    # Right arrow key sends ^\\, so don't use that to abort and dump core.\n    stty quit undef\n    # Translate Carriage Return to Newline (for uploads \u003e N_TTY_BUF_SIZE)\n    stty icrnl\n    # Don't logout when exiting terminal mode in TELCOM\n    stty clocal\n\n    # Workarounds\n    export MANPAGER=more\n    export MANWIDTH=40\n    export GCC_COLORS=\"\"\n    alias nano=\"nano -Opx\"\n    alias w3m=\"w3m -color=0\"\n\n    if [ $SHLVL -gt 1 ]; then\n      echo \"Error, do not run this script.\"\n      echo \"It must be sourced, like so:\"\n      echo -ne \"\\n\\t\"\n      if type $(basename $0)\u003e/dev/null 2\u003e\u00261\n      then\n        echo \". $(basename $0)\"\n      else\n        echo \"source $0\"\n      fi\n      echo\n      exit 1\n    fi\n\u003c/details\u003e\n\nTip 1: If you put the `td200` program\nin your PATH and make it executable,\nyou can source it without specifying\nthe full path. For example, `. td200` .\n\nTip 2: You can automatically source the\ntd200 script from your .bash_profile\nwhen logging in from a serial port like\nso:\n\n    # If logging in from a serial console,\n    # it's my Tandy 200 Portable Computer.\n    if [[ $(tty) =~ /dev/tty(S|ACM) ]]\n    then\n       source $HOME/bin/td200\n    fi\n\n### .inputrc for arrow keys\n\nHackerb9 also recommends adding the\nfollowing to your\n[`.inputrc`](dot.inputrc) so that the\narrow keys will work in Bash and other\nprograms that use libreadline.\n\n\t$if term=td200\n\t    # No ANSI colors for tab completion\n\t    set colored-completion-prefix off\n\n\t    # Bind Model T's TELCOM keys\n\t    Control-^: previous-history\n\t    Control-_: next-history\n\t    Control-]: backward-char\n\t    # Note: Use 'stty quit undef' to make right arrow work.\n\t    Control-\\: forward-char\n\t    # Shift + BkSp to delete next char.\n\t    \"\\d\": delete-char\n\t    # While we're here, disable ANSI colors for tab completion\n\t    set colored-completion-prefix off\n\t$endif\n\n### .emacs for flow control\n\nEmacs by default uses C-s for search. You can tell emacs that the\ntd200 will be using C-s for XON/XOFF flow control by adding this to\nyour .emacs file:\n\n\t;; Tandy 200/100/102 requires\n\t;; XON/XOFF flow control.\n\t(enable-flow-control-on \"td200\" \"m100\" \"td102\")\n\n\n## Notes on using the TELCOM program\n\n* For a standard serial port @9600 baud, type this command in TELCOM:\n\n    stat 88n1enn\n\n* 19200 baud works fine if your UNIX getty is configured to talk that speed:\n\n    stat 98n1enn\n\n* Software flow control (XON/XOFF) is absolutely necessary as the 8250\n  UART has a one byte buffer. If you see text followed by garbage, try\n  `stty ixon ixoff -ixany` .\n\n* Hardware flow control (RTS/CTS) is not available in TELCOM.\n\n* To connect to a PC running UNIX, you'll need a null modem cable.\n\n* The Tandy Model 200 has a *FEMALE* 25 pin RS-232c port.\n\n* You should have no data corruption when using XON/XOFF flow control,\n  no matter how much text is sent. If you do, you may need a new\n  serial adapter on your host computer. Some PC serial cards and USB\n  RS232 adapters do not work with XON/XOFF due to too large of a FIFO\n  (e.g., 16550). The solution is to purchase a higher quality adapter\n  with hardware-level (\"on-chip\") xon/xoff support. UART chips like\n  the 16950 provide this, as do most chips from FTDI, and some\n  ProLific chips.\n\n### Special keys:\n\n    \\    GRPH -          Backslash\n    |    GRPH SHIFT _    Pipe\n    `    GRPH [          Backtick\n    ~    GRPH SHIFT ]    Tilde\n    {    GRPH 9          Open curly brace\n    }    GRPH 0          Close curly brace\n    ^@   GRPH P          Sends 0x80, useful in Emacs to set the mark\n\nNote that Tandy docs say CTRL-@ is supposed to work, but it does not.\n\n\n## Enabling a serial login on Unix systems with systemd and agetty\n\nIf you have a UNIX box running `systemd`, such as Debian GNU/Linux,\nyou can enable a serial port login like so:\n\n    systemctl enable serial-getty@ttyS0\n    systemctl start serial-getty@ttyS0\n\n(For a USB to serial converter, try `ttyUSB0` instead of `ttyS0`.)\n\nWhen you connect with your Tandy portable, you'll see some garbage\ncharacters instead of a Login prompt and need to hit ENTER several\ntimes. This is because getty tries 115,200 then 38,400 and finally\n9600 baud. Every time you hit ENTER it should detect that the speed is\nmismatched and switch to the next one. There is no harm in hitting\nENTER too many times as it won't change baud rate once they match.\n\n### Optional: Change getty's default baud rate\n\nYou may wish to change the default baud rate so that it only connects\nat 9600 baud. Hackerb9 suggests adding 19200 baud to the list since\nthe Tandy 200 can handle that and it is a significant improvement.\n\nTo do that, copy the symlink that `enable` created into a file, make a\nsymlink to the new file (because systemd is overly persnickety), and\nthen edit the file by hand.\n\n\tsudo -s\n    systemctl enable serial-getty@ttyS0\n    cd /etc/systemd/system/getty.target.wants/\n\tcp serial-getty@ttyS0.service ..\n    ln -sf ../serial-getty@ttyS0.service \n    editor serial-getty@ttyS0.service\n\texit\n\nWhen editing, change the line that says:\n\n\tExecStart=-/sbin/agetty -o '-p -- \\\\u' --keep-baud 115200,38400,9600 %I $TERM\n\nto\n\n\tExecStart=-/sbin/agetty -o '-p -- \\\\u' --keep-baud 19200,9600 %I $TERM\n\nTo connect at 19200 baud, you'll need to type this into TELCOM:\n\n    stat 98n1enn\n\n\n## Problems\n\n* If you have trouble with the screen occasionally scrolling, be sure\n  you have the status line turned off by pressing the LABEL button.\n\n* If you are trying to use the arrow keys, many applications will not\n  accept them because Tandy's TELCOM program sends them as simple\n  control-key characters instead of escape sequences.\n\n        key_up=^^, key_down=^_,\n        key_left=^], key_right=^\\,\n\n  However, see the .inputrc workaround above for Bash and other\n  readline programs.\n\n* If control-L clears the screen, but certain programs show\n  uninterpreted escape sequences (e.g., `0;m`), then the problem is\n  that those programs are not using TERMINFO. They are instead\n  presuming there is only one kind of terminal and implementing the\n  escape sequences themselves which not only is redundant work, it is\n  incorrect.\n\n### Reportedly buggy programs\n\n  * man (workaround, `export MANPAGER=more`)\n  * bash's PS1 prompt, tab completion when ambiguous\n  * gcc error messages (workaround, `export GCC_COLORS=\"\"`)\n  * w3m colors (workaround `w3m -color=0` or use **O**ptions to set\n    *Display With Color* to 0)\n  * w3m disables flow control (workaround, w3m-mode in emacs works fine)\n  * git (workaround, disable ANSI color using `git config --add color.ui false`)\n  * nano mumbles about XON/XOFF\n\t(workaround, `nano -p` or `set preserve` in .nanorc)\n  * apt\n  * pacman\n  * ssh disables flow control (workaround, see below).\n\n  You can test if an application is indeed buggy by running `xterm -ti\n  vt52 -tn vt52`. If that terminal shows the same errors as on your\n  Tandy 200, then it is the program that is at fault and you should\n  file a bug report with that project. On the other hand, if xterm's\n  vt52 emulation works (does not show escape sequences), please file a\n  bug with this project. (Bug reports are always appreciated.)\n\n### Ssh disables flow control\n\nBecause `ssh` disables flow control, it will often have garbage shown\non the screen. A workaround is to login from another terminal on the\nlocal host after ssh has started and run:\n\n    stty -F /dev/ttyS0 ixon ixoff\n\n(Where `ttyS0` is the name of the serial port your Tandy is on.)\n\n\n## Further Reading\n\n* terminfo(5) - terminal capability data base\n* tic(1) - the TERMINFO entry-description compiler\n* infocmp(1) - compare or print out TERMINFO descriptions\n* [Tandy 200 TELCOM manual](https://archive.org/details/Telcom_for_Tandy_200_1985_Microsoft)\n  Particularly:\n  * [Table of Escape Sequence Codes](https://archive.org/details/Telcom_for_Tandy_200_1985_Microsoft/page/n48/mode/1up)\n  * [TERMCAP for use with Microsoft Xenix](https://archive.org/details/Telcom_for_Tandy_200_1985_Microsoft/page/n40/mode/1up):\n\n\n## Table of Escape Sequences\n\nThe Escape sequences listed in the official manual were incomplete.\nHere are the escape sequences which hackerb9's Tandy 200 responds to.\n\nSequence | Meaning | Notes\n---------|---------|------\n \\eA     | cursor Up\n \\eB     | cursor Down | ^J may be equivalent.\n \\eC     | cursor Right\n \\eD     | cursor Left | ^H may be equivalent.\n \\eE     | clear screen | \\ej may be equivalent, undocumented in [TELCOM manual](https://archive.org/details/Telcom_for_Tandy_200_1985_Microsoft/page/n48/mode/1up), but this is what the sample TERMCAP in the same manual actually uses.\n \\eF     | ignored | see Alternate Character Set section below\n \\eG     | ignored\n \\eH     | cursor home | Cursor moves to upper left corner\n \\eI     | type answerback id | Types **\"#RSM200\"** on hackerb9's **R**adio-**S**hack **M**odel **200**.\n \\eJ     | clear to the end of screen\n \\eK     | clear to the end of line\n \\eL     | insert line | moves lines below down\n \\eM     | delete line | moves lines below up\n \\eP     | cursor normal\n \\eQ     | cursor invisible\n \\eR     | restore saved line from first buffer | _not documented,_ currently used by dsl to restore status line. May only work on Tandy 200.\n \\eS     | save current line to first buffer | _not documented,_ currently used by dsl to save status line. May only work on Tandy 200.\n \\eT     | enable status line | used in init for variants which have a status line (e.g. td200-s).\n \\eU     | disable status line | used in init_1string for variants which have no status line (e.g. td200).\n \\eV     | disable scrolling | _not used,_ not defined by terminfo. Overwrites bottom line repeatedly. May be useful for downloading large files as it saves one second per kilobyte (18% less time).\n \\eW     | enable scrolling | used in init_2string for `reset`.\n \\eY     | Move to cursor address *r,c* | cursor_address=\\eY%p1%' '%+%c%p2%' '%+%c \u003cbr/\u003e Row and column are sent as single bytes which start at 32 (ASCII space) for zero.\n \\ej     | Clear screen | _not used,_ \\eE is the same\n \\el     | Clear line | _not used,_ terminfo does not define this function. Unlike Delete line (\\eM), this does not close the gap by moving lines up.\n \\ep     | Reverse text\n \\eq     | Normal text\n \\er     | restore saved line from second buffer | _not documented,_ currently unused. May only work on Tandy 200.\n \\es     | save current line to second buffer | _not documented,_ currently unused. May only work on Tandy 200.\n\n### Comparison with VT52\n\nThe TELCOM manual claims the terminal is DEC VT52 compatible, but that\nseems [approximate](compare.vt52). While the cursor movement and\nscreen clearing are the same, it is just different enough to cause\nproblems.\n\n1. Perhaps most noteworthy is that TELCOM uses one of the escape\nsequences, \\eI, the VT52's scroll_reverse (AKA \"reverse index\"), for a\ncompletely different purpose. So, if you are editing a file with\n`TERM=vt52` and you scroll back, your Tandy portable will muck up the\nscreen and type its \"Answerback ID\" into your file.\n\n1. Additionally, the sequences expected for the arrow keys have been\nredefined to control characters. This is rather inconvenient as those\ncontrol characters were already used for other things and it is a\nrather questionable decision to redefine them. \n\n1. A final downside of using the VT52 terminfo file is that extra\ncapabilities that TELCOM has will not be used: reverse mode, delete\nline, toggle status line, and hide cursor.\n\nPerhaps of interest is that the Model T escape sequences seem to\nactually be much closer to a VT52-clone called the the Heathkit H19\n(Zenith Z-19) which Microsoft was known to be using at that time for\ndevelopment. For more information, please see the [h19](h19.md) and\n[h19 comparison](compare.md) pages.\n\n### Alternate Character Set\n\nOne feature supported by the DEC VT52 is Alternate Character Set (ACS)\nmode. ACS uses 7-bit ASCII characters for box drawing and glyphs such\nas π. It would at first glance appear that TELCOM does not support it\nsince the VT52 \\eF and \\eG escape sequences which enter and exit ACS\nare ignored.\n\nHowever, hackerb9 realized it is possible to embed 8-bit codes into\nthe terminfo file and could use Tandy's Extended ASCII to represent\nthose characters directly in the acs_chars string. Here's the mapping\nhackerb9 came up with:\n\n    acs_chars=}\\243.\\231\\,\\233+\\232\n              -\\230h\\345~\\325a\\377\n              f\\246`\\235{\\210q\\361\n              i\\251n\\372m\\366\n              j\\367|\\212g\\2150\\357\n              w\\363u\\371t\\364v\\370\n              l\\360k\\362x\\365,\n\n#### [acschars.c](acschars.c)\n\nHere is a simple [ncurses test program](acschars.c) written by\nhackerb9 which shows all the ACS characters on the screen. It works on\nany terminal, not just Tandy portables. If a terminal were to support\nall the possible ACS characters, the output would look something like:\n\n          NCURSES EXTENDED CHARACTERS\n\n        ↑         Diamond ◆      Scan ⎺⎻─⎼⎽\n      ┌─┬─┐       Board   ⯐      Pi      π\n      │ │ │       CkBoard ▒      PlMinus ±\n     ←├─┼─┤→      Block   █      LEqual  ≤\n      │ │ │       Bullet  ·      GEqual  ≥\n      └─┴─┘       Degree  °      NEqual  ≠\n        ↓         Lantern ɸ      Strling £\n\nTandy's Extended ASCII lacks some of those characters, such as the\nscan lines and Less-Than-or-Equal-To. Ncurses automatically replaces\nundefined ACS chars with similar ASCII, so here's what it looks like\non the Tandy 200:\n\n\u003cimg src=\"README.md.d/acschars.jpg\"\u003e\n\n\n#### ACS Chars as a table\n\nHere is the character mapping represented by the acs_chars string above:\n\nGlyph|Name | VT100\u003cbr/\u003eName | Model 100\u003cbr/\u003echarset\u003cbr/\u003e(octal) | Notes\n--|-----------------------|-----------|---------------------|--------------\n£ |UK pound sign          | }         | \\243\n↓ |arrow pointing down    | .         | \\231\n← |arrow pointing left    | ,         | \\233\n→ |arrow pointing right   | +         | \\232\n↑ |arrow pointing up      | -         | \\230\n⯐ |board of squares       | h         | \\345    | Substitute 2x2 checkerboard\n· |bullet                 | ~         | \\325    | Substitute o-slash (ø)\n▒ |checker board (stipple)| a         | \\377\n° |degree symbol          | f         | \\246\n◆ |diamond                | `         | \\235\n≥ |greater-than-or-equal-to| z        |         | NO TANDY 200 EQUIVALENT\nπ |greek pi               | {         | \\210\n─ |horizontal line        | q         | \\361\nɸ |lantern symbol         | i         | \\251    | Substitute Section symbol\n┼ |large plus or crossover| n         | \\372\n≤ |less-than-or-equal-to  | y         | \\251\n└ |lower left corner      | m         | \\366\n┘ |lower right corner     | j         | \\367\n≠ |not-equal              | \\|        | \\212\n± |plus/minus             | g         | \\215\n⎺ |scan line 1            | o         |         | NO TANDY 200 EQUIVALENT\n⎻ |scan line 3            | p         |         | NO TANDY 200 EQUIVALENT\n⎼ |scan line 7            | r         |         | NO TANDY 200 EQUIVALENT\n⎽ |scan line 9            | s         |         | NO TANDY 200 EQUIVALENT\n█ |solid square block     | 0         | \\357\n┬ |tee pointing down      | w         | \\363\n┤ |tee pointing left      | u         | \\371\n├ |tee pointing right     | t         | \\364\n┴ |tee pointing up        | v         | \\370\n┌ |upper left corner      | l         | \\360\n┐ |upper right corner     | k         | \\362\n│ |vertical line          | x         | \\365\n\n\n## Charmap\n\nHackerb9 has created a new locale charmap. (See `locale -m` and\n`locale(1)`) This lets UTF-8 unicode show up correctly on the Tandy\n200 for any program that uses the GNU C Library. One can also convert\nback and forth between Tandy's Extended ASCII and Unicode characters\nusing `iconv`. Please see [tandy-locale](../tandy-locale) for details.\n\n## History\n\nThis started out as a woefully inadequate TERMCAP entry for\nMicrosoft's Xenix in the back of the TELCOM manual. (Yes,\nMicrosoft had their own flavor of UNIX back then. And you could buy it\nat Radio Shack on their [TRS-80 Model 16](https://archive.org/details/RSC-09_Computer_Catalog_1983_Radio_Shack/page/n3/mode/1up)\ncomputer). Just for historical interest, [here](orig.termcap) is the\noriginal Tandy 16/Xenix termcap entry from [page 72 of the TELCOM Manual](https://archive.org/details/Telcom_for_Tandy_200_1985_Microsoft/page/n40/mode/1up):\n\n    n1|td200|Tandy 200:\\\n      :am:bs:xt:co#40:li#16:al=\\EL:dl=\\EM:cd=^L:ce=\\EK:cl=\\EE:cm=\\EY%+ %+ :\\\n      :nd=^\\:dn=^_:up=\\EA:se=\\Eq:so=\\Ep:kl=^J:kr=^^:ku=^^:kd=^_:\n\n### Differences\n\nUsing captoinfo we can convert the above entry to\n[terminfo](orig.terminfo) and compare it to [the current\nterminfo](tandy.terminfo) for this project. As you can see, there was\na lot hackerb9 was able to add.\n\n    $ infocmp -L -d origtd200 td200 | tr , : | column -t -s:\n    comparing origtd200 to td200.\n        comparing booleans.\n            auto_left_margin        F       T.\n            xon_xoff                F       T.\n        comparing numbers.\n            init_tabs               NULL    8.\n        comparing strings.\n            acs_chars               NULL   '+\\232\\054\\233-\\230.\\2310\\357`\\235a\\377f\\246g\\215h\\345i\\251j\\367k\\362l\\360m\\366n\\372q\\361t\\364u\\371v\\370w\\363x\\365{\\210|\\212}\\243~\\325'.\n            clr_eos                 '^L'   '\\EJ'.\n            cursor_down             '^_'   '\\EB'.\n            cursor_home             NULL   '\\EH'.\n            cursor_invisible        NULL   '\\EQ'.\n            cursor_left             '^H'   '\\ED'.\n            cursor_normal           NULL   '\\EP'.\n            cursor_right            '^\\'   '\\EC'.\n            dis_status_line         NULL   '\\EU\\EY0 \\ES\\EM'.\n            enter_reverse_mode      NULL   '\\Ep'.\n            exit_attribute_mode     NULL   '\\Eq'.\n            init_1string            NULL   '\\EU'.\n            init_2string            NULL   '\\EW\\Eq\\EE'.\n            key_left                '\\n'   '^]'.\n            key_right               '^^'   '^\\'.\n\n## Future\n\nThis will hopefully eventually be added to the official TERMINFO\ndatabases used by BSD and GNU/Linux systems, but it'd be good to find\nout all the undocumented features before doing that. (See Questions\nand TODO below).\n\n\n## Questions\n\n* Why not use TERM=vt52\n\n  While Model T escape codes are very similar to the VT52 — and even\n  more similar to the H19 — Tandy portables are missing important\n  functionality. In particular, full screen programs will send the\n  **Reverse Index** escape code ('\\eI') to try to scroll the text down\n  on the page. TELCOM interprets that as \"Send Answerback\".\n\n* Is it possible to read the Function keys?\n\n  It does not appear so.\n\n* Eight bit codes show up as graphics characters, but they are not in\n  Latin-1 order. Is there something that can be done about that? Yes!\n  Hackerb9 has created a project which sets up a T200 locale which\n  will automatically translate from Unicode to display \"extended\n  ASCII\" characters on the Tandy 200. It works by compiling a gconv\n  module for glibc/iconv. Please see [tandy-locale](../tandy-locale).\n\n* Do all escape sequences (including the undocumented ones) work the\n  same on a Model 100? \n\n  No. It appears the sequences for saving and restoring an entire line\n  do not exist. \n\n\n## TODO\n\n* Figure out why man pages have `\\e[m` sent at the end of each line,\n  but *only* when my PAGER is `less`. Note that `nroff | less` doesn't\n  have the same problem.\n\n* Maybe report bugs to projects which presume ANSI colors are always\n  available. Why don't programs like `git` link with ncurses?\n\n* Maybe get cursor keys working in Emacs.\n\n  Cursor keys work in vi, but not in Emacs. Emacs is doing something\n  clever to get around xon/xoff brain damage. Right (^]) takes over\n  for Search Forward (normally ^S) and Up (^^) is bound to quote next\n  character (usually ^Q). This is actually kind of handy for me since\n  I never use the arrow keys. I just wish they had bound one of the\n  others to run Help, since that is missing as ^H.\n\n\n## Implementation Notes\n\n* What Tandy calls \"LABELS\" hackerb9 calls a\n  \"Status Line\" because in terminfo\n  parlance \"Soft Labels\" is for text\n  above reprogrammable Function keys.\n  From a Unix program's perspective,\n  the Tandy Function keys are\n  immutable. While \"Status Line\" is\n  not quite correct as it doesn't\n  show any status, it is more correct\n  than the alternatives.\n\n* Terminfo allows codes to overwrite\n  the status line using tsl/fsl. We\n  could implement tsl, but how would\n  we define fsl which is\n  supposed to pop back to the\n  previous cursor location. Since\n  ncurses never uses tsl/fsl, there's\n  probably also no point in trying.\n\n  For anyone who cares to try, the\n  following will overwrite your\n  status line for one second and then\n  restore it.\n\n\t  echo $'\\eU\\eY0 \\eS\\eM'$(date)$'\\eT'\n\t  sleep 1\n\t  echo $'\\eU\\eY0 \\eR\\eT'\n\n* Why hackerb9 overloaded dsl:\n\n  Terminfo doesn't support enabling status lines (a strange lack). It\n  can, however, disable them with \"dsl\". dsl is used in this standard\n  way for the terminal types without a status line (e.g., `td200`).\n\n  However, hackerb9 made a kludge that seems to work pretty well: the\n  \"dsl\" sequence for variants _with_ status lines (e.g., `td200-s`)\n  actually enables it.\n\n  Just for fun, my dsl strings also\n  save and restore the labels in the\n  status line using the undocumented\n  \\eS and \\eR escape sequence. This\n  works to properly turn off the\n  status line then to re-enable it on\n  my Tandy 200 (but I have not tested\n  a Model 100 or 102):\n\n      $ TERM=td200\n      $ tput dsl\n      $ TERM=td200-s\n      $ tput dsl\n\n  By default, the Tandy terminals do *not* rewrite the status line\n  when it is enabled with an escape sequence. That means you would not\n  get back the line that says \"Prev Down Up Full\".\n\n* Reminder to self: although scroll backward can be faked with HOME,\n  Insert Line (\\eH\\eL), there's no point in doing it since ncurses\n  is smart enough to do it for us.\n\n* The `td200` entry defaults to presuming the status line is _off_\n  (which is the preferred way to use it), not _on_ (which is how the\n  TELCOM software always starts up). \n\n* Why `clocal` is suggested and included in the [td200](td200) script.\n  When UNIX detects that a serial login has disconnected, it sends the\n  HUP (hangup) signal to the user's processes and logs the user out.\n  Unfortunately, exiting to the MENU from TELCOM (even if we answer\n  \"no\" to the \"disconnect?\" question) will trigger this. Fortunately,\n  there's a workaround, tell UNIX this is a \"local\" terminal, not a\n  modem: `stty clocal`.\n\n  [Technically, exiting from TELCOM to the MENU drops the DTR (\"Data\n  Terminal Ready\") line on the serial port. DTR is wired to the UNIX\n  box's DCD (\"Data Carrier Detect\"). Back in the days of modems, it\n  was critical to detect when carrier was dropped, otherwise the next\n  person dialing in would get the previous person's session, already\n  logged in!]\n\n  With clocal set, one can interact with a remote program using a\n  different Tandy 200 program, such as BASIC. As a simple example, if\n  one wants to upload the ASCII version of a Tandy BASIC program, they\n  could do the following:\n\n  1. In TELCOM, login to foreign host.\n  1. `cat \u003e somefilename.txt`\n  1. Exit TELCOM (F8), then switch to BASIC.\n  1. `LOAD \"PROGNAME.BA\"`\n  1. `SAVE \"COM:98N1E\",A`\n  1. Exit BASIC (F8), run TELCOM, and reconnect (F4).\n  1. Press Control-D (at the beginning of a newline)\n     to finish writing to `somefilename.txt`.\n\n  [Thank you to @Dawidi for this tip!]\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackerb9%2Ftandy-terminfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackerb9%2Ftandy-terminfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackerb9%2Ftandy-terminfo/lists"}