summaryrefslogtreecommitdiffhomepage
path: root/tests/linux/i-prompt-esc.sh
blob: 18efd07ea31c2428afd382d6bbdc56807f0b7137 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Interactive: a prompt carrying sequences that are not just SGR.
#
# A terminal title (OSC, ended by BEL) and the charset reset plus colour
# that `tput sgr0` writes (`ESC ( B ESC [ m`) both come from a terminal's
# terminfo entry, and a prompt copied from elsewhere is full of them.
# None of them takes a column, so the line scrolls where a plain prompt
# of the same width would: a width rule that knows only `ESC [ ... m`
# counts the title and the `(B` as text, keeps 7 columns too few, and the
# redraw after ^A shows a shorter window than this expectation.
command -v python3 >/dev/null 2>&1 || exit 77
python3 "$TESTS/tools/ptydrive.py" -c 16 "$TSH" <<'END'
send PS1='\\e]0;t\x07\\e(B\\e[1;32mP\\e[0m> '\r
expect P>
send abcdefghijklmn
send \x01
send X
expect Xabcdefghijk
send \x03
expect P>
send exit\r
END