Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screenshot produces images containing typing from the future (i.e. further down in the .tape file)? #414

Open
hartwork opened this issue Nov 24, 2023 · 0 comments

Comments

@hartwork
Copy link

hartwork commented Nov 24, 2023

Describe the bug
Hi!

Thanks for making VHS and sharing it as Software Libre! 🙏 It made me go "wow!" when I first saw it and both the tool and the language reference are very nice — thanks! 🙏

One thing I ran into is that when I combine Screenshot <file> with Type "<text>", the screenshot may already include letters of the Type that came after it. So to reproduce it needs nothing but…

Screenshot screenshot.png
Type "hello vhs"

…and a bit of luck running it a few times. In my case I saw the very first letter typed in the screenshot, so that would be "h" here. When I just tried it again locally, the issue showed at first try:

cd "$(mktemp -d)"
export PATH="${HOME}/go/bin:${PATH}"
PS1='$ ' vhs <(echo $'Screenshot screenshot.png\nType "hello vhs"')

screenshot.png shows…

screenshot

…which proves my point.

A workaround seems to be to add Sleep 0.2s after the screenshot, but maybe I just have not seen it fail yet and soon will. In any case the current behavior of Screenshot including things from the future makes CI stability hard and is unexpected from a user point of view. Maybe it's considered worth investigating and fixing.

Best, Sebastian

CC @elmarsan

PS: When Screenshot is the last command in the .tape file, VHS does not create that file at all while saying so. Seems to be related. Again, adding Sleep 0.2s works around the problem.

PPS: Related? #70

Setup

  • OS = Ubuntu or macOS in GitHub Actions CI
  • Shell = Bash
  • Terminal Emulator = not sure
  • Terminal Multiplexer = none

To Reproduce
Use Screenshot followed by Type directly in a .tape file, then inspect the screenshot to find typing from the future.

Source Code

Screenshot screenshot.png
Type "hello vhs"

Expected behavior
The screenshot is fully saved before VHS continues typing.

Screenshots
n/a

Additional context
n/a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant