From 5d3d2e3b1161acce557a4e757d062bec6bce33cb Mon Sep 17 00:00:00 2001 From: ville rantanen Date: Mon, 9 Nov 2020 14:54:40 +0200 Subject: [PATCH] plain escape sequences for qolop --- reporting/qolop | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/reporting/qolop b/reporting/qolop index 1dfc792..c7b9ad8 100755 --- a/reporting/qolop +++ b/reporting/qolop @@ -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