.\" Man page for initviocons .\" Copyright (C) 2026 Peter Poeml .\" .\" This man page is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .TH INITVIOCONS 1 "2026-11-02" "initviocons 0.6.1" "User Commands" .SH NAME initviocons \- probe and initialize a terminal, e.g. an iSeries virtual console .SH SYNOPSIS .B initviocons .RB [ \-dqpsc ] .RB [ \-F .IR device ] .SH DESCRIPTION .B initviocons recognises the features of the terminal it is talking to. It sends a series of escape sequences to the terminal and evaluates the replies, thereby finding out the screen size and a suitable .B TERM value. The terminal is then initialized according to what was found \(em for example, carriage return suppression is enabled for Windows telnet clients, which otherwise produce a blank line after every line of text. .PP The program is primarily meant for terminals attached to a serial console, in particular the virtual console of an IBM iSeries (AS/400) system, but it works on any terminal that answers the usual escape sequences. .PP On the iSeries, the program additionally checks whether more than one terminal is connected to the same line, and exits with status .B 1 if that is the case. .PP Because the screen size is queried from the terminal, .B initviocons is useful whenever a terminal has been resized: run it again to update .B COLUMNS and .B LINES in the current shell. .SH OPTIONS .TP .B \-d Print lots of debug output, including the determined device and the raw escape sequences received. Implies .BR \-q . .TP .B \-q Be quiet: suppress informational messages on standard error. .TP .B \-p Probe only. Determine the terminal type and screen size, but do not initialize the terminal and do not print shell commands. .TP .B \-e Write a .B TERM assignment to standard output, suitable for .BR eval (1). Informational messages still go to standard error, so .B \-q is not required. .TP .B \-s Write .B COLUMNS and .B LINES assignments to standard output, together with an .B export statement, again suitable for .BR eval . Independent of .BR \-e : use both options to set .B TERM and the screen size at once. .TP .BI \-F " device" Operate on .I device instead of the terminal on standard input, for example .IR /dev/tty1 . This is needed when the program cannot open the terminal it inherited, which happens if the terminal is not owned by the current user. .TP .B \-c Produce output for the C shell instead of the Bourne shell, i.e. .B setenv statements instead of assignments. .TP .B \-h Show a short usage message and exit with status 1. .SH ENVIRONMENT .B initviocons does not read any environment variables; the values it determines are printed for the shell to .BR eval . .SH FILES .TP .I /dev/tty* Terminal devices that can be passed to .BR \-F . .SH EXIT STATUS .TP .B 0 Success. .TP .B 1 Usage error, the terminal could not be opened, or \(em on the iSeries \(em more than one terminal was detected on the same line. .SH EXAMPLES Initialise the current terminal and set .B TERM in the running shell: .PP .RS 4 .nf eval `initviocons \-e \-q` .fi .RE .PP Update the screen size after resizing the window: .PP .RS 4 .nf eval `initviocons \-e \-s \-q` .fi .RE .PP Probe .I /dev/tty1 without touching it: .PP .RS 4 .nf initviocons \-p \-F /dev/tty1 .fi .RE .SH NOTES .B initviocons switches the terminal to raw mode while probing and restores it afterwards. If it is interrupted, the terminal may be left in raw mode; .BR stty " sane" will repair it. .PP The program does not handle signals; this is a known limitation. .SH SEE ALSO .BR termprobes (1), .BR stty (1), .BR tty (1), .BR terminfo (5) .SH AUTHOR Peter Poeml