blob: 9a04f4f67fe71c8641223b424882c1055a2c083f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# Interactive: prompts.
command -v python3 >/dev/null 2>&1 || exit 77
mkdir here && cd here || exit 1
PS1='$ ' PS2='more> ' ENV='' HISTFILE='' HOME=$PWD \
python3 "$TESTS/tools/ptydrive.py" "$TSH" <<'END'
send PS1='[\\W:$?] '\r
send false\r
expect [here:1]
send PS1='\\w> '\r
expect ~>
send mkdir d && cd d\r
expect ~/d>
send PS1='$(echo cmd)-$((1+2))> '\r
expect cmd-3>
send echo "two\r
expect more>
send lines"\r
expect lines
send PS1='${nosuch?bad} '\r
send echo survived\r
expect survived
# bash's \[ \] mark text that does not move the cursor; they are
# dropped, so the prompt is the visible part only.
send PS1='\\[\\W\\]: '\r
send echo markers\r
expect d: echo markers
send PS1='$ '\r
send set -o ignoreeof\r
send \x04
expect leave
send set +o ignoreeof\r
send echo $- | grep -c i\r
send exit\r
END
|