summaryrefslogtreecommitdiff
path: root/test/snapshots/ttyedit.snap
blob: 6ee3ca031645933d61035a1e6f47277c9d2ef524 (plain) (blame)
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
36
37
38
39
40
41
42
43
44
45
# editing a shell pane exactly like a document: Enter SPLITS the line under
# the cursor and pushes the shell rows below it down, `o` opens a fresh line,
# and backspace at column 0 joins back up. Before the edit buffer landed a
# terminal could only splice single-row insertion runs, so none of this was
# expressible. test/hxcases/parity.jsonl pins the keystroke-level equivalence
# with a file pane case for case; this is the end-to-end pty proof.
file words.txt alpha beta
start 31 100 -n 3
wait 8000 words.txt
stable 700 20000
key c-b
stable 600 8000
text printf 'one two three\nfour five six\nseven eight nine\n'
key enter
wait 8000 seven
stable 700 10000
key c-b
stable 600 8000
# click into the middle of the first output row
press left 8 9
release left 8 9
stable 400 5000
snap before
# Enter splits the row there: "one t" stays, "wo three" becomes a real line
# of its own and the two output rows below it slide down
key i enter
stable 400 5000
snap split
key esc
stable 400 5000
# `o` opens a line below the split's tail and pushes the rest down again
key o
text OPEN
key esc
stable 400 5000
snap opened
# backspace at column 0 joins the opened line back onto its predecessor
key i home bs
key esc
stable 400 5000
snap joined
# undo walks the whole session back out to untouched shell output
key u u u
stable 400 5000
snap undone