tput

Section: Misc. Reference Manual Pages (1local)
Updated: UR EE GRADUATE VLSI LAB
Index Return to Main Contents
 

NAME

tput - query termcap data base  

SYNOPSIS

tput [ -Ttype ] [ -e ] capname [ x y ]  

DESCRIPTION

tput uses the termcap(5) data base to make terminal-dependent capabilities and information available to the shell. 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 simply sets the exit code (0 for TRUE, 1 for FALSE) and does no output.

#-Ttype#indicates the type of terminal. Normally this flag
##is unnecessary, as the default is taken from the
##environment variable $TERM.
#-e#suppresses the printing of error messages. In case
##an error occurs, an error code is returned with or
##without this flag.
#Capname#indicates the attribute (mapping to an attribute
##from the ItermcapR database.)

x and y are integer values for cursor movement.

Typical capname options are given below.  

REQUESTS

Option Type Termcap Explanation
am     bool   am        Terminal has automatic margins

bw     bool   bw        cub1 wraps from column 0 to last column

chts   bool   HC        Cursor is hard to see.

da     bool   da        Display may be retained above the screen

db     bool   db        Display may be retained below the screen

eo     bool   eo        Can erase overstrikes with a blank

eslok  bool   es        Escape can be used on the status line

gn     bool   gn        Generic line type (e.g. dialup, switch).

hc     bool   hc        Hardcopy terminal

hs     bool   hs        Has extra "status line"

hz     bool   hz        Hazeltine; can't print ~'s

in     bool   in        Insert mode distinguishes nulls

km     bool   km        Has a meta key (shift, sets parity bit)

mc5i   bool   5i        Printer won't echo on screen.

mir    bool   mi        Safe to move while in insert mode

msgr   bool   ms        Safe to move in standout modes

npc    bool   NP        Pad character doesn't exist.

nrrmc  bool   NR        Smcup does not reverse rmcup.

nxon   bool   nx        Padding won't work, xon/xoff required

os     bool   os        Terminal overstrikes

ul     bool   ul        underline character overstrikes

xenl   bool   xn        newline ignored after 80 cols (Concept)

xhp    bool   xs        Standout not erased by overwriting (hp)

xon    bool   xo        Terminal uses xon/xoff handshaking

xsb    bool   xb        Beehive (f1=escape, f2=ctrl C)

xt     bool   xt        Tabs destructive, magic so char (t1061)

cols   num    co        Number of columns in a line

it     num    it        Tabs initially every # spaces.

lh     num    lh        # rows in each label

lines  num    li        Number of lines on screen or page

lm     num    lm        Lines of memory if > lines. 0 => varies

lw     num    lw        # cols in each label

nlab   num    Nl        # of labels on screen (start at 1)

pb     num    pb        Lowest baud rate where padding needed

vt     num    vt        Virtual terminal number (CB/Unix)

wsl    num    ws        # columns in status line

xmc    num    sg        Number blank chars left by smso or rmso

acsc   str    ac        Graphic charset pairs aAbBcC - def=vt100

bel    str    bl        Audible signal (bell)

blink  str    mb        Turn on blinking

bold   str    md        Turn on bold (extra bright) mode

cbt    str    bt        Back tab

civis  str    vi        Make cursor invisible

clear  str    cl        Clear screen (*)

cmdch  str    CC        Term. settable cmd char in prototype

cnorm  str    ve        Make cursor appear normal (undo vs/vi)

cr     str    cr        Carriage return (*)

csr    str    cs        change to lines #1 thru #2 (vt100) (G)

cub    str    LE        Move cursor left #1 spaces (G)

cub1   str    le        Move cursor left one space.

cud    str    DO        Move cursor down #1 lines. (G*)

cud1   str    do        Down one line

cuf    str    RI        Move cursor right #1 spaces. (G*)

cuf1   str    nd        Non-destructive space (cursor right)

cup    str    cm        Cursor motion to row #1 col #2 (G)

cuu    str    UP        Move cursor up #1 lines. (G*)

cuu1   str    up        Upline (cursor up)

cvvis  str    vs        Make cursor very visible

dch    str    DC        Delete #1 chars (G*)

dch1   str    dc        Delete character (*)

dim    str    mh        Turn on half-bright mode

dl     str    DL        Delete #1 lines (G*)

dl1    str    dl        Delete line (*)

dsl    str    ds        Disable status line

ech    str    ec        Erase #1 characters (G)

ed     str    cd        Clear to end of display (*)

el     str    ce        Clear to end of line

el1    str    cb        Clear to beginning of line, inclusive

enacs  str    eA        Enable alternate char set

ff     str    ff        Hardcopy terminal page eject (*)

flash  str    vb        Visible bell (may not move cursor)

fsl    str    fs        Return from status line

hd     str    hd        Half-line down (forward 1/2 linefeed)

home   str    ho        Home cursor (if no cup)

hpa    str    ch        Set cursor column (G)

ht     str    ta        Tab to next 8 space hardware tab stop.

hts    str    st        Set a tab in all rows, current column.

hu     str    hu        Half-line up (reverse 1/2 linefeed)

ich    str    IC        Insert #1 blank chars (G*)

ich1   str    ic        Insert character

if     str    if        Name of file containing is

il     str    AL        Add #1 new blank lines (G*)

il1    str    al        Add new blank line (*)

ind    str    sf        Scroll text up

indn   str    SF        Scroll forward #1 lines. (G)

invis  str    mk        Turn on blank mode (chars invisible)

ip     str    ip        Insert pad after character inserted (*)

iprog  str    iP        Path name of program for init.

is1    str    i1        Terminal initialization string

is2    str    is        Terminal initialization string

is3    str    i3        Terminal initialization string

kBEG   str    &9        KEY_SBEG, 0572, shifted beginning key

kCAN   str    &0        KEY_SCANCEL, 0573, shifted cancel key

kCMD   str    *1        KEY_SCOMMAND, 0574, shifted command key

kCPY   str    *2        KEY_SCOPY, 0575, shifted copy key

kCRT   str    *3        KEY_SCREATE, 0576, shifted create key

kDC    str    *4        KEY_SDC, 0577, shifted delete char key

kDL    str    *5        KEY_SDL, 0600, shifted delete line key

kEND   str    *7        KEY_SEND, 0602, shifted end key

kEOL   str    *8        KEY_SEOL, 0603, shifted clear line key

kEXT   str    *9        KEY_SEXIT, 0604, shifted exit key

kFND   str    *0        KEY_SFIND, 0605, shifted find key

kHLP   str    #1        KEY_SHELP, 0606, shifted help key

kHOM   str    #2        KEY_SHOME, 0607, shifted home key

kIC    str    #3        KEY_SIC, 0610, shifted input key

kLFT   str    #4        KEY_SLEFT, 0611, shifted left arrow key

kMOV   str    %b        KEY_SMOVE, 0613, shifted move key

kMSG   str    %a        KEY_SMESSAGE, 0612, shifted message key

kNXT   str    %c        KEY_SNEXT, 0614, shifted next key

kOPT   str    %d        KEY_SOPTIONS, 0615, shifted options key

kPRT   str    %f        KEY_SPRINT, 0617, shifted print key

kPRV   str    %e        KEY_SPREVIOUS, 0616, shifted prev key

kRDO   str    %g        KEY_SREDO, 0620, shifted redo key

kRES   str    %j        KEY_SRSUME, 0623, shifted resume key

kRIT   str    %i        KEY_SRIGHT, 0622, shifted right arrow

kRPL   str    %h        KEY_SREPLACE, 0621, shifted replace key

kSAV   str    !1        KEY_SSAVE, 0624, shifted save key

kSPD   str    !2        KEY_SSUSPEND, 0625, shifted suspend key

kUND   str    !3        KEY_SUNDO, 0626, shifted undo key

ka1    str    K1        KEY_A1, 0534, Upper left of keypad

ka3    str    K3        KEY_A3, 0535, Upper right of keypad

kb2    str    K2        KEY_B2, 0536, Center of keypad

kbeg   str    @1        KEY_BEG, 0542, beg(inning) key

kbs    str    kb        KEY_BACKSPACE, 0407, Sent by backspace key

kc1    str    K4        KEY_C1, 0537, Lower left of keypad

kc3    str    K5        KEY_C3, 0540, Lower right of keypad

