charmbracelet / vhs

Your CLI home video recorder 📼
MIT License
15.25k stars 259 forks source link

Strange prompt output at the start of the gif #39

Open knpwrs opened 2 years ago

knpwrs commented 2 years ago

I attempted to put together a gif to demo my crate, woodo: https://github.com/knpwrs/woodo

Here is my script:

Output woodo.gif

Set FontSize 32
Set Width 800
Set Height 1200

Type woodo
Sleep 500ms
Enter
Sleep 500ms
Type sudo woodo
Sleep 500ms
Enter
Type lolnope
Enter
Sleep 5s

Here is the output gif:

woodo

The gif starts out with 11 frames, ending with:

image

Before transitioning to:

image

maaslalani commented 2 years ago

Thanks for reporting this, looks like the default bash message that Apple prints when using bash. I will take a look!

maaslalani commented 2 years ago

@knpwrs, can you add the following to your .bashrc?

export BASH_SILENCE_DEPRECATION_WARNING=1

If this works for you, I'll add it by default in VHS so that people don't have to add it manually.

knpwrs commented 2 years ago

That doesn't appear to suppress the message. Now it lasts for 23 frames.

This is frame 22:

image

And this is frame 23:

image

joglr commented 2 years ago

I am experiencing something similar on Windows. @knpwrs How are you looking at the individual frames? demo Using this tape:

# Where should we write the GIF?
Output demo.gif

# Set up a 1200x600 terminal with 46px font.
# Set FontSize 46
Set Width 1200
Set Height 600

# Type a command in the terminal.
Type "npx -y git-truck"

# Pause for dramatic effect...
Sleep 500ms

# Run the command by pressing enter.
Enter

# Admire the output for a bit.
Sleep 30s
maaslalani commented 2 years ago

As a temporary measure, until we get this fixed, I believe this adding a Hide + Sleep (place after output and settings) should skip the frames for you at the beginning.

Hide Sleep 1s Show

# Start ...
caarlos0 commented 2 years ago

I think I might have improved that in #55

knpwrs commented 2 years ago

How are you looking at the individual frames?

When you open .gif files in Preview.app on macOS all of the individual frames show up in the left-hand thumbnail view.

caarlos0 commented 2 years ago

You can also do Set Output frames/ (trailing slash is important I think) and vhs will output all frames as png in a frames folder.

enrichman commented 2 years ago

I got the same issue on a Mac, this is the first frame of the example tape:

image
bbkane commented 1 year ago

I'm getting extra frames too, with zsh on Macos:

image
transitive-bullshit commented 1 year ago

Same problem here; no matter what I do or which shell I use, these vhs-specific shell commands appear at the start of the video (mac OS Monterey).

https://user-images.githubusercontent.com/552829/205569182-0183a7a7-63e8-4c43-8330-a0409749c314.mp4

My current attempt:

Output media/demo.mp4

Hide
Require npx

#Set Shell bash
Set FontSize 17
Set Width 1200
Set Height 600
Set Padding 24
#Set LoopOffset 75%

Show

Sleep 1s

Type "npx tsx src/example.ts"

Sleep 500ms
Enter
Show

Sleep 5s
Sleep 5s
bashbunni commented 1 year ago

I know this is from a while back, but I just tried it on my Mac after installing vhs with brew and it seems to be fixed. Is anyone still having this issue?

bbkane commented 1 year ago

After commenting out my workaround ( lines 16-19) I just retried it with demo.tape and still saw the extraneous text I mentioned in above comments.

$ vhs --version
vhs version v0.2.0 (6f7cc81)

Who knows, this might have something to do with my zsh config?

caarlos0 commented 1 year ago

@bbkane that might be it, yes, if so, this should help: https://github.com/charmbracelet/vhs/pull/212

bbkane commented 1 year ago

I can retry after that's merged, thanks @caarlos0 ! If I get time, I'll also try with an unconfigured zsh and see what happens

caarlos0 commented 1 year ago

sounds good, merged @bbkane

bashbunni commented 1 year ago

I'm actually seeing this exact message in a commit for vhs Setup() func https://github.com/charmbracelet/vhs/commit/f21a959d2b5c6687e290c317e8f22cbbbced12b5. Carlos probably fixed that with his PR

caarlos0 commented 1 year ago

@bashbunni yeah that cmd runs before right after starting zsh... my guess is that the user/system config is taking a bit too long to load, and then the clear takes a little too long to exec, and we see those frames.

If that's the issue, my PR should fix or at least help with that... it prevents loading user & system configs, and also uses another way to set prompt.

graynk commented 1 year ago

I've just installed it from brew and the issue is still present. Though the workaround with Hide Sleep 5s Show works

caarlos0 commented 1 year ago

the fixes I made are not released yet I think...