charmbracelet / vhs

Your CLI home video recorder 📼
MIT License
15.35k stars 261 forks source link

`vhs record > casette.tape` does not redirect commands to file. #293

Closed noahgorstein closed 1 year ago

noahgorstein commented 1 year ago

Describe the bug

vhs record > casette.tape does not redirect commands to file.

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

❯ vhs --version
vhs version 0.4.0

To Reproduce Steps to reproduce the behavior:

  1. Run vhs record > tape.casette
  2. Enter some commands like ls, cat
  3. VHS does not redirect the output to the file, instead it outputs the VHS commands to the console.

Source Code

Example of reproducing issue locally:

❯ vhs record > awesome_casette.tape

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
bash-3.2$ pwd
/Users/noahgorstein/projects/dog-watcher-demo
bash-3.2$ ls -lah
total 16
drwxr-xr-x   6 noahgorstein  staff   192B Apr 20 22:29 .
drwxr-xr-x  26 noahgorstein  staff   832B Apr 19 21:01 ..
-rw-r--r--   1 noahgorstein  staff     0B Apr 20 22:39 awesome_casette.tape
-rw-r--r--   1 noahgorstein  staff   195B Apr 19 21:54 casette.tape
-rw-r--r--   1 noahgorstein  staff   338B Apr 19 20:58 wikidata_query.rq
drwxr-xr-x   6 noahgorstein  staff   192B Apr 19 20:36 yago
bash-3.2$ exit
exit
Sleep 1s
Type "pwd"
Enter
Sleep 500ms
Type "l "
Sleep 500ms
Backspace
Type "s -lah"
Sleep 500ms
Enter
Sleep 500ms
Type "exit"

❯ ls -lah awesome_casette.tape
-rw-r--r--  1 noahgorstein  staff     0B Apr 20 22:39 awesome_casette.tape

Expected behavior

Would expect the VHS tape commands to be redirected to the file (awesome_casette.tape in my example above)

Allaman commented 1 year ago

I can confirm this behavior with a similar Setup. I use Kitty instead of Alacritty but also zsh, tmux, macOS 12.6 Edit: vhs version 0.4.0

JeremyBYU commented 1 year ago

Same issue when on WSL2 on Windows 11. As others stated it outputs all the commands correctly to the terminal after you "exit" the recording session. But the file is empty.

vhs version v0.4.0 (5409c97)

Thanks

maaslalani commented 1 year ago

Thanks for reporting this, it is fixed by #294!