kcan   str    @2        KEY_CANCEL, 0543, cancel key

kcbt   str    kB        KEY_BTAB, 0541, Back tab key

kclo   str    @3        KEY_CLOSE, 0544, close key

kclr   str    kC        KEY_CLEAR, 0515, Sent by clear screen or erase key.

kcmd   str    @4        KEY_COMMAND, 0545, cmd (command) key

kcpy   str    @5        KEY_COPY, 0546, copy key

kcrt   str    @6        KEY_CREATE, 0547, create key

kctab  str    kt        KEY_CTAB, 0525, Sent by clear-tab key

kcub1  str    kl        KEY_LEFT, 0404, Sent by terminal left arrow key

kcud1  str    kd        KEY_DOWN, 0402, Sent by terminal down arrow key

kcuf1  str    kr        KEY_RIGHT, 0405, Sent by terminal right arrow key

kcuu1  str    ku        KEY_UP, 0403, Sent by terminal up arrow key

kdch1  str    kD        KEY_DC, 0512, Sent by delete character key.

kdl1   str    kL        KEY_DL, 0510, Sent by delete line key.

ked    str    kS        KEY_EOS, 0516, Sent by clear-to-end-of-screen key.

kel    str    kE        KEY_EOL, 0517, Sent by clear-to-end-of-line key.

kend   str    @7        KEY_END, 0550, end key

kent   str    @8        KEY_ENTER, 0527, Enter/send (unreliable)

kext   str    @9        KEY_EXIT, 0551, exit key

kf0    str    k0        KEY_F(0), 0410, function key f0.

kf1    str    k1        KEY_F(1), 0411, function key f1.

kf10   str    k;        KEY_F(10), 0422, function key f10.

kf11   str    F1        KEY_F(11), 0423, function key f11.

kf12   str    F2        KEY_F(12), 0424, function key f12.

kf13   str    F3        KEY_F(13), 0425, function key f13.

kf14   str    F4        KEY_F(14), 0426, function key f14.

kf15   str    F5        KEY_F(15), 0427, function key f15.

kf16   str    F6        KEY_F(16), 0430, function key f16.

kf17   str    F7        KEY_F(17), 0431, function key f17.

kf18   str    F8        KEY_F(18), 0432, function key f18.

kf19   str    F9        KEY_F(19), 0433, function key f19.

kf2    str    k2        KEY_F(2), 0412, function key f2.

kf20   str    FA        KEY_F(20), 0434, function key f20.

kf21   str    FB        KEY_F(21), 0435, function key f21.

kf22   str    FC        KEY_F(22), 0436, function key f22.

kf23   str    FD        KEY_F(23), 0437, function key f23.

kf24   str    FE        KEY_F(24), 0440, function key f24.

kf25   str    FF        KEY_F(25), 0441, function key f25.

kf26   str    FG        KEY_F(26), 0442, function key f26.

kf27   str    FH        KEY_F(27), 0443, function key f27.

kf28   str    FI        KEY_F(28), 0444, function key f28.

kf29   str    FJ        KEY_F(29), 0445, function key f29.

kf3    str    k3        KEY_F(3), 0413, function key f3.

kf30   str    FK        KEY_F(30), 0446, function key f30.

kf31   str    FL        KEY_F(31), 0447, function key f31.

kf32   str    FM        KEY_F(32), 0450, function key f32.

kf33   str    FN        KEY_F(13), 0451, function key f13.

kf34   str    FO        KEY_F(34), 0452, function key f34.

kf35   str    FP        KEY_F(35), 0453, function key f35.

kf36   str    FQ        KEY_F(36), 0454, function key f36.

kf37   str    FR        KEY_F(37), 0455, function key f37.

kf38   str    FS        KEY_F(38), 0456, function key f38.

kf39   str    FT        KEY_F(39), 0457, function key f39.

kf4    str    k4        KEY_F(4), 0414, function key f4.

kf40   str    FU        KEY_F(40), 0460, function key f40.

kf41   str    FV        KEY_F(41), 0461, function key f41.

kf42   str    FW        KEY_F(42), 0462, function key f42.

kf43   str    FX        KEY_F(43), 0463, function key f43.

