mirror of
https://github.com/sstephenson/bats.git
synced 2024-11-17 11:42:33 +01:00
Emit ANSI escape sequences directly instead of calling tput
This commit is contained in:
parent
df4def2e67
commit
1534201101
|
@ -75,11 +75,11 @@ printf_with_truncation() {
|
||||||
|
|
||||||
go_to_column() {
|
go_to_column() {
|
||||||
local column="$1"
|
local column="$1"
|
||||||
tput hpa "$column"
|
printf "\x1B[%dG" $(( $column + 1 ))
|
||||||
}
|
}
|
||||||
|
|
||||||
clear_to_end_of_line() {
|
clear_to_end_of_line() {
|
||||||
tput el
|
printf "\x1B[K"
|
||||||
}
|
}
|
||||||
|
|
||||||
advance() {
|
advance() {
|
||||||
|
@ -91,12 +91,11 @@ advance() {
|
||||||
set_color() {
|
set_color() {
|
||||||
local color="$1"
|
local color="$1"
|
||||||
local weight="$2"
|
local weight="$2"
|
||||||
tput setaf "$color"
|
printf "\x1B[%d;%dm" $(( 30 + $color )) "$( [ "$weight" = "bold" ] && echo 1 || echo 22 )"
|
||||||
[ -z "$weight" ] || tput "$weight"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clear_color() {
|
clear_color() {
|
||||||
tput sgr0
|
printf "\x1B[0m"
|
||||||
}
|
}
|
||||||
|
|
||||||
plural() {
|
plural() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user