From f168a97a354ae23a759a8321b76ea0d8a4030552 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Tue, 23 Jun 2020 00:05:12 +0200 Subject: [PATCH] tests: test xterm OSC 10/11 to change/get {fore,back}ground colors --- tests/tests.results | 2 ++ tests/xterm-osc-10.sh | 25 +++++++++++++++++++++++++ tests/xterm-osc-11.sh | 25 +++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100755 tests/xterm-osc-10.sh create mode 100755 tests/xterm-osc-11.sh diff --git a/tests/tests.results b/tests/tests.results index adfb46c3..e17f07d2 100644 --- a/tests/tests.results +++ b/tests/tests.results @@ -143,3 +143,5 @@ color_link_edc.sh a6e4b47eb65c04da568b9662fd80b7e0 color_link_css_rgb.sh c1f5a5b4f3d87b710aed59f72439a645 color_link_css_hsl.sh fc9bda72bd4eea5e9414ef9755ae176a crash_empty_osc.sh b87272896ce7be9856253b32be1bef14 +xterm-osc-10.sh b8c23c9c5482b1e9c30d8a261edc29f0 +xterm-osc-11.sh 3e02038964b78d948fb599c996bf370d diff --git a/tests/xterm-osc-10.sh b/tests/xterm-osc-10.sh new file mode 100755 index 00000000..eae8554b --- /dev/null +++ b/tests/xterm-osc-10.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# char width: 7 +# char height: 15 + +# set color +printf '\033[0;46;3m' + +# clear screen +printf '\033[2J' + +# move to 0; 0 +printf '\033[0;0H' + +printf 'The purpose of computing is insight, not numbers.\r\n' +printf 'Richard Hamming\r\n' + +# invalid colors +printf '\033]10;#ff0\007' +printf '\033]10;#FfFfFfFf\007' +printf '\033]10;fff000\007' +# change foreground color and then query it +printf '\033]10;#ff00FF\007' +printf '\033]10;?\007' +sleep 0.1 diff --git a/tests/xterm-osc-11.sh b/tests/xterm-osc-11.sh new file mode 100755 index 00000000..1130058e --- /dev/null +++ b/tests/xterm-osc-11.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# char width: 7 +# char height: 15 + +# set color +printf '\033[0;31;3m' + +# clear screen +printf '\033[2J' + +# move to 0; 0 +printf '\033[0;0H' + +printf 'The purpose of computing is insight, not numbers.\r\n' +printf 'Richard Hamming\r\n' + +# invalid colors +printf '\033]11;#ff0\007' +printf '\033]11;#FfFfFfFf\007' +printf '\033]11;fff000\007' +# change background color and then query it +printf '\033]11;#ff00FF\007' +printf '\033]11;?\007' +sleep 0.1