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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
# `/` search on a TERMINAL pane: the same tag input as a file pane, searching
# the shell's own scrollback (the plain text view Look reads, prompt rows
# hidden). Results land in a +Search OUTPUT BUFFER — a file pane with no file
# behind it, so its tag has no Save — and point at `@p0:LINE:COL-ENDCOL`, the
# look target that names a live pane, since a terminal has no path. n/N walk
# the buffer and look each row, scrolling the terminal to that line of its
# scrollback and selecting the span the row names.
# PLACEMENT, and this script is the proof: an output buffer is NOT a document
# — it is the result list of the pane that asked for it — so even here, with no
# doc pane in the session for it to join, it does NOT take a column of its own.
# It splits BELOW the shell it came from: every snap below stays ONE column,
# the shell's tag and the +Search tag both starting at x=0, thirty rows split
# between them, and nothing shifts sideways.
start 30 140
wait 8000 New Newcol
stable 700 20000
# print something to search (a bare boot starts in tty mode; the marker is
# split so the echoed command line, which normal mode hides anyway, can never
# be the thing that matched)
text printf 'x MA''RK a\nzz\nx MA''RK b\nzz\nx MA''RK c\n'
key enter
wait 10000 MARK c
stable 700 10000
key c-b
stable 600 8000
snap output
# / types the pattern into the terminal's tag exactly as on a file pane
key /
stable 400 5000
text MARK
stable 400 5000
snap typing
# Enter opens the results buffer: three @p0:LINE:COL rows, focus stays here
key enter
wait 10000 @p0:2:3
stable 700 15000
snap results
# n looks result 1: the terminal's cursor lands on that scrollback line, on
# the matched SPAN (cols 3..6, past the leading "x ") — not the start of the
# line, and selected rather than merely parked on
key n
stable 700 15000
snap first
snapstyle first
key n
stable 700 15000
snap second
# N walks back
key N
stable 700 15000
snap back
# a no-match search opens an empty buffer of its own; n has nowhere to go
key /
text zzqq
key enter
stable 700 10000
key n
stable 400 5000
snap nomatch
# right-clicking a word that names no file is the same search (acme button 3),
# but NOT in tty mode: there the click belongs to the program on the other end,
# so the buffer stays empty. Col 5 row 4 is the `M` of the first `x MARK a`,
# in the shell's body in both modes (normal hides the prompt row, leaving it
# blank, so the output rows sit at the same place either way).
key c-b
stable 600 8000
press right 5 4
release right 5 4
stable 700 10000
snap ttyinert
# back in normal mode the same click searches for MARK
key c-b
stable 600 8000
press right 5 4
release right 5 4
wait 10000 @p0:2:3
stable 700 15000
snap rightsearch
|