


TPUT(1V)                 USER COMMANDS                   TPUT(1V)



NAME
     tput - initialize a terminal or query the terminfo database

SYNOPSIS
     /usr/5bin/tput [ -T_t_y_p_e ] _c_a_p_a_b_i_l_i_t_y [ _p_a_r_a_m_e_t_e_r ... ]

     /usr/5bin/tput [ -T_t_y_p_e ] init

     /usr/5bin/tput [ -T_t_y_p_e ] longname

     /usr/5bin/tput [ -T_t_y_p_e ] reset

AVAILABILITY
     This command is available with the _S_y_s_t_e_m _V software instal-
     lation  option.   Refer to _I_n_s_t_a_l_l_i_n_g _S_u_n_O_S _4._1 for informa-
     tion on how to install optional software.

DESCRIPTION
     tput uses the terminfo(5V) database to make  the  values  of
     terminal-dependent capabilities and information available to
     the shell, to initialize or reset the  terminal,  or  return
     the long name of the requested terminal type.  Normally, the
     terminal type is taken from the environment  variable  TERM;
     if  the  -T_t_y_p_e  option  is  specified, the terminal type is
     taken from that option.

     tput displays a string if the given _c_a_p_a_b_i_l_i_t_y is  a  string
     capability, or an integer if it is an integer capability; it
     displays no output if the capability is a boolean.

     If _c_a_p_a_b_i_l_i_t_y is a boolean, tput returns true  (0)  if  that
     capability is set, or false (1) otherwise.  If _c_a_p_a_b_i_l_i_t_y is
     a string, tput returns true (0) if that capability  is  set,
     or  false  (1)  otherwise.   If  _c_a_p_a_b_i_l_i_t_y is an integer, a
     value of true (0) is returned _w_h_e_t_h_e_r _o_r _n_o_t the  capability
     is  set  for the terminal.  To determine if an integer capa-
     bility is set, you must examine the standard output.

     For a complete list of capabilities and the _c_a_p_a_b_i_l_i_t_y asso-
     ciated with each, see terminfo(5V).

     If _c_a_p_a_b_i_l_i_t_y is a string capability that takes  parameters,
     the  _p_a_r_a_m_e_t_e_r  arguments  are instantiated into the string.
     An all-numeric _p_a_r_a_m_e_t_e_r argument is passed to the attribute
     as a number.

OPTIONS
     -T_t_y_p_e
          Indicate the _t_y_p_e of terminal.  If this option is  sup-
          plied,  the environment variables LINES and COLUMNS are
          not used.




Sun Release 4.1   Last change: 20 January 1988                  1






TPUT(1V)                 USER COMMANDS                   TPUT(1V)



     init If the terminfo database is present and  an  entry  for
          the  user's  terminal  exists, emit the terminal's ini-
          tialization strings, set up any delays  specified,  and
          turn  the  expansion  of  TAB  characters on or off, as
          specified by the terminal's entry in the terminfo data-
          base.   If the terminal has a TAB character, and either
          has a capability for setting  TAB  characters  or  ini-
          tially has its TAB characters set every 8 SPACE charac-
          ters, expansion of TAB characters is turned off, other-
          wise  expansion  of  TAB  characters  is turned on.  If
          expansion of TAB characters is turned on, and the  ter-
          minal  has a capability for setting TAB characters, TAB
          stops are set to every eight columns.  If an entry does
          not  contain  the  information  needed for any of these
          actions, that action is silently skipped.

     reset
          Emit the terminal's reset strings, and  set  up  delays
          and  TAB characters as specified.  If the reset strings
          are not present, but initialization  strings  are,  the
          initialization strings are used.

     longname
          If the terminfo database is present and  an  entry  for
          the  user's  terminal exists, emit the long name of the
          terminal.  The long name is the last name in the  first
          line  of  the  terminal's  description  in the terminfo
          database.

EXIT CODES
     0    The boolean or string capability is set, or  the  capa-
          bility is an integer type and is present.

     1    The _c_a_p_a_b_i_l_i_t_y is not set.

     2    Usage error.

     3    The terminal is of an unknown  type,  or  the  terminfo
          database is not present.

     4    Unknown terminfo capability.

     -1   The integer capability is not defined for this terminal
          type.

EXAMPLES
     tput init           Initialize the terminal according to the
                         type  of  terminal  in the environmental
                         variable  TERM.   This  command  can  be
                         included in a .profile or .login file.

     tput -Tsun reset    Reset   a   Sun   workstation   console,



Sun Release 4.1   Last change: 20 January 1988                  2






TPUT(1V)                 USER COMMANDS                   TPUT(1V)



                         shelltool(1)  window, or cmdtool(1) win-
                         dow, overriding the type of terminal  in
                         the environmental variable TERM.

     tput cup 0 0        Send the sequence to move the cursor  to
                         row  0,  column 0 (the upper left corner
                         of the  screen,  usually  known  as  the
                         "home" cursor position).

     tput clear          Echo the clear-screen sequence  for  the
                         current terminal.

     tput cols           Print the  number  of  columns  for  the
                         current terminal.

     tput -Tsun cols     Print the number of columns for the  Sun
                         workstation console or subwindow.

     bold=`tput smso`

     offbold=`tput rmso` Set the shell variables bold,  to  begin
                         stand-out mode sequence, and offbold, to
                         end  standout  mode  sequence,  for  the
                         current  terminal.   This  might be fol-
                         lowed by a prompt:

                              echo "${bold}Please  type  in  your
                              name: ${offbold}\c"

     tput hc             Set exit code to indicate if the current
                         terminal is a hardcopy terminal.

     tput cup 23 4       Send the sequence to move the cursor  to
                         row 23, column 4.

     tput longname       Print the long name  from  the  terminfo
                         database for the type of terminal speci-
                         fied in the environmental variable TERM.

FILES
     /usr/share/lib/terminfo/?/*
                         compiled terminal description database
     /usr/5include/curses.h
                         curses(3V) header file
     /usr/5include/term.h
                         terminfo(5V) header file
     /usr/share/lib/tabset/*
                         TAB settings for some  terminals,  in  a
                         format  appropriate  to be output to the
                         terminal (escape sequences that set mar-
                         gins   and  TAB  characters);  for  more
                         information,   see    the    Tabs    and



Sun Release 4.1   Last change: 20 January 1988                  3






TPUT(1V)                 USER COMMANDS                   TPUT(1V)



                         Initialization section of terminfo(5V).
     .login
     .profile

SEE ALSO
     cmdtool(1), shelltool(1), stty(1V), curses(3V), terminfo(5V)

















































Sun Release 4.1   Last change: 20 January 1988                  4



