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

Hide is not working #130

Open
MarvinJWendt opened this issue Nov 2, 2022 · 13 comments · May be fixed by #304
Open

Hide is not working #130

MarvinJWendt opened this issue Nov 2, 2022 · 13 comments · May be fixed by #304

Comments

@MarvinJWendt
Copy link

MarvinJWendt commented Nov 2, 2022

I just noticed that Hide is not working on my machine using docker. The README looks like it too:

image

The animation of the command "typing" is not there, but the command itself is. This makes it hard to use for setup, as the whole setup process is visible to the user.

@maaslalani
Copy link
Contributor

The hide command will hide frames from being recorded not the actual content of what is being typed. That is why the README shows that the command is already typed and you do not see the typing in the GIF but the typing does occur on the terminal.

@MarvinJWendt
Copy link
Author

MarvinJWendt commented Nov 2, 2022

Oh okay, got it! Is there any way to hide the full setup? Using the docker env I have to install some packages as they are not already in alpine (like curl), but I'd like to hide them from the user.

@maaslalani
Copy link
Contributor

Yep, do the Hide and all the typing and then clear the screen (by typing "clear" and Enter)

@MarvinJWendt
Copy link
Author

Okay this seems to (kinda) work! The first few frames are still showing the output of apk add curl, but I think this will eventually be handled by #39 ?

@maaslalani
Copy link
Contributor

Okay this seems to (kinda) work! The first few frames are still showing the output of apk add curl, but I think this will eventually be handled by #39 ?

Yes we'll definitely sort out the frames issue but to prevent it for now I think you can sleep for a little but after you've cleared the screen (but before the show)

@maaslalani
Copy link
Contributor

maaslalani commented Nov 2, 2022

But yes soon we'll have it so theres not extra frames cutting in. That is definitely a bug!

@MarvinJWendt
Copy link
Author

MarvinJWendt commented Nov 2, 2022

[...] I think you can sleep for a little but after you've cleared the screen (but before the show)

Works like a charmbracelet 😉

@MarvinJWendt
Copy link
Author

MarvinJWendt commented Nov 2, 2022

Just out of interest, why does Hide not hide the full command? IMO it's not actually "hiding" the stuff between Hide and Show, and for me it's not very obvious that Hide just disables the typing animation. Maybe a flag like Hide@animations and/or Hide@all would do the trick?

This could probably be expanded to Hide@cursor, Hide@colors, Hide@stderr and stuff like that.

@maaslalani
Copy link
Contributor

maaslalani commented Nov 2, 2022

Oh interesting, that is a very good idea and would be quite useful, IMO. I generally agree that it is a little confusing what Hide does and maybe needs a bit more documentation or a rename.

Maybe Skip is a better name? And its counter part is Resume/Continue/Play?

@MarvinJWendt
Copy link
Author

MarvinJWendt commented Nov 2, 2022

Maybe Skip is a better name? And its counter part is Resume/Continue/Play?

I'll leave the naming up to you, as I always struggle with it in my own projects 😆

Just another thing I noticed is, that with the clear command solution, it's currently not possible to hide steps between steps that should be visible. For example, my project is an automated installer, and to showcase it, the terminal needs to be reopened (because the $PATH changed). To simulate that, I source .profile after the installer runs, but before the installed program is called. Now I want to hide the source .profile in the middle.

This would also be handled then :)

@griimick
Copy link
Contributor

griimick commented Nov 2, 2022

Oh interesting, that is a very good idea and would be quite useful, IMO. I generally agree that it is a little confusing what Hide does and maybe needs a bit more documentation or a rename.

Maybe Skip is a better name? And its counter part is Resume/Continue/Play?

I too had trouble understanding it initially. Pause/Resume recording sounds better to me.

@normanr
Copy link

normanr commented Nov 14, 2022

Pause and Resume will probably be the least confusing. Interestingly they behave very similar to Xoff(^S) and Xon(^Q).

(Also for what it's worth: compressed video players have to do something similar when doing a seek to a frame between two keyframes: they have to pause the video decoder's output, send it the previous keyframe, followed by all frames up to the frame it wants to show, then re-enable output and only then send it the frame it wants to display)

@elmarsan elmarsan linked a pull request May 15, 2023 that will close this issue
@okineadev
Copy link

I solved the problem like this by running clear command before Show:

Hide
Type 'vhs_sandbox="$(mktemp -d)"' Enter
Type 'cd "$vhs_sandbox"' Enter
+ Type 'clear' Enter
Show

...

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

Successfully merging a pull request may close this issue.

5 participants