fish-shell/tests/filter-control-sequences.sh
Johannes Altmanninger 1e858eae35 tests: filter control sequences only when interactive
This demonstrates that we only write control sequences when interactive.
2024-04-12 12:28:22 +02:00

14 lines
242 B
Bash
Executable file

#!/bin/sh
escape=$(printf '\033')
"$1" -c 'cat | string replace -ra $argv[1] ""' -- "\
""$escape\[\?2004h""\
""$escape\[>4;1m""\
""$escape\[>5u""\
""$escape=""\
""|""\
""$escape\[\?2004l""\
""$escape\[>4;0m""\
""$escape\[<1u""\
""$escape>"