kf44   str    FY        KEY_F(44), 0464, function key f44.

kf45   str    FZ        KEY_F(45), 0465, function key f45.

kf46   str    Fa        KEY_F(46), 0466, function key f46.

kf47   str    Fb        KEY_F(47), 0467, function key f47.

kf48   str    Fc        KEY_F(48), 0470, function key f48.

kf49   str    Fd        KEY_F(49), 0471, function key f49.

kf5    str    k5        KEY_F(5), 0415, function key f5.

kf50   str    Fe        KEY_F(50), 0472, function key f50.

kf51   str    Ff        KEY_F(51), 0473, function key f51.

kf52   str    Fg        KEY_F(52), 0474, function key f52.

kf53   str    Fh        KEY_F(53), 0475, function key f53.

kf54   str    Fi        KEY_F(54), 0476, function key f54.

kf55   str    Fj        KEY_F(55), 0477, function key f55.

kf56   str    Fk        KEY_F(56), 0500, function key f56.

kf57   str    Fl        KEY_F(57), 0501, function key f57.

kf58   str    Fm        KEY_F(58), 0502, function key f58.

kf59   str    Fn        KEY_F(59), 0503, function key f59.

kf6    str    k6        KEY_F(6), 0416, function key f6.

kf60   str    Fo        KEY_F(60), 0504, function key f60.

kf61   str    Fp        KEY_F(61), 0505, function key f61.

kf62   str    Fq        KEY_F(62), 0506, function key f62.

kf63   str    Fr        KEY_F(63), 0507, function key f63.

kf7    str    k7        KEY_F(7), 0417, function key f7.

kf8    str    k8        KEY_F(8), 0420, function key f8.

kf9    str    k9        KEY_F(9), 0421, function key f9.

kfnd   str    @0        KEY_FIND, 0552, find key

khlp   str    %1        KEY_HELP, 0553, help key

khome  str    kh        KEY_HOME, 0406, Sent by home key.

khts   str    kT        KEY_STAB, 0524, Sent by set-tab key

kich1  str    kI        KEY_IC, 0513, Sent by ins char/enter ins mode key.

kil1   str    kA        KEY_IL, 0511, Sent by insert line.

kind   str    kF        KEY_SF, 0520, Sent by scroll-forward/down key

kll    str    kH        KEY_LL, 0533, Sent by home-down key

kmov   str    %4        KEY_MOVE, 0556, move key

kmrk   str    %2        KEY_MARK, 0554, mark key

kmsg   str    %3        KEY_MESSAGE, 0555, message key

knp    str    kN        KEY_NPAGE, 0522, Sent by next-page key

knxt   str    %5        KEY_NEXT, 0557, next object key

kopn   str    %6        KEY_OPEN, 0560, open key

kopt   str    %7        KEY_OPTIONS, 0561, options key

kpp    str    kP        KEY_PPAGE, 0523, Sent by previous-page key

kprt   str    %9        KEY_PRINT, 0532, print or copy

kprv   str    %8        KEY_PREVIOUS, 0562, previous object key

krdo   str    %0        KEY_REDO, 0563, redo key

kref   str    &1        KEY_REFERENCE, 0564, ref(erence) key

kres   str    &5        KEY_RESUME, 0570, resume key

krfr   str    &2        KEY_REFRESH, 0565, refresh key

kri    str    kR        KEY_SR, 0521, Sent by scroll-backward/up key

krmir  str    kM        KEY_EIC, 0514, Sent by rmir or smir in insert mode.

krpl   str    &3        KEY_REPLACE, 0566, replace key

krst   str    &4        KEY_RESTART, 0567, restart key

ksav   str    &6        KEY_SAVE, 0571, save key

kslt   str    *6        KEY_SELECT, 0601, select key

kspd   str    &7        KEY_SUSPEND, 0627, suspend key

ktbc   str    ka        KEY_CATAB, 0526, Sent by clear-all-tabs key.

kund   str    &8        KEY_UNDO, 0630, undo key

lf0    str    l0        Labels on function key f0 if not f0

lf1    str    l1        Labels on function key f1 if not f1

lf10   str    la        Labels on function key f10 if not f10

lf2    str    l2        Labels on function key f2 if not f2

