QTERM(1) UNIX Programmer's Manual QTERM(1) NAME qterm - Query Terminal SYNOPSIS qterm [ +|-alt ] [ +|-always ] [ +|-longname ] [ +|-quiet ] [ +|-sent ] [ +|-timeout ] [ +|-usrtab ] [ +|-watch ] [ +|-systab ] [ -wait _i_n_t_e_r_v_a_l ] [ -file _t_a_b_f_i_l_e ] DESCRIPTION _Q_t_e_r_m is used to query a terminal to determine its name. This is done by sending a special sequence to the terminal, reading in a response, and comparing it against a table of possible responses. The ``name'' printed to standard output should be one found in the _t_e_r_m_c_a_p(_5) (or _t_e_r_m_i_n_f_o(_5) for System V systems) database. For _c_s_h(_1) users, putting a line in your ._l_o_g_i_n file such as: setenv TERM `qterm` should automagically set your terminal type. For _s_h(_1) users, putting these lines in your ._p_r_o_f_i_l_e file should set your terminal type: TERM=`qterm` export TERM By default, qterm uses the system tab file /_u_s_r/_l_o_c_a_l/_l_i_b/_q_t_e_r_m_t_a_b to obtain information for querying terminals. OPTIONS +alt Use the alternate string ``[c'' when asking the terminal to identify itself. This string is recognized by most ANSI compatible terminals. -alt Don't use the alternate string, but the string found in the tabfile being used. This is the default. +always Always send the terminal query string. Normally the query string is only sent if it differs from the last string sent. -always Only send the terminal query string if it differs from the last string sent. This is the default. -file _t_a_b_f_i_l_e Use <_t_a_b_f_i_l_e> to find information for querying the USC-UCS 6 November 1990 1 QTERM(1) UNIX Programmer's Manual QTERM(1) terminal. +longname Print only the long (verbose) terminal name. -longname Don't print the long (verbose) terminal name. This is the default. +quiet Be quiet and only print the terminal name to standard output. -quiet Don't be quiet and only print the terminal name to standard output. This is the default. +watch Watch the characters sent and recieved to the terminal. -watch Don't watch the characters sent and recieved to the terminal. This is the default. +timeout Wait for timeout when listening for response string. This is useful if the first entry in a qtermtab doesn't have a response string with an ending character that is common with the rest of the qtermtab entries. -timeout Disable waiting for timeout when listening for response string. This is the default. +usrtab Use $HOME/.qtermtab to find information for querying the terminal. -usrtab Don't use $HOME/.qtermtab to find information for querying the terminal. This is the default. +sent Display the final response sent from the terminal in a ``nice'' fashion. -sent Don't display the final response sent from the termi- nal. This is the default. +systab Use /usr/local/lib/qtermtab to find information for USC-UCS 6 November 1990 2 QTERM(1) UNIX Programmer's Manual QTERM(1) querying the terminal. This is the default -systab Don't use system tab file to find information for querying the terminal. -wait _i_n_t_e_r_v_a_l Set the wait (timeout) period to _i_n_t_e_r_v_a_l (in seconds). QTERMTAB The format of the file $HOME/.qtermtab and _q_t_e_r_m'_s system tab file /_u_s_r/_l_o_c_a_l/_l_i_b/_q_t_e_r_m_t_a_b, consists of four fields each seperated by white space (tabs and/or spaces). The first field is the string that should be used to query the terminal. The second field is the string to expect in response to the query. The third field is the terminal name (compatible with _t_e_r_m_c_a_p(_5)) to print to standard output. The fourth field is optional and may contain a description of the exact manufacturer and model name of the terminal to be used in a message printed to standard error. Blank lines or lines starting with the character ``#'' are ignored and may be used as comment lines. A character pre- ceeded by a ``^'' is taken to mean the _c_o_n_t_r_o_l character. (i.e. ``^['' is interpretted as an ). Both the send and receive (first and second) fields may contain octal values preceeded by a `\'. (i.e. can be represented by `\033'.) The ``expect'' (second) field can be a regular expression denoted by a leading backslash (`\'). i.e. "^[[123" matches the string "^[[123", whereas "^[\[123]" matches "^[1" or "^[2" or "^[3". See _e_d(_1) for regular expression informa- tion. Below is a sample file: # # QTerm File # ^[Z ^[[?1;1c vt100 A vt100 with STP ^[Z ^[[?1;2c vt100 ANSI/VT100 Clone ^[Z ^[[?1;3c vt100 A vt100 with AVO and STP ^[Z ^[[?1;4c vt100 A vt100 with GPO ^[Z ^[iBO z29 Zenith in Zenith Mode AUTHOR Michael A. Cooper, University Computing Services, University of Southern California. USC-UCS 6 November 1990 3 QTERM(1) UNIX Programmer's Manual QTERM(1) FILES /usr/local/lib/qtermtab - System table $HOME/.qtermtab - User's table /etc/termcap - termcap(5) database SEE ALSO csh(1), ed(1), sh(1), termcap(5) DIAGNOSTICS _T_e_r_m_i_n_a_l _n_o_t _r_e_c_o_g_n_i_z_e_d - _d_e_f_a_u_l_t_s _t_o _d_u_m_b. _Q_T_e_r_m did not receive a response from the terminal, or the response did not match any that _q_t_e_r_m has stored internally. Use the +watch option to check to see which is the case. BUGS Many terminals do not send a response at all. USC-UCS 6 November 1990 4