qodem man page

qodem — Qodem Terminal Emulator


qodem [ --enable-capture FILENAME ]
[ [ --connect HOST [ --connect-method method ]
[ --username name ] ] |
args... ]

qodem [ --help | -h | -? ]


Qodem is an open-source clone implementation of the popular DOS-based Qmodem serial communications program. Qodem incorporates many features that are useful on all kinds of text-based consoles such as scrollback buffer, session capture, screen dump, dialing directory, and also includes serial port handling and modem dialing.

The major features of Qodem are:

* Unicode display: translation of CP437 (PC VGA), VT100 DEC Special
Graphics characters, VT220 National Replacement Character sets,
etc., to Unicode

* Terminal interface conveniences: scrollback buffer, capture file,
screen dump, dialing directory, keyboard macros, script support

* Connection methods: serial, local shell, command line, telnet,
ssh, rlogin, rsh

* Emulations: ANSI, Avatar, VT52, VT100/102, VT220, Linux, and XTerm

* Transfer protocols: Xmodem, Ymodem, Zmodem, and Kermit

Terminal Requirements

Qodem requires the following characteristics of its shell/terminal:

* Unicode capability. The raw Linux console, UXTerm, URxvt,
Konsole, and gnome-terminal all work well.

* A Unicode font that includes the CP437 (PC VGA) glyphs.

* The meta key must use escape prefixing rather than setting the 8th
bit on the character. Many terminal emulators do this by
default. Qodem sends an xterm escape sequence to enable this
behavior. For XTerm, this can be enabled by clicking
CTRL-Mouse1 (left button) and checking "Meta Sends Escape", or by
adding the following lines to ~/.Xresources:
XTerm*metaSendsEscape: true
UXTerm*metaSendsEscape: true


Emulations supported by Qodem and their status follows. Note that TTY, DEBUG, ANSI.SYS, AVATAR, LINUX, and XTERM emulations can use both CP437 (PC VGA) and ISO-8859-1 glyphs for 8-bit characters (see Alt-; Codepage below). If ISO-8859-1 is used, the C0 control characters (0x00 - 0x1F) are mapped to the equivalent CP437 glyphs since there are no glyphs defined in that range for ISO-8859-1.

This is the DOS-based "ANSI.SYS" emulation plus a few more codes than the original ANSI.SYS. It supports DSR 6 (Cursor Position) which many BBSes used to "autodetect" ANSI, and the following ANSI X3.64 functions: ICH, DCH, IL, DL, VPA, CHA, CHT, and REP. It also supports "ANSI Music" sequences that follow the "PLAY" command syntax; it plays these tones via SDL.
This is the BBS-era Avatar ("Advanced Video Attribute Terminal Assembler and Recreator") emulation. It supports all of the "Extended AVT/0" commands as per George A. Stanislav's 1 May 1989 document except for transmitting PC keyboard scan codes. It also includes ANSI fallback capability.
Fairly complete. Does not support HOLD SCREEN mode. Graphics mode glyphs that do not have direct Unicode equivalents render as a hatch.
Identical to VT102 except in how it responds to Device Attributes function.
Fairly complete. Double-width characters are not displayed with wide glyhps due to curses-based output. Does not support smooth scrolling, printing, keyboard locking, keyboard leds, and hardware tests. Many numeric keypad characters also do not work correctly due to console NUM LOCK handling. 132-column output is only supported if the host console / window is already 132 columns or wider; Qodem does not issue resize commands to the host console for 80/132 column switching codes.
Fairly complete. Converts National Replacement Character sets and DEC Supplemental Graphics characters to Unicode. In addition to limitations of VT102, also the following features are not supported: user-defined keys (DECUDK), downloadable fonts (DECDLD), VT100/ANSI compatibility mode (DECSCL).
This emulation supports bare control character handling (backspace, newline, etc.) and litte else. Characters that would be overwritten with underscores are instead made underlined as old teletypes would do.
This emulation displays all incoming characters in a format similar to a hex dump.
This emulation has two modes: PC VGA (LINUX) and UTF-8 (L_UTF8). This emulation is similar to VT102 but also recognizes the Linux private mode sequences and ECMA-48 sequences VPA, CNL, CPL, ECH, CHA, VPA, VPR, and HPA. In addition to VT102 limitations, also the following features are not supported: selecting ISO 646/ISO 8859-1/UTF-8 character sets, X11 mouse reporting.
This emulation has two modes: PC VGA (XTERM) and UTF-8 (X_UTF8). It is mostly identical to LINUX but also recognizes a few XTerm sequences and discards them to maintain a clean display. It does not support many of the features unique to XTerm such as Tektronix 4014 mode, mouse tracking, alternate screen buffer, and many more.

