vhs icon indicating copy to clipboard operation
vhs copied to clipboard

Strange prompt output at the start of the gif

Open knpwrs opened this issue 3 years ago • 20 comments

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

knpwrs avatar Oct 27 '22 15:10 knpwrs

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

maaslalani avatar Oct 27 '22 15:10 maaslalani

@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.

maaslalani avatar Oct 27 '22 15:10 maaslalani

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

knpwrs avatar Oct 27 '22 16:10 knpwrs

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

nimrossum avatar Oct 30 '22 19:10 nimrossum

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 ...

maaslalani avatar Oct 30 '22 19:10 maaslalani

I think I might have improved that in #55

caarlos0 avatar Oct 31 '22 02:10 caarlos0

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.

knpwrs avatar Oct 31 '22 14:10 knpwrs

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.

caarlos0 avatar Oct 31 '22 14:10 caarlos0

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

image

enrichman avatar Nov 04 '22 08:11 enrichman

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

image

bbkane avatar Dec 04 '22 03:12 bbkane

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

transitive-bullshit avatar Dec 05 '22 06:12 transitive-bullshit

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?

bashbunni avatar Jan 13 '23 02:01 bashbunni

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?

bbkane avatar Jan 13 '23 14:01 bbkane

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

caarlos0 avatar Jan 13 '23 17:01 caarlos0

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

bbkane avatar Jan 13 '23 17:01 bbkane

sounds good, merged @bbkane

caarlos0 avatar Jan 13 '23 18:01 caarlos0

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

bashbunni avatar Jan 13 '23 18:01 bashbunni

@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.

caarlos0 avatar Jan 13 '23 18:01 caarlos0

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

graynk avatar Jan 27 '23 16:01 graynk

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

caarlos0 avatar Jan 27 '23 18:01 caarlos0