lf3    str    l3        Labels on function key f3 if not f3

lf4    str    l4        Labels on function key f4 if not f4

lf5    str    l5        Labels on function key f5 if not f5

lf6    str    l6        Labels on function key f6 if not f6

lf7    str    l7        Labels on function key f7 if not f7

lf8    str    l8        Labels on function key f8 if not f8

lf9    str    l9        Labels on function key f9 if not f9

ll     str    ll        Last line, first column (if no cup)

mc0    str    ps        Print contents of the screen

mc4    str    pf        Turn off the printer

mc5    str    po        Turn on the printer

mc5p   str    pO        Turn on the printer for #1 bytes.

mgc    str    MC        Clear left and right soft margins

mrcup  str    CM        Memory relative cursor addressing.

nel    str    nw        Newline (behaves like cr followed by lf)

pad    str    pc        Pad character (rather than null)

pfkey  str    pk        Prog funct key #1 to type string #2

pfloc  str    pl        Prog funct key #1 to execute string #2

pfx    str    px        Prog funct key #1 to xmit string #2

pln    str    pn        Prog label #1 to show string #2

prot   str    mp        Turn on protected mode

rc     str    rc        Restore cursor to position of last sc.

rep    str    rp        Repeat char #1 #2 times. (G*)

rev    str    mr        Turn on reverse video mode

rf     str    rf        Name of file containing reset string.

rfi    str    RF        send next input char (for ptys)

ri     str    sr        Scroll text down

rin    str    SR        Scroll backward #1 lines. (G)

rmacs  str    ae        End alternate character set

rmam   str    RA        Turn off automatic margins

rmcup  str    te        String to end programs that use cup

rmdc   str    ed        End delete mode

rmir   str    ei        End insert mode;

rmkx   str    ke        Out of "keypad transmit" mode

rmln   str    LF        Turn off soft labels

rmm    str    mo        Turn off "meta mode"

rmp    str    rP        Like ip but when in replace mode

rmso   str    se        End stand out mode

rmul   str    ue        End underscore mode

rmxon  str    RX        Turn off xon/xoff handshaking

rs1    str    r1        Reset terminal completely to sane modes.

rs2    str    r2        Reset terminal completely to sane modes.

rs3    str    r3        Reset terminal completely to sane modes.

sc     str    sc        Save cursor position.

sgr    str    sa        Define the video attributes (G9)

sgr0   str    me        Turn off all attributes

smacs  str    as        Start alternate character set

smam   str    SA        Turn on automatic margins

smcup  str    ti        String to begin programs that use cup

smdc   str    dm        Delete mode (enter)

smgl   str    ML        Set soft left margin

smgr   str    MR        Set soft right margin

smir   str    im        Insert mode (enter);

smkx   str    ks        Put terminal in "keypad transmit" mode

smln   str    LO        Turn on soft labels

smm    str    mm        Turn on "meta mode" (8th bit)

smso   str    so        Begin stand out mode

smul   str    us        Start underscore mode

smxon  str    SX        Turn on xon/xoff handshaking

tbc    str    ct        Clear all tab stops.

tsl    str    ts        Go to status line, col #1

uc     str    uc        Underscore one char and move past it

vpa    str    cv        Like hpa but sets row. (G)

wind   str    wi        Current window is lines #1-#2 cols #3-#4

xoffc  str    XF        X-off character

xonc   str    XN        X-on character

 

FILES

/etc/termcap  

SEE ALSO

termcap(3X), termcap(5)  

DIAGNOSTICS

Tput prints error messages (unless suppressed using -e) and returns the following error codes on error:
#-1#Usage error.
#-2#Bad terminal type.
#-3#Bad capname.

 

BUGS

Complex capnames with many auxiliary parameters (such as sgr) do not work properly because curses has not been used - this program is based entirely on termcap (and that too from BSD4.2 manuals!)

-n option does not work for most capnames, so it has not been mentioned in this page.


 

Index

NAME
SYNOPSIS
DESCRIPTION
REQUESTS
FILES
SEE ALSO
DIAGNOSTICS
BUGS

This document was created by man2html, using the manual pages.
Time: 06:21:35 GMT, December 12, 2024