File Transfer Protocols

Protocols supported by Qodem and their status follows:

Supports original Xmodem, Xmodem-1k, Xmodem-CRC16, and Xmodem-G. Also supports "Xmodem Relaxed", a variant of original Xmodem with longer timeouts.
Supports Ymodem and Ymodem-G. If a file exists, it will be appended to.
Supports resume (crash recovery) and auto-start. Does not yet support changing block size on errors, so transfers over unreliable serial/modem connections might incur significant performance penalties.
Supports the original robust (slow) Kermit plus streaming and autostart. On reliable connections with streaming it should perform reasonably well. Does not yet support long or extra-long packets, RESEND/REGET, server mode, or sliding windows.


When qodem first starts up, by default it will start in the phonebook. The menu on the bottom half of the screen lists the various actions available. When editing a phonebook entry, the status line will change to show options for each field. Connecting to a system or leaving the phonebook puts qodem in Terminal Mode.

Terminal Mode
Terminal Mode is the main qodem terminal emulator interface. Alt-Z will bring up a help menu. While in Terminal Mode the following actions are supported:

Alt-D Phonebook
This brings up the phonebook.
Alt-G Term Emulation
This brings up a menu to select the terminal emulation. Selecting the active terminal emulation will prompt to reset the emulation state; this may be useful to recover from corrupted escape sequences.
Alt-C Clear Screen
This clears the screen and homes the cursor.
Alt-F Execute Script
This prompts for a filename, and then executes that file as a script. Any program that reads from standard input and writes to standard output can be run as a script. See the section below on script support.
Alt-K Send BREAK
When connected via serial mode or modem, this calls tcsendbreak() to send a true "Break Signal" on the serial line.
Alt-P Capture File
Enable/disable capture to file. Three capture formats are supported: "raw", "text", and "html". "Raw" format saves every byte as received from the other side before emulation processing; "text" saves UTF-8 characters after emulation processing; "html" saves in HTML format with Unicode entities and color attributes after emulation processing. ASCII file transfers will be included in the capture file; other file transfers (Xmodem, Ymodem, Zmodem, Kermit) are excluded from the capture file.
Alt-S Split Screen
This actives split screen mode, in which local characters are accumulated in a buffer before sending to the remote side. To send carriage return, enter "^M".
Alt-T Screen Dump
This prompts for a filename, and then saves the current view to that file.
Alt-Y COM Parameters
This brings up a menu to alter the serial port settings.
PgUp Upload Files
This brings up the file upload menu. Note that CTRL-PgUp and ALT-PgUp may also work depending on the terminfo for the host terminal.
PgDn Download Files
This brings up the file download menu. Note that CTRL-PgDn and ALT-PgDn may also work depending on the terminfo for the host terminal.
Alt-\ Compose Key
This brings up a dialog to enter the 3-digit decimal value (0-255) for an 8-bit byte or a 4-digit hexadecimal value (0-ffff) for a 16-bit Unicode character (L_UTF8 and X_UTF8 only).
Alt-; Codepage
This brings up a dialog to change the current codepage. Codepages are limited by the current emulation. VT52, VT100, VT102, VT220, L_UTF8, and X_UTF8 can only be set to the DEC codepage; LINUX, XTERM, ANSI, AVATAR, TTY, and DEBUG emulations can be set to either CP437 (VGA) or ISO-8859-1.
Alt-/ Scroll Back
This selects the scrollback buffer. When viewing the buffer, "S" saves to file and "C" clears the scrollback buffer. By default qodem supports up to 20000 lines of scrollback; this can be changed by editing scrollback_max in scrollback.c.
Alt-H Hangup/Close
This hangs up the modem (drops DTR) or closes the remote connection (kills the child process).
Alt-L Log View
This brings the session log up in an editor. The session log stores information about connect, disconnect, and file upload/download events.
Alt-M Mail Reader
This spawns the mail reader, by default mm.
Alt-X Exit Qodem
This prompts to exit qodem. When not connected, Ctrl-C will also bring up the exit prompt.
Alt-A Translate Table
This brings up the translate table editor. Both incoming and outgoing bytes can be changed or stripped (set to ASCII NUL (0)). Note that translation occurs before both emulation processing and UTF-8 decoding.
Alt-J Function Keys
This brings up the keyboard macro editor. Keyboard macros support substitutions for carriage return ("^M"), the phonebook entry username ("$USERNAME"), and the phonebook entry password ("$PASSWORD").
Alt-N Configuration
This brings the qodemrc options file up in an editor.
Alt-O Modem Config
This brings up the modem configuration dialog.
Alt-R OS Shell
This spawns a system shell.
Alt-V View File
This brings up a prompt to view a file in an editor.
Alt-W List Directory
This brings up a directory listing.
Alt-0 Session Log
This toggles the session log on or off.
Alt-1 XON/XOFF Flow Ctrl
When connected via modem or serial port, this toggles XON/XOFF on or off.
Alt-2 Backspace/Del Mode
This selects whether the backspace key on the keyboard sends an ASCII backspace (^H) or an ASCII DEL (127) character. Ctrl-H can always be used to send true backspace; Ctrl-? can be used to send true DEL. Note that VT220 emulation always sends DEL when the backspace key is pressed.
Alt-3 Line Wrap
This toggles line wrap mode on or off. When line wrap mode is enabled, if a character is received when the cursor is at the right margin it will wrap to the first column of the next line.
Alt-4 Display NULL
This selects whether ASCII NUL (0) will be displayed as a blank/space or stripped.
Alt-6 Batch Entry Window
This brings up the list of upload files used by Ymodem, Zmodem, and Kermit uploads.
Alt-7 Status Line Info
This selects between two formats for the status line.
Alt-8 Hi-Bit Strip
This selects whether or not to clear the 8th bit of all incoming bytes. Note that high-bit stripping occurs before both emulation processing and UTF-8 decoding.
Alt-9 Serial Port
This opens or closes the serial port. If already connected to a non-serial/modem remote host, this does nothing.
Alt-B Beeps & Bells
This toggles beep support on or off. When beep support is on, beeps from the remote host will be played by qodem. In LINUX emulation, qodem supports setting the tone and duration of the beep as specified in console-codes(4).
Alt-E Half/Full Duplex
This toggles between half and full duplex.
Alt-I Qodem Information
This displays the qodem splash screen which includes the version and build date.
Alt-U Scrollback Record
This selects whether or not lines that scroll off the top of the screen will be saved to the scrollback buffer.
Alt-= Doorway Mode
This selects between three doorway modes: "Doorway OFF", "Doorway MIXED" and "Doorway FULL". When doorway mode is "Doorway OFF", terminal mode responds to all of its command keys as described in this section. When doorway mode is "Doorway FULL", all Alt- command keystrokes except Alt-= are passed to the remote side. When doorway mode is "Doorway MIXED", terminal mode supports a few commands but passes the majority of Alt- command keystrokes to the remote side. The default commands supported in "Doorway MIXED" mode are:
Alt-D Phonebook
Alt-P Capture
Alt-T Screen Dump
Alt-Y COM Parameters
Alt-Z Menu
Alt-/ Scrollback
Alt-PgUp or Ctrl-PgUp Upload Files
Alt-PgDn or Ctrl-PgDn Download Files
Alt-- Status Lines
This toggles the status line on or off.
Alt-+ CR/CRLF Mode
This toggles whether or not received carriage returns imply line feed or not.
Alt-, ANSI Music
This toggles ANSI music support on or off.

