{"id":22729854,"url":"https://github.com/jhpyle/mtcp","last_synced_at":"2025-04-13T23:13:59.920Z","repository":{"id":41450995,"uuid":"262709989","full_name":"jhpyle/mTCP","owner":"jhpyle","description":"Unofficial fork of https://www.brutman.com/mTCP with terminal emulator changes","archived":false,"fork":false,"pushed_at":"2024-11-19T03:45:08.000Z","size":3327,"stargazers_count":34,"open_issues_count":1,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-13T23:13:47.485Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jhpyle.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}},"created_at":"2020-05-10T04:13:56.000Z","updated_at":"2025-02-28T01:26:26.000Z","dependencies_parsed_at":"2024-12-10T18:12:12.284Z","dependency_job_id":"78ef1762-d9d5-47a1-8408-b5ddecb42c90","html_url":"https://github.com/jhpyle/mTCP","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/jhpyle%2FmTCP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhpyle%2FmTCP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhpyle%2FmTCP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhpyle%2FmTCP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhpyle","download_url":"https://codeload.github.com/jhpyle/mTCP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248794569,"owners_count":21162615,"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":[],"created_at":"2024-12-10T18:12:08.494Z","updated_at":"2025-04-13T23:13:59.890Z","avatar_url":"https://github.com/jhpyle.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jhpyle/mTCP\n\nThis is an unofficial fork of the Telnet application from Michael\nB. Brutman's [mTCP].  It adds:\n\n* [Enhanced Keyboard] support\n* Mouse and clipboard support\n* Translation of incoming Unicode characters\n* [Sixel graphics]\n* Printer support\n\nThe binary is available as the [TELNET.EXE] file and the\n[TELNETNU.EXE] file, which are in the [bin] directory.  The\n[TELNETNU.EXE] file is the same as [TELNET.EXE] except that it\ndisables Unicode translation.\n\nThe fork is based on the [mTCP-src_2022-07-01.zip] version of [mTCP].\n\n## The changes\n\nThe purpose of this repository is to expand the `ansi` terminal\nemulation capabilities of [mTCP]'s Telnet application.  Where a\nfeature is not supported by the `ansi` standard, ideas are borrowed\nfrom the `xterm` standard.\n\n### Keyboard\n\nThe following keys are transmitted:\n\n* Function keys F1-F12;\n* Insert, Delete, Home, End, Page Up, Page Down;\n* Cursor keys;\n* Shift, Ctrl, Ctrl-shift, Alt, and Alt-Shift modifications of the above;\n* Tab, Ctrl-Tab, Shift-Tab;\n* Ctrl-Backspace;\n* Ctrl-Space; and\n* Ctrl-PrtScr.\n\nIn the official [mTCP], Page Up and Page Down scroll are not passed\nthrough but are used for scrolling through the output history.  In\nthis version, that function is moved to the Alt-Page Up and Alt-Page\nDown keys (or Ctrl-Page Up and Ctrl-Page Dn if the [Enhanced Keyboard]\nis not available), and Page Up and Page Down are passed through to the\nserver.\n\nFor compatibility with [Emacs], all Alt-(key) combinations that are\nnot used by the Telnet application are passed through as ESC-(key).\n\nThe Delete key is passed through as `ESC [ 3 ~` instead of the default\nof character 127.\n\nSome of the above keys are not available if your computer lacks\nsupport for the [Enhanced Keyboard].\n\n### Mouse\n\nMouse support is available in two forms.\n\nFirst, if the server sends back `xterm` [DECSET] signals to enable\nmouse tracking, mouse activity is transmitted to the server using\n`xterm` escape sequences.  [Emacs] sends these sequences when\n`xterm-mouse-mode` is in use, and [Vim] sends them when `set mouse=a`\nis used.  [Midnight Commander] provides mouse support if the `-x` switch\nis used to enable `xterm` mode.\n\nSecond, if the [DECSET] signals are not received, mouse activity does\nnot result in escape sequences sent to the terminal, but the mouse can\nbe used for copying and pasting.  The controls are:\n\n* Left-click and drag to select a region;\n* Right-click to extend a selection;\n* Double-click to select a word;\n* Triple-click to select a line; and\n* Middle-click to paste the selection.\n\nClicking the left and right mouse buttons at the same time emulates\nthe middle mouse button.\n\nFor mouse support to work, you may need to install a mouse driver\n(typically [MOUSE.COM]) before running [TELNET.EXE] or [TELNETNU.EXE].\n\n### Unicode\n\nWhen UTF-8 characters are received, they are translated if possible\ninto one of the 256 characters that can be displayed in text mode.  By\ndefault, Unicode characters are translated into [Code Page 437].  If\nno translation is available, a default character, `¿`, is printed.\n\nUnicode translation does not take place when sending outbound\ncharacters.\n\nIf you are connected to server that sends \"extended ASCII\" characters\n(codes greater than 127) with the expectation that your Telnet client\nwill display them directly to video memory (e.g., as [Code Page 437]\ncharacter), `TELNET.EXE` will misinterpret these codes as the\nfirst byte of a Unicode sequence. Thus, you will get garbage on the\nscreen. If you need to to connect to a server that sends \"extended\nASCII\" characters, use `TELNETNU.EXE`.\n\nThe [Code Page] and the default unprintable character are\nconfigurable in the `MTCP.CFG` file using the directives\n`TELNET_UTF`, `TELNET_CODEPAGE`, and `TELNET_UTF_DEFAULT`.  For\nexample, the following excerpt demonstrates enabling [Code Page 737]\ntranslation in place of the default [Code Page 437], and setting the\ndefault character for unprintable Unicode sequences to the space\n(0x20).\n\n    TELNET_CODEPAGE 737\n    TELNET_UTF_DEFAULT 0x20\n    TELNET_UTF 737 0x0000 0x00\n    TELNET_UTF 737 0x0001 0x01\n    TELNET_UTF 737 0x0002 0x02\n    TELNET_UTF 737 0x0003 0x03\n    ...\n    TELNET_UTF 737 0x00a0 0xff\n\nThere are complete example configurations in the [`config`] folder for\n[Code Page 737], [Code Page 775], [Code Page 850], [Code Page 852],\n[Code Page 855], [Code Page 857] [Code Page 860], [Code Page 861],\n[Code Page 862], [Code Page 863], [Code Page 864], [Code Page 865],\n[Code Page 866], [Code Page 869], and [Code Page 874].  A file is also\nincluded for [Code Page 437] in case you want to customize the default\ntranslation.\n\nYou can copy and paste from these files into your `MTCP.CFG` file.\nThe `TELNET_CODEPAGE` directive selects a code page, and any\ndirectives beginning with `TELNET_UTF` will be used to define the\ntranslations that are used.  The format of each line is:\n\n    TELNET_UTF \u003cCODE_PAGE_NUMBER\u003e \u003cUNICODE_NUMBER\u003e \u003cCHARACTER_NUMBER\u003e\n\nwhere `CODE_PAGE_NUMBER` is the number of the code page (e.g. 737),\nthe `UNICODE_NUMBER` is a hexadecimal Unicode number (e.g., `0x266a`\nfor the musical note character) and `CHARACTER_NUMBER` is a\nhexadecimal 8-bit number representing the character on the screen\n(e.g., `0x0d` for the musical note character).  Note that the\n`TELNET_CODEPAGE` directive will not have any effect in the absence of\n`TELNET_UTF` lines that define the translations for the code page.\n\nFor best results, sort your `TELNET_UTF` lines by the Unicode\nnumbers. If they are out of order, they will need to be sorted when\nTelnet starts, which extends the start time.\n\nThe `TELNET_UTF_DEFAULT` directive indicates which character should be\nprinted if there is no translation for a particular Unicode character.\nThe number must be written in hexadecimal.  The default is `0xa8`,\nwhich is the character ¿ in [Code Page 437].\n\nIf you switch between code pages, you can keep definitions for several\ncode pages in your `MTCP.CFG` file and change only the\n`TELNET_CODEPAGE` line when you want to switch among them.\n\nDepending on what applications you use and what content you view, you\nmay wish to modify the standard Unicode translations, add additional\ncharacters, or add additional code pages.\n\nThe code page translations in the [`config`] folder were created using\ntranslation tables available on [unicode.org].\n\n### Graphics\n\nIf a [Sixel graphics] escape sequence is encountered, the image will\nbe downloaded and then displayed on the screen.  It may take\nsignificant time for the image to download.  While the image is\ndownloading, the screen is unchanged; this is so that you can keep\nreading what is on the screen while you wait for the graphics image to\nappear.  After viewing the image, you can then press any key to get\nback to text mode.\n\nThe supported graphics modes are:\n\n* 720x348x2 - requires a [Hercules Graphics Card]\n* 320x200x256 - requires [VGA] or [MCGA]\n* 640x480x2 - requires [VGA] or [MCGA]\n* 320x200x4 - [CGA]\n* 640x200x2 - [CGA]\n\nTelnet will use the highest resolution graphics mode available, given\nthe number of colors in the image.  If there are two colors, it will\nuse a two-color graphics mode.  If there are four colors, it will use\na 320x200x4 mode with the matching palette.\n\nTelnet does not autodetect whether you have a [Hercules Graphics\nCard], [VGA], or [MCGA].  By default, it assumes you have [VGA] or\n[MCGA] and it will try to display images in the [VGA]/[MCGA] modes.\n\nIf your computer does not support the [VGA]/[MCGA] modes, you will\nneed to add a line to your `MTCP.CFG` file to stop it from using those\nmodes.  If you have a [CGA] adapter, set the following:\n\n    TELNET_CGA 1\n\nIf you have a [Hercules Graphics Card], set the following instead:\n\n    TELNET_HGC 1\n\nTelnet will not do any image resizing or dithering.  If an image is\nwider or taller than the graphics mode supports, then it will not\ndisplay.\n\nFor best results when connected to a Linux machine, use the included\n[show] script to convert an image file to [Sixel] escape sequences.\nThis script calls the [`img2sixel`] command with the appropriate\nparameters for resizing images and converting colors.\n\nWithout any parameters, [show] will display an image in 256 colors.\n\n    show my_image.png\n\nIf you have the [Hercules Graphics Card], use the `--hercules` switch:\n\n    show --hercules my_mono_image.png\n\nIf you have [CGA] graphics only, use the `--cga` switch so that color\nimages are reduced to four colors.\n\n    show --cga my_image.png\n\nBy default, [show] will use the bright cyan/magenta/white palette in\n`--cga` mode.  You can tell it to use a different palette with the\n`--colors` switch:\n\n    show --colors CyanMagenta my_image.png\n    show --colors LightCyanMagenta my_image.png\n    show --colors GreenRed my_image.png\n    show --colors LightGreenRed my_image.png\n\nTo make an image display in monochrome, use the `--mono` switch:\n\n    show --mono my_mono_image.png\n\nBy default, the `--mono` switch will shrink the image to fit in\n640x480, which [VGA] and [MCGA] monitors can display.  If you have\n[CGA] only, make sure to include the `--cga` switch:\n\n    show --mono --cga my_mono_image.png\n\nThis will resize the image to fit within [CGA]'s 640x200 resolution.\n\nWith the `--me` parameter, [show] will take a picture with\n`/dev/video0` and then display it:\n\n    show --me\n\nTo see the usage instructions, call `show` with the `--help` switch.\n\n    show --help\n\nFor instructions on installing the [show] utility and integrating it\nwith applications, see the Setup section below.\n\nThe [show] utility is a [bash] script, so you can edit it. You can\nchange the script so that you do not have to provide any flags to get\nthe image format you want.\n\n### Printing\n\nHistorically, the typewriter preceded the computer, and the [first\nterminals] acted like typewriters, printing characters to paper rather\nthan to a screen.  Early video terminals, like the [VT52] and [VT100],\nsupported connecting a printer to the terminal, and could switch into\na mode in which incoming characters were sent to the printer and the\nuser could create a \"hardcopy\" of the session.  When the [VT100]\nterminal received `ESC [ 5 i`, all characters received thereafter\nwould be relayed to the attached printer.  When the terminal received\n`ESC [ 4 i`, the terminal would stop relaying the characters to the\nprinter.  The `ansi` and `xterm` protocols incorporated this feature.\n\nThis version of [mTCP] Telnet has been modified to provide support for\nthis method of printing.  By default, printing is disabled, however,\nso that even if the remote server sends `ESC [ 5 i`, the printer will\nnot print anything.  Pressing Alt-P toggles the enabling and disabling\nof printing.  You can see whether printing is enabled by visiting the\nhelp screen (Alt-H).  If printing is enabled and the remote server\nsends `ESC [ 5 i`, Telnet will start sending all received characters\nto the LPT1 printer.  It will continue to do so until it receives `ESC\n[ 4 i`.  Characters will also be sent to the screen.\n\nIf your printer requires initialization, you can add a\n`TELNET_PRINTER_INIT` line to your `MTCP.CFG` file, listing a series\nof ASCII characters expressed as two-digit hexadecimal numbers\nseparated by commas.  For example, these are printer initialization\ncodes for a Diablo 630 printer.\n\n```\nTELNET_PRINTER_INIT 1b,51,0d,1b,1f,0b,1b,1e,09,1b,35\n```\n\nUp to sixteen ASCII characters can be defined using\n`TELNET_PRINTER_INIT`.  These characters are sent to the printer the\nfirst time you type Alt-P to enable printing.\n\nThis repository contains a Python script, [tprint], that can be used\nto print a file or an output stream.  You can call it either as a pipe\nor you can give it the name of one or more files:\n\n    ps ax | tprint\n    tprint foo.txt\n    tprint foo.txt bar.txt\n    tprint *.msg\n\nIn addition, this repository contains two [bash] scripts, [startprint]\nand [stopprint], which echo the escape sequences for turning printing\non and off.  As explained in \"Configuring your applications,\" below,\nyou can also bind keys in [bash] for turning printing on and off.\n\n## Compatibility\n\nThis package has been tested on:\n\n* [IBM PS/2 Model 25] with an 8086 processor running PC-DOS 4.0 and\n  Microsoft Mouse Driver ([MOUSE.COM]) version 7.03.\n* [IBM PC model 5150] with the [Hercules Graphics Card].\n\nUnfortunately, I do not have access to other machines, so I do not\nknow what problems may arise on other systems.  Please feel free to\ncreate GitHub issues to let me know what doesn't work.\n\nAs discussed above, you will need to add `TELNET_HGC 1` or\n`TELNET_CGA 1` to your `MTCP.CFG` file if you have a [Hercules\nGraphics Card] or [CGA] adapter in your system.\n\n[EGA] is currently not supported, because I do not own an [EGA] card\nor [EGA]-compatible monitor.\n\n## Performance\n\nThis version of mTCP Telnet is not as fast as the official mTCP\nTelnet, so you may see that screens do not draw as fast.\n\nThe reason for the slowness is due to the increased feature\nsupport. In the main loop of the Telnet application, there are more\nif/else statements that need to run in order to support additional\nincoming escape sequences, process multi-byte Unicode sequences,\nsupport the mouse feature, and support the printing feature.\n\nIf the server you are connected to sends UTF-8 instead of [Code Page\n437] \"extended ASCII\" characters, it will send two or three bytes\ninstead of one byte to draw one character, so screen draws may appear\nslower just because more bytes need to be transferred.\n\nIf you can think of ways the code can run more efficiently while\nsupporting the same set of features, feel free to create a GitHub pull\nrequest.\n\n## Setup\n\nIn order for your Telnet client and remote servers to communicate\neffectively using escape sequences for colors, mouse support, and\nkeypresses, the remote machines will need to know the precise\ncapabilities of your Telnet client.  On Linux, terminal capabilites\nare defined in a \"terminfo\" file.  The `TERM` variable in your remote\nshell environment tells the remote machine which \"terminfo\" file to\nuse.  `TERM` is typically set to a value like `ansi`, `vt320`, or\n`xterm`.  Terminal-based applications use the `TERM` variable to\ndecide what features will be enabled and how they will communicate\nwith you.\n\nThe Telnet client reports its terminal type as `ANSI`.  This can be\nchanged by setting the variable `TELNET_TERMTYPE` in the `MTCP.CFG`\nfile, but it is generally better to keep it as `ANSI`.  Many\nterminal-based applications look at the `TERM` variable and expect it\nto be set to a standard value like `xterm`, `vt100`, or `ansi`, so you\nare generally better off using a standard terminal type like `ANSI`.\n\nThe `ANSI` standard is not well-defined.  There are many variants, and\nthe one that this Telnet uses is its own variant.  In order to use all\nof the features of this Telnet's ANSI terminal emulation, you need to\ncreate your own \"terminfo\" file.  This package contains the source\ncode for this \"terminfo\" file ([ansi.src]).\n\nOn every Linux machine to which you might want to connect (directly\nwith Telnet or indirectly with [ssh]), install the `ansi` \"terminfo\"\nfile and the [show] script.\n\nYou can do this by cloning the GitHub repository with `git` and\nrunning `./install.sh` as root.  If you don't have `git` installed,\nyou can install it with `sudo apt-get install git`.\n\nThe [install.sh] script copies [show] to `/usr/local/bin`, installs\ncolor map PNG files in `/usr/local/share/sixel`, and compiles and\ninstalls the `ansi` \"terminfo\" file using `tic`.\n\nThe [show] script depends on `libsixel-bin` (for `img2sixel`),\n`libimage-size-perl` (for `imgsize`), and `streamer` (for the `--me`)\noption.  The installation of the `ansi` \"terminfo\" file depends on the\n`tic` command, which is available in `ncurses-bin`.\n\n    sudo apt-get install libsixel-bin libimage-size-perl streamer ncurses-bin\n    git clone https://github.com/jhpyle/mTCP\n    cd mTCP\n    sudo ./install.sh\n    cd ..\n\nThe names of these packages and the application for installing\npackages (in this example, `apt-get`) might be different on your\nmachines, so you may need to revise this.\n\nIf `/usr/local/bin` is not part of your `PATH` (try `echo $PATH` to\nsee what your `PATH` is) you might want to edit the install script so\nthat it installs the `show` script elsewhere.\n\n### Manual installation\n\nIf you want to install the [show] script manually, run commands\nequivalent to the following:\n\n    git clone https://github.com/jhpyle/mTCP\n    sudo install mTCP/sixel/show /usr/local/bin\n    sudo mkdir -p /usr/local/share/sixel\n    sudo install -m 644 mTCP/sixel/*.png /usr/local/share/sixel\n\nThe [show] script needs to go into a directory that is in your `PATH`.\nThe PNG files can go in any directory, but if you put them in a\ndirectory other than `/usr/local/share/sixel`, make sure you edit the\n[show] script to change the definition of `COLORMAPS` so that it\npoints to the directory you are using.\n\nTo install the `ansi` \"terminfo\" file manually, compile the `ansi.src`\nfile with `tic`:\n\n    sudo tic -x -o/etc/terminfo mTCP/ansi.src\n\nHere, `/etc/terminfo` is the directory where custom terminfo\ndescription files are installed.  It might be located in a different\ndirectory on your system.\n\nThis will override the standard terminfo file that is used when the\n`TERM` environment variable is set to `ansi`.\n\nIf you do not have administrator access on the machine, you can\ninstall the terminfo description for yourself only.  You can do this\nby running:\n\n    tic -x mTCP/ansi.src\n\nThis will compile the [ansi.src] file and create the terminfo\ndescription file `~/.terminfo/a/ansi`.\n\nAfter installing the terminfo file, you can run `rm ansi.src` because\nyou will not need the `ansi.src` file any longer (unless you would\nlike to edit it).\n\nTo install the [tprint], [startprint], and [stopprint] utilities\nmanually, run commands equivalent to the following:\n\n    sudo install mTCP/printing/tprint /usr/local/bin\n    sudo install mTCP/printing/stopprint /usr/local/bin\n    sudo install mTCP/printing/startprint /usr/local/bin\n\n### Configuring your applications\n\nThe \"terminfo\" file, on its own, is not sufficient for all of your\nLinux applications to work appropriately with the Telnet client.  Many\napplications look at the `TERM` environment variable but bypass the\n\"terminfo\" system.  You will need to edit the configuration files of\nyour applications to get the most out of Telnet.\n\nTo improve your [bash] command line experience, add this to your\n`~/.inputrc` file:\n\n    \"\\e[7;5~\" backward-kill-word\n    \"\\e[3;2~\" delete-char\n    \"\\e[3;5~\" kill-word\n    \"\\e[5~\": beginning-of-history\n    \"\\e[6~\": end-of-history\n\nIf you don't have an `~/.inputrc` file, you can create one with just\nthese lines in it.  This will allow you to type Ctrl-Backspace, Delete,\nCtrl-Delete, Page Up, and Page Down on the command line.\n\nIf you use [Emacs], download [ansi.el].\n\n    curl -o ansi.el https://github.com/jhpyle/mTCP/blob/master/ansi.el\n\nIncorporate the contents of this file into your `.emacs` file.  This\nwill ensure that [Emacs] will recognize the control sequences that the\nTelnet client will send.\n\nIf you are using [Vim], add the following to your `.vimrc` file:\n\n    if \u0026term =~ \"ansi\"\n      set mouse=a\n    endif\n\nHowever, I was not able to get [Vim] to respect this setting unless I\nset `TERM=xterm`, which is not ideal because [mTCP]'s screen-updating\nmechanism uses `ansi` sequences rather than `xterm` sequences.\n\nModify your `.bashrc` to add the following before the part that\nreferences `force_color_prompt`:\n\n    if [ \"$TERM\" = \"ansi\" ]; then\n        force_color_prompt=yes\n    fi\n\nIf you would prefer a monochrome prompt, leave out\n`force_color_prompt=yes`.\n\nIf you want to toggle printing while using [bash] using keystrokes,\nyou can add the following to your `.bashrc` file:\n\n    bind -x '\"\\eOP\":\"echo -n -e \\\\e[5i\"'\n    bind -x '\"\\eOQ\":\"echo -n -e \\\\e[4i\"'\n\nThis tells [bash] that when you press F1, it should send the escape\nsequence for turning printing on, and when you press F2, it should send\nthe escape sequence for turning printing off.\n\nAdd a `.mailcap` file to your home directory that contains:\n\n    image/*; show %s\n\nThis will signal to other applications that the [show] command should\nbe used to display images.\n\nIf you are using [Lynx], you can set `USE_MOUSE:TRUE` in your\n`/etc/lynx.cfg` file to enable mouse support.\n\nYou can also view images using [Sixel graphics] while using [Lynx].\nYou can press `*` to show links to images, or set\n`MAKE_LINKS_FOR_ALL_IMAGES:TRUE` in your `/etc/lynx.cfg` file to turn\nthis feature on by default.  When you click on a link to an image,\nyour `~/.mailcap` file will be consulted and the [show] command will be\nused to show the image.\n\nYou can also view images while using [Links].  To set this up, go to\nthe Setup menu (press Escape to open the menu bar) and go to\nAssociations.  Then you can add file associations for images.  The\nfirst \"Label\" should be, e.g., \"PNG,\" and the \"Content-Type\" should be\n`image/png`, and \"Program\" should be `show %`.  Unselect \"Block\nterminal while program running\" (this causes problems).  Make sure\nthat \"Run on terminal\" is selected.  Unselect \"Ask before opening.\"\nDon't select \"Accepts HTTP URLs\" or \"Accepts FTP URLs.\"  Then save the\nAssociation and repeat the process for `image/jpeg` and `image/gif`.\nThen do \"Save options\" under \"Setup.\"  This will create a file\n`~/.links2/links.cfg`.  The file will contain something like the\nfollowing:\n\n    association \"PNG\" \"image/png\" \"show %\" 11 1\n    association \"JPEG\" \"image/jpeg\" \"show %\" 11 1\n    association \"GIF\" \"image/gif\" \"show %\" 11 1\n\nImage support is a little better in [Lynx] than it is on [Links]\nbecause it will show a link to an image that is itself a hyperlink.\n\nIf you use Midnight Commander, you can edit the file\n`/usr/lib/mc/ext.d/image.sh` and change this line:\n\n    (\"${MC_XDG_OPEN}\" \"${MC_EXT_FILENAME}\" \u003e/dev/null 2\u003e\u00261) || \\\n\nto:\n\n    (\"${MC_XDG_OPEN}\" \"${MC_EXT_FILENAME}\") || \\\n\nThen, if your `~/.mailcap` has been set up as discussed above, the\n`xdg-open` command will run `show` in the terminal when you open an\nimage file.\n\nIf you use [R], you might want to use this shorthand for showing a\n[ggplot2] image:\n\n    sx \u003c- function(){\n      ggsave(\"graph.png\", width=3.2, height=2.4)\n      system(\"show graph.png\")\n    }\n\n## Compiling\n\nI compiled [TELNET.EXE] and [TELNETNU.EXE] using [Open Watcom 1.9]\ninside [DosBox] on a Linux machine.\n\nI created a folder `~/dos` and installed Watcom under `~/dos/WATCOM`\nand installed the [mTCP] source code under `~/dos/MTCP`.  I used the default\nDosBox configuration (see `~/.dosbox`) with this at the end:\n\n    [autoexec]\n    # Lines in this section will be run at startup.\n    # You can put your MOUNT lines here.\n    @echo off\n    mount c ~/dos\n    SET PATH=C:\\WATCOM\\BINW\n    SET WATCOM=C:\\WATCOM\n    SET INCLUDE=C:\\WATCOM\\H;C:\\MTCP\\TCPINC;C:\\MTCP\\INCLUDE\n    C:\\\n    CD C:\\MTCP\\APPS\\TELNET\n\nThe COMMAND.COM in [DosBox] limits command lines to 128 characters and\nthere does not appear to be a way to change this.  So I had to modify\nthe [MAKEFILE] by commenting out this line:\n\n    compile_options += -i=$(tcp_h_dir) -i=$(common_h_dir)\n\nIn its place, I used the `INCLUDE` environment variable to let the\ncompiler know where the `.h` files are.\n\nThen I was able to compile Telnet by running `wmake` from the\n`~/dos/MTCP/APPS/TELNET` directory.\n\nI created a batch file called `MAKE.BAT` to recompile only the parts I was editing:\n\n    del telnet.exe\n    del telnet.obj\n    del telnetsc.obj\n    del telnetsx.obj\n    del telnet.map\n    del misc.obj\n    wmake telnet.exe config=UTF.H\n\nThis is much faster than waiting for a full `wmake` to complete.\n\nTo build a version of `telnet.exe` without the Unicode translation feature\nsupport, use the `NOUTF.H` file instead of `UTF.H`.\n\nFor a final build, run `wmake` and then `wmake patch`, and generate\nboth `TELNETNU.EXE` and `TELNET.EXE`.  (See the file `MAKEALL.BAT`.)\n\n[ansi.src]: https://github.com/jhpyle/mTCP/blob/master/ansi.src\n[MAKEFILE]: https://github.com/jhpyle/mTCP/blob/master/MTCP/APPS/TELNET/MAKEFILE\n[TELNET.EXE]: https://github.com/jhpyle/mTCP/blob/master/bin/telnet.exe\n[TELNETNU.EXE]: https://github.com/jhpyle/mTCP/blob/master/bin/telnetnu.exe\n[bin]: https://github.com/jhpyle/mTCP/blob/master/bin\n[mTCP]: https://www.brutman.com/\n[ansi.el]: https://github.com/jhpyle/mTCP/blob/master/ansi.el\n[DECSET]: https://invisible-island.net/xterm/ctlseqs/ctlseqs.pdf\n[Code Page 437]: https://en.wikipedia.org/wiki/Code_page_437\n[MOUSE.COM]: https://www.computerhope.com/issues/ch000007.htm\n[Open Watcom 1.9]: https://sourceforge.net/projects/openwatcom/files/open-watcom-1.9/\n[DosBox]: https://www.dosbox.com/\n[Vim]: https://www.vim.org/\n[Emacs]: https://www.gnu.org/software/emacs/\n[Sixel]: https://en.wikipedia.org/wiki/Sixel\n[Sixel graphics]: https://en.wikipedia.org/wiki/Sixel\n[show]: https://github.com/jhpyle/mTCP/blob/master/sixel/show\n[tprint]: https://github.com/jhpyle/mTCP/blob/master/printing/tprint\n[stopprint]: https://github.com/jhpyle/mTCP/blob/master/printing/stopprint\n[startprint]: https://github.com/jhpyle/mTCP/blob/master/printing/startprint\n[install.sh]: https://github.com/jhpyle/mTCP/blob/master/install.sh\n[R]: https://www.r-project.org/\n[ggplot2]: https://ggplot2.tidyverse.org/\n[Links]: https://en.wikipedia.org/wiki/Links_(web_browser)\n[Lynx]: https://en.wikipedia.org/wiki/Lynx_(web_browser)\n[unicode.org]: https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/\n[`config`]: https://github.com/jhpyle/mTCP/blob/master/config\n[Code Page]: https://en.wikipedia.org/wiki/Code_page\n[Code Page 437]: https://en.wikipedia.org/wiki/Code_page_437\n[Code Page 737]: https://en.wikipedia.org/wiki/Code_page_737\n[Code Page 775]: https://en.wikipedia.org/wiki/Code_page_775\n[Code Page 850]: https://en.wikipedia.org/wiki/Code_page_850\n[Code Page 852]: https://en.wikipedia.org/wiki/Code_page_852\n[Code Page 855]: https://en.wikipedia.org/wiki/Code_page_855\n[Code Page 857]: https://en.wikipedia.org/wiki/Code_page_857\n[Code Page 860]: https://en.wikipedia.org/wiki/Code_page_860\n[Code Page 861]: https://en.wikipedia.org/wiki/Code_page_861\n[Code Page 862]: https://en.wikipedia.org/wiki/Code_page_862\n[Code Page 863]: https://en.wikipedia.org/wiki/Code_page_863\n[Code Page 864]: https://en.wikipedia.org/wiki/Code_page_864\n[Code Page 865]: https://en.wikipedia.org/wiki/Code_page_865\n[Code Page 866]: https://en.wikipedia.org/wiki/Code_page_866\n[Code Page 869]: https://en.wikipedia.org/wiki/Code_page_869\n[Code Page 874]: https://en.wikipedia.org/wiki/Code_page_874\n[Hercules Graphics Card]: https://en.wikipedia.org/wiki/Hercules_Graphics_Card\n[VGA]: https://en.wikipedia.org/wiki/Video_Graphics_Array\n[MCGA]: https://en.wikipedia.org/wiki/Multi-Color_Graphics_Array\n[`img2sixel`]: https://github.com/saitoha/libsixel\n[CGA]: https://en.wikipedia.org/wiki/Color_Graphics_Adapter\n[Enhanced Keyboard]: https://en.wikipedia.org/wiki/IBM_PC_keyboard\n[IBM PC 5150]: https://en.wikipedia.org/wiki/IBM_Personal_Computer\n[IBM PC model 5150]: https://en.wikipedia.org/wiki/IBM_Personal_Computer\n[IBM PC/XT]: https://en.wikipedia.org/wiki/IBM_Personal_Computer_XT\n[IBM PC/AT]: https://en.wikipedia.org/wiki/IBM_Personal_Computer/AT\n[IBM XT 286]: https://en.wikipedia.org/wiki/IBM_Personal_Computer_XT#IBM_XT_286\n[PS/2]: https://en.wikipedia.org/wiki/IBM_PS/2\n[IBM PS/2 Model 25]: https://en.wikipedia.org/wiki/IBM_PS/2\n[EGA]: https://en.wikipedia.org/wiki/Enhanced_Graphics_Adapter\n[ssh]: https://en.wikipedia.org/wiki/Secure_Shell\n[bash]: https://en.wikipedia.org/wiki/Bash_(Unix_shell)\n[Diablo 630]: https://en.wikipedia.org/wiki/Diablo_630\n[mTCP-src_2022-07-01.zip]: http://www.brutman.com/mTCP/download/mTCP-src_2022-07-01.zip\n[first terminals]: https://en.wikipedia.org/wiki/Teletype_Model_33\n[VT52]: https://en.wikipedia.org/wiki/VT52\n[VT100]: https://en.wikipedia.org/wiki/VT100\n[Midnight Commander]: https://midnight-commander.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhpyle%2Fmtcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhpyle%2Fmtcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhpyle%2Fmtcp/lists"}