plain escape sequences for qolop
This commit is contained in:
@@ -96,11 +96,12 @@ _qCol() {
|
||||
local CLR='\033[2J' # Clear screen
|
||||
local CLREND='\033[K' # Clear to end of line
|
||||
local CLRBEG='\033[1K' # Clear to beginning of line
|
||||
local CLRLNE='\033[2K' # Clear the line
|
||||
local CLRSCR="$CLR"'\033[0;0H' # Clear screen, reset cursor
|
||||
|
||||
local color_keys=" K R G B Y M C W k r g b y m c w S s U u z Z \
|
||||
ic io st so bk br bg by bb bm bc bw \
|
||||
CLR CLREND CLRBEG CLRSCR "
|
||||
CLR CLREND CLRBEG CLRLNE CLRSCR "
|
||||
|
||||
[[ "$1" = "export" ]] && {
|
||||
local key
|
||||
@@ -129,6 +130,15 @@ _qCode() {
|
||||
}
|
||||
}
|
||||
|
||||
_qEsc() {
|
||||
# Enter numerical ANSI commands directly
|
||||
local arg val
|
||||
for ((arg=1;arg<=$#;arg++)) {
|
||||
val=${!arg}
|
||||
printf '\033['"${val}"
|
||||
}
|
||||
}
|
||||
|
||||
_qParse() {
|
||||
# Parse written colors to codes: 'help' to get help
|
||||
local val codes
|
||||
@@ -287,6 +297,7 @@ ${_S}=====================${_Z}
|
||||
2J ;H CLRSCR _qClr() Clear screen, move cursor to origo
|
||||
K CLREND Clear to end of line
|
||||
1K CLRBEG Clear to beginning of line
|
||||
2K CLRLNE Clear line
|
||||
_qReset() Reset terminal
|
||||
|
||||
s _qPos save Save location u _qPos restore Restore location
|
||||
@@ -294,6 +305,7 @@ ${_S}=====================${_Z}
|
||||
B _qPos down Down F _qPos linedown Down line
|
||||
C _qPos right Right y;xH _qPos abs y x Absolute Position
|
||||
D _qPos left Left
|
||||
_qEsc function prefixes set of numerical codes with escape sequence
|
||||
"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user