-
Notifications
You must be signed in to change notification settings - Fork 321
Description
Describe the bug
When a .tape
file generates enough output to cause the terminal to scroll, the testing/golden file outputs (.txt
, .ascii
, .test
) fail to capture the current viewport. Instead of saving the visible lines, vhs
repeatedly writes the lines from the top of the buffer.
This issue likely stems from the VHS.Buffer
method, which appears to not account for the scroll position when generating the output frame.
Setup
- OS: macOS (15.6.1)
- Shell:
zsh
,bash
,nu
To Reproduce
-
Create a file named
testing-output.tape
with the following content.Set Height 300 Output testing-output.ascii Type "echo $LINES" Enter Type "seq 10" Enter Type "echo foo" Enter
-
Run the tape file:
vhs testing-output.tape
. -
Inspect the generated
testing-output.ascii
file.
Actual Behavior
The output file captures the top of the buffer at each step. The final frames are missing the scrolled output from seq 10
and the subsequent echo foo
command.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
> echo $LINES
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
> echo $LINES
6
>
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
> echo $LINES
6
> seq 10
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
> echo $LINES
6
> seq 10
1
2
3
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
> echo $LINES
6
> seq 10
1
2
3
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
> echo $LINES
6
> seq 10
1
2
3
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Expected Behavior
The output file should accurately reflect the terminal's viewport at each step, showing the content as it scrolls into view, e.g., like this:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
> echo $LINES
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
> echo $LINES
6
>
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
> echo $LINES
6
> seq 10
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
6
7
8
9
10
>
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
6
7
8
9
10
> echo foo
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
8
9
10
> echo foo
foo
>
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