Screenshot isn't always produced when it's the last command
Describe the bug
When nothing comes after a Screenshot, vhs seems to skip it sometimes.
You can see at 0:14, the second.png was not created.
https://github.com/user-attachments/assets/7575257b-f9cb-4527-9b7d-f213be6650a2
Setup
- vhs 0.8.0 from nixpkgs
- Zsh, Kitty, NixOS
To Reproduce Run this multiple times:
Type "echo some text"
Screenshot first.png
Type "echo some other text"
Screenshot second.png
# Type "end" # If you add a command after, it seems to work everytime
I'm seeing something similar. This is repro helped me and I see another example:
# <...beginning of tape>
Screenshot foo.png
Hide
Type "q"
# <eof>
With that sequence , no screenshot is written. With the Hide removed or moved after the Type, the Screenshot is captured.
I've seen this a few times too. I generally workaround it by adding a sleep command after the screenshot if needed. The problem seems like that the screenshot only gets recorded if there's a frame recorded at that same moment, so making sure that actually happens fixes this.