Unicode Support

Qodem supports Unicode (UTF-8 encoding only) in the following functions only: keyboard macros; phonebook entries (NAME, USERNAME, and PASSWORD); modem device name.

UTF-8 is NOT supported in filenames, modem strings, and remote addresses.

Script Support

Qodem does not have its own scripting language. Instead, any program that reads and writes to the standard input and output can be run as a Qodem script:

* Characters sent from the remote connection are visible to the
script in its standard input.

* Characters the script emits to its standard output are passed on
the remote connection.

* Messages to the standard error are reported to the user and also
recorded in the session log.

Since scripts are communicating with the remote system and not Qodem itself, they are unable to script Qodem's behavior, e.g. change the terminal emulation, hangup and dial another phonebook entry, download a file, etc. However, they can be written in any language, and they can be tested outside Qodem.

Scripts replace the user, and as such have similar constraints:

* Script standard input, output, and error must all be in UTF-8 encoding.

* Scripts should send carriage return (0x0D, or \r) instead of new
line (0x0A, or \n) to the remote side - the same as if a user
pressed the Enter key. They should expect to see either bare
carriage return (0x0D, or \r) or carriage return followed by
newline (0x0D 0x0A, or \r\n) from the remote side.

* Input and output translate byte translation (the Alt-A Translate Tables) are honored for scripts.

