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

vhs record generates invalid tapes when used PageUp/Down is repeatedly pressed #559

Open
PatrickHechler opened this issue Dec 18, 2024 · 1 comment · May be fixed by #570
Open

vhs record generates invalid tapes when used PageUp/Down is repeatedly pressed #559

PatrickHechler opened this issue Dec 18, 2024 · 1 comment · May be fixed by #570
Labels
bug Something isn't working

Comments

@PatrickHechler
Copy link

PatrickHechler commented Dec 18, 2024

Describe the bug
when vhs record is used and PageUp (or PageDown) is pressed multiple times (fast) the output contains a line like: Pageup 10/Pagedown 10.
this line is not considered valid by vhs:

File: vhs-file.tape
  2 │ Pageup 10
      ^^^^^^ Invalid command: Pageup

  2 │ Pageup 10
             ^^ Invalid command: 10

parser: 2 error(s)
recording failed

Setup
Please complete the following information along with version numbers, if applicable.

  • OS Arch
  • Shell zsh
  • Terminal Emulator vhs, kitty

To Reproduce
Steps to reproduce the behavior in normal terminal:

  1. start vhs record > testfile.tape
  2. Hold the PageDown or PageUp key for some time
  3. finish the record (i.e. use the exit command)
  4. start vhs testfile.tape
  5. See error

Steps to reproduce the behavior in vhs terminal:

  1. start vhs testfile.tape
    • see the Source Code section
    • this basically just does steps 1..3
  2. start vhs invalid-file.tape
  3. See error

Source Code
If needed the error can be reproduced using the vhs terminal.
vhs file.tape will be successfull, but the generated invalid-file.tape is invalid.

Set Shell zsh
Type "vhs record > invalid-file.tape"
Enter
PageUp 10
Ctrl+C
Type "exit"
Enter
Type "exit"
Enter

Expected behavior
vhs record generates valid output (the output is accepted by vhs if given as .tape file).
for example vhs record could generate PageUp and PageDown commands instead of Pageup/Pagedown.

Screenshots
Add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@bashbunni bashbunni added the bug Something isn't working label Jan 15, 2025
@bashbunni
Copy link
Member

Was able to reproduce this:

→ $ vhs record
→ cat README.md | gum pager
→
Set Shell zsh
Sleep 2.5s
Type "cat README"
Sleep 500ms
Type ".md | "
Sleep 1.5s
Type "gum pager"
Enter
Sleep 2s
Pagedown
Sleep 500ms
Pagedown 26
Pageup
Sleep 500ms
Pageup 22
Sleep 500ms
Type "q"
Sleep 1s
Ctrl+D

It does give the wrong command back for Pageup and Pagedown

Here's an example failing test too:
failed-test.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants