From 7da500c3f9429cd497310bf21ec9a65ca5f89d52 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Mon, 21 Aug 2023 16:26:31 +0200 Subject: [PATCH] add test on OSC 52 --- tests/osc_selection.sh | 48 ++++++++++++++++++++++++++++++++++++++++++ tests/tests.results | 1 + 2 files changed, 49 insertions(+) create mode 100755 tests/osc_selection.sh diff --git a/tests/osc_selection.sh b/tests/osc_selection.sh new file mode 100755 index 00000000..ce19eae6 --- /dev/null +++ b/tests/osc_selection.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +# fill space with E +printf '\033[69;1;1;25;80\044x' + +#set color +printf '\033[46;31;3m' + +# List of base64 strings used in this test: +# "foobarqux" => Zm9vYmFycXV4Cg== +#"Terminology rox" => VGVybWlub2xvZ3kgcm94Cg== +#"testing!!!!!" => dGVzdGluZyEhISEhCg== +# +# +#set foobarqux as primary selection +printf "\033]52;p;Zm9vYmFycXV4Cg==\033\\" +#set 'testing!!!!!' as clipboard selection +printf "\033]52;c;dGVzdGluZyEhISEhCg==\033\\" +sleep 0.2 + + +# move +printf '\033[3;3H' +# query primary +printf "\033]52;p;?\033\\" +sleep 0.2 + +# move +printf '\033[5;3H' +# query clipboard +printf "\033]52;c;?\033\\" +sleep 0.2 + +# move +printf '\033[7;3H' +# query primary, not explicit +printf "\033]52;;?\033\\" +sleep 0.2 + +# reset primary +printf "\033]52;p;\033\\" +#set 'testing!!!!!' as clipboard selection +printf "\033]52;c;dGVzdGluZyEhISEhCg==\033\\" +sleep 0.2 +# move +printf '\033[9;3H' +# query primary then clipboard +printf "\033]52;pc;?\033\\" diff --git a/tests/tests.results b/tests/tests.results index 8e2bc563..26d0e2a5 100644 --- a/tests/tests.results +++ b/tests/tests.results @@ -153,3 +153,4 @@ xterm-colors-rgb.sh 3269d17289a29ccec79598d47db7add7 xterm-colors-rgbi.sh 3269d17289a29ccec79598d47db7add7 xterm-set-cursor-color.sh e3d64c03d8257d7db7cf72204f4e3b2c csi-38-no-value.sh b2f4d1ab6a3171950371c88b4aae9c58 +osc_selection.sh 4579ba1bf3b5ca4b13b5701f1d52d597