diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-01-07 12:46:05 +1100 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-01-10 19:27:47 +0100 |
| commit | ac77d0ce5fc8ba59909ebb6d2a38052dbae6e871 (patch) | |
| tree | cbec9a47826ed7517e8860a9997c4a94ba3cda52 | |
| parent | accc33148e0aab5597b7f409f8e97f8985c1828a (diff) | |
| download | passt-ac77d0ce5fc8ba59909ebb6d2a38052dbae6e871.tar passt-ac77d0ce5fc8ba59909ebb6d2a38052dbae6e871.tar.gz passt-ac77d0ce5fc8ba59909ebb6d2a38052dbae6e871.tar.bz2 passt-ac77d0ce5fc8ba59909ebb6d2a38052dbae6e871.tar.lz passt-ac77d0ce5fc8ba59909ebb6d2a38052dbae6e871.tar.xz passt-ac77d0ce5fc8ba59909ebb6d2a38052dbae6e871.tar.zst passt-ac77d0ce5fc8ba59909ebb6d2a38052dbae6e871.zip | |
test: Handle Operating System Command escapes in terminal output
Our "old style" test script stuff uses raw terminal output scraped from
tmux. This might include terminal escape sequences from the shell, or
whatever we run in it: they think they're talking to a terminal emulator
not a script, and they're not entirely incorrect.
In several places we filter out ANSI ESC-[ sequences to make this work.
However, this doesn't include ESC-] "Operating System Command" sequences.
Something I've updated in Fedora 43 generates heaps of these, which break
everything.
Add more hairy regexps to filter these out as well.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
| -rwxr-xr-x | test/lib/term | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/lib/term b/test/lib/term index f596364..89e4fdb 100755 --- a/test/lib/term +++ b/test/lib/term @@ -203,7 +203,7 @@ pane_wait() { __done=0 while - __l="$(tail -1 ${LOGDIR}/pane_${__lc}.log | sed 's/[[][^a-zA-Z]*[a-zA-Z]//g')" + __l="$(tail -1 ${LOGDIR}/pane_${__lc}.log | sed 's/[[][^a-zA-Z]*[a-zA-Z]//g;s/[]][^]*[\]//g')" case ${__l} in *"$ " | *"# ") return ;; esac @@ -215,7 +215,7 @@ pane_wait() { pane_parse() { __pane_lc="$(echo "${1}" | tr [A-Z] [a-z])" - __buf="$(tail -n2 ${LOGDIR}/pane_${__pane_lc}.log | head -n1 | sed 's/^[^\r]*\r\([^\r]\)/\1/' | tr -d '\r\n')" + __buf="$(tail -n2 ${LOGDIR}/pane_${__pane_lc}.log | head -n1 | sed 's/^[^\r]*\r\([^\r]\)/\1/;s/[]][^]*[\]//g' | tr -d '\r\n')" [ "# $(eval printf '%s' \"\$${1}_LAST_CMD\")" != "${__buf}" ] && \ [ "$ $(eval printf '%s' \"\$${1}_LAST_CMD\")" != "${__buf}" ] && |
