Bugzilla – Attachment 99614 Details for
Bug 144620
terminal features
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
My personal ~/lib/share/sh.lib a library which uses terminfo and tput
sh.lib (text/plain), 3.32 KB, created by
Dr. Werner Fink
on 2006-09-26 10:57:54 UTC
(
hide
)
Description:
My personal ~/lib/share/sh.lib a library which uses terminfo and tput
Filename:
MIME Type:
Creator:
Dr. Werner Fink
Created:
2006-09-26 10:57:54 UTC
Size:
3.32 KB
patch
obsolete
># ># /usr/lib/lpdfilter/global/sh.lib ># ># Define often some usefull shell functions for coloring ># shell dialogs ># ># Copyright (c) 1996,2001 SuSE Gmbh Nuernberg, Germany. ># ># Author: Werner Fink <feedback@suse.de> > >function enter_ca_mode { tput smcup; } >function exit_ca_mode { tput rmcup; } >function save_cursor { tput sc; } >function clear_screen { tput clear; } >function clr_eol { tput el; } >function enter_rev_mode { tput rev; } >function reset { tput reset; } ># terminfo entry for xterm 3.1.2G was buggy >function cursor_invisible { > local _civis; > _civis=$(tput civis); > [ -z "$_civis" ] && _civis="\033[?25l" > echo -en "$_civis" >} >function cursor_visible { > local _cvvis; > _cvvis=$(tput cvvis); > [ -z "$_cvvis" ] && _cvvis="\033[?25h" > echo -en "$_cvvis" >} >function restore_cursor { tput rc; } >function cursor_address { tput cup $@; } >function parm_left_cursor { > local _left; > _left=$(tput cub $@); > [ -z "$_left" ] && _left="\033[$@D" > echo -en "$_left" >} > >function parm_right_cursor { > local _right; > _right=$(tput cuf $@); > [ -z "$_right" ] && _right="\033[$@C" > echo -en "$_right" >} > >function normal_screen { > normal > clear_screen > exit_ca_mode > restore_cursor > cursor_visible > nocolor > reset > test -n "$ostty" && stty "$ostty" >} > ># ># if you use this you should set `trap "normal_screen" 0 1 2 3 5 7 9 10 13 15' ># or use alternate_screen_on ># >function alternate_screen { > ostty=$(stty -g) > cursor_invisible > enter_ca_mode >} > >function alternate_screen_on { > trap "normal_screen; $@" 0 1 2 3 5 7 9 10 13 15 > save_cursor > alternate_screen > clear_screen >} > ># ># Turn off all attributes ># >function normal { tput sgr0; } >function nocolor { tput op; } > ># ># Some attributes ># >function reverse { tput smso; } >function rerever { tput rmso; } >function bold { tput bold; } >function uline { tput smul; } >function nline { tput rmul; } ># terminfo entry for xterm 3.2 was missing it >function invis { > local _invis; > _invis=$(tput invis); > [ -z "$_invis" ] && _invis="\033[8m" > echo -en "$_invis" >} ># ># More attributes ># >function black { tput setaf 0; } >function red { tput setaf 1; } >function green { tput setaf 2; } >function yellow { tput setaf 3; } >function blue { tput setaf 4; } >function magenta { tput setaf 5; } >function cyan { tput setaf 6; } >function white { tput setaf 7; } >function xxx { tput setaf 8; } >function none { tput setaf 9; } > >function b_black { tput setab 0; } >function b_red { tput setab 1; } >function b_green { tput setab 2; } >function b_yellow { tput setab 3; } >function b_blue { tput setab 4; } >function b_magenta { tput setab 5; } >function b_cyan { tput setab 6; } >function b_white { tput setab 7; } >function b_xxx { tput setab 8; } >function b_none { tput setab 9; } > > bold=$(bold) > norm=$(normal) > uline=$(uline) > nline=$(nline) > smso=$(reverse) > rmso=$(rerever) > > none=$(none) > red=$(red) > green=$(green) > yellow=$(yellow) > blue=$(blue) >magenta=$(magenta) > cyan=$(cyan) > white=$(white) > xxx=$(xxx) > black=$(black) > > b_black=$(b_black) > b_red=$(b_red) > b_green=$(b_green) > b_yellow=$(b_yellow) > b_blue=$(b_blue) >b_magenta=$(b_magenta) > b_cyan=$(b_cyan) > b_white=$(b_white) > b_xxx=$(b_xxx) > b_none=$(b_none) > >#### ># sh.lib ends here
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 144620
: 99614