Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ tput(1) — DG/UX 4.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought



                                                                  tput(1)



        _________________________________________________________________
        tput                                                      Command
        query terminfo database
        _________________________________________________________________


        SYNTAX

        tput [ -T type ] capname [ parameters... ]


        DESCRIPTION

        Tput uses the terminfo(4) database to make terminal-dependent
        capabilities and information available to the shell, to
        inititialize or reset the terminal, or to return the long name of
        the terminal.  Tput outputs a string if the attribute (capability
        name) is of type string, or an integer if the attribute is of
        type integer.  If the attribute is of type boolean, tput sets the
        exit code (0 for TRUE if the terminal has the capability, 1 for
        FALSE if it does not), and produces no output.

        -Ttype     indicates the type of terminal.  Normally this option
                   is unnecessary, as the default is taken from the
                   environment variable $TERM. If -T is specified, then
                   the environment variables LINES and COLUMNS will not
                   be used to override the defined size of the terminal
                   screen.
        Capname    indicates the attribute from the terminfo(4) database.
                   See terminfo(4) for a complete list of capabilities
                   and the capname associated with each.
        init       If the terminfo(4) database is present and an entry
                   for the user's terminal exists (see -Ttype, above),
                   the following will occur:  (1) if present, the
                   terminal's initialization strings will be output (is1,
                   is2, is3, if, iprog), (2) any delays (e.g., newline)
                   specified in the entry will be set in the tty driver,
                   (3) tabs expansion will be turned on or off according
                   to the specification in the entry, and (4) if tabs are
                   not expanded, standard tabs will be set (every 8
                   spaces).  If an entry does not contain the information
                   needed for any of the four above activities, that
                   activity will silently be skipped.
        reset      Instead of putting out initialization strings, the
                   terminal's reset strings will be output if present
                   (rs1, rs2, rs3, rf).  If the reset strings are not
                   present, but initialization strings are, the
                   initialization strings will be output.  Otherwise,
                   reset acts identically to init.





        DG/UX 4.00                                                 Page 1
               Licensed material--property of copyright holder(s)





                                                                  tput(1)



        longname   If the terminfo(4) database is present and an entry
                   for the user's terminal exists (see -Ttype above),
                   then the long name of the terminal will be put out.
                   The long name is the last name in the first line of
                   the terminal's description in the terminfo(4) database
                   (see term(5)).



        _________________________________________________________________
        EXAMPLES

        $ tput init

        This command initializes your terminal.  It would normally appear
        in your .profile or .login file (see profile(4)) to set your
        terminal to a reasonable state for normal use.

        $ tput clear

        This command will echo the clear-screen sequence for your
        terminal type.

        $ tput -Tvt100 lines

        This command will display the number of lines for a VT-100
        terminal.

        $ tput hc

        This form of the command will set the exit code to indicate if
        the current terminal is a hardcopy terminal.  This can be useful
        if you are writing a shell script that must be executed on a
        variety of terminal types.
        _________________________________________________________________


        FILES

        /usr/lib/terminfo/?/*    Compiled terminal description database
        /usr/include/term.h      Terminfo(4) header file
        /usr/lib/tabset/*        Tab setting files for certain terminals;
                                 for more information, see the "Tabs and
                                 Initialization" section of terminfo(4).


        EXIT CODES

        If capname is of type boolean, a value of 0 is set for TRUE and 1
        for FALSE.
        If capname is of type string, a value of 0 is set if the capname



        DG/UX 4.00                                                 Page 2
               Licensed material--property of copyright holder(s)





                                                                  tput(1)



        is defined for this terminal type (the value of capname is
        returned on standard output); a value of 1 is set if capname is
        not defined for this terminal type (a null value is returned on
        standard output).
        If capname is of type integer, a value of 0 is always set,
        whether or not capname is defined for this terminal type.  To
        determine if capname is defined for this terminal type, the user
        must test the value of standard output.  A value of -1 means that
        capname is not defined for this terminal type.
        Any other exit code indicates an error; see DIAGNOSTICS, below.


        DIAGNOSTICS

        tput prints the following error messages and sets the
        corresponding exit codes.
           exit
           code             error message

            0   -1  (capname is a numeric variable that is not
                specified in the terminfo(4) database for this terminal
                type, e.g. tput -T450 lines and tput -T2621 xmc)
            1   no error message is printed, see EXIT CODES,
                above.
            2   usage error
            3   unknown terminal type or no terminfo(4)
                database
            4   unknown terminfo(4) capability capname



        SEE ALSO

        stty(1).
        profile(4), terminfo(4) in the Programmer's Reference for the
        DG/UX System


















        DG/UX 4.00                                                 Page 3
               Licensed material--property of copyright holder(s)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026