blob: 4ac00d4dd9fdd60c623e1b1ce7787a2613dd2e2a (
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
35
|
# Interactive: history, fc, ^R, HISTFILE.
command -v python3 >/dev/null 2>&1 || exit 77
printf 'echo from-file\n' >hist
PS1='$ ' ENV='' HISTFILE=$PWD/hist HISTSIZE=50 \
python3 "$TESTS/tools/ptydrive.py" "$TSH" <<'END'
send \x1b[A\r
expect from-file
send echo one\r
send echo two\r
send \x1b[A\x1b[A\x1b[B\r
expect two
send \x12on\r
expect one
send \x12tw\x07echo cancelled\r
expect cancelled
send for i in a b\r
send do echo $i\r
send done\r
expect b
send fc -l\r
expect done
send fc -ln -2\r
send fc -s one=uno echo\\ one\r
expect uno
send fc -s\r
expect uno
send FCEDIT=true; fc -e true echo\r
expect uno
send echo ' not recorded twice'\r
send echo ' not recorded twice'\r
send fc -l -1\r
send exit\r
END
echo "--- saved:"
tail -n 3 hist
|