* While a script is running:
- Zmodem and Kermit autostart are disabled.
- Keyboard function key macros are disabled.
- Qodem functions accessed through the Alt-character
combinations and PgUp/PgDn are unavailable.
- Pressing Alt-P will pause the script.

* While a script is paused:
- The script will receive nothing on its standard input.
- Anything in the script's standard output will be held until
the script is resumed.
- The script process will not be signaled; it may continue
running in its own process.
- The only Alt-character function recognized is AltP to
resume the script. All other Alt- keys will be ignored.
- Keys pressed will be sent directly to the remote system.
- Keyboard function key macros will work.

Scripts are launched in two ways:

* In TERMINAL mode, press Alt-F and enter the script filename. The
script will start immediately.

* In the phonebook, add a script filename to a phonebook entry. The
script will start once that entry is connected.

Script command-line arguments can be passed directly in both the Alt-F script dialog and the phonebook linked script field. For example, pressing Alt-F and entering "my_script.pl arg1" will launch my_script.pl and with its first command-line argument ($ARGV[0] in Perl) set to "arg1".


--enable-capture FILENAME
Capture the entire session and save to FILENAME.
--connect HOST
Immediately open a connection to HOST. The default connection method is "ssh" unless specified with the --connect-method option.
--connect-method METHOD
Use METHOD to connect for the --connect and --dial options. Valid values are "ssh", "rlogin", "rsh", "telnet", and "shell".
--username USERNAME
Use USERNAME when connecting with the --connect option. This value is passed on the command line to ssh, rsh, and rlogin.
Spawn a local shell and pass args to it.
--help, -h, -?
Display usage screen.

Environment Variables

Qodem makes use of the following variables:
The user's home directory. Qodem creates two directories: $HOME/.qodem for qodem's internal files (phonebook, keyboard macro files, translate tables, etc.) and $HOME/qodem for uploaded and downloaded files, session log, capture, etc.
If present, this will be used when spawning external editors (log view, edit configuration, view file, edit phonebook note). If not present, by default (editable in the options file) use vi.
This is a timeout value in milliseconds used by the ncurses get_wch() and wget_wch() functions to determine if a user pressed bare ESCAPE. On some systems pressing ESCAPE may require up to a full second before qodem can process it. For qodem backtick (`) can be used instead of ESCAPE.


Qodem options/configuration file. Inline comments describe the options.

See Also

xqodem(1), mm(1), kermit(1), gkermit(1), minicom(1), rlogin(1), rsh(1), ssh(1), telnet(1), xterm(1), vttest(1), console-codes(4)


The screensaver might not load under all circumstances even after the timeout has passed.


The qodem homepage is at <http://qodem.sourceforge.net>.

Referenced By


Explore man page connections for qodem(1).

August 15, 2010