vhs icon indicating copy to clipboard operation
vhs copied to clipboard

Windows: Bash just throw back if WSL not installed

Open Rebzzel opened this issue 3 years ago • 2 comments

Hey! Nice tool. But I found one painful bug on Windows. This bug is not entirely obvious, because the build is successful:

File: demo.tape
Output .gif demo.gif
Set FontSize 46
Set Width 1200
Set Height 600
Type echo 'Welcome to VHS!'
Sleep 500ms
Enter 1
Sleep 5s
Creating GIF...

But at the output gif we see this: demo

I found that this is due to the fact that WSL is not installed on my machine, and bash command just throws me back out: bash

The solution, I think, is obvious to you: run cmd or powershell instead of bash on Windows machines. https://github.com/charmbracelet/vhs/blob/cf3919b5f5f6f78ff39c08aa28fd4a2a8b071f87/tty.go#L34

I know that you are preparing a feature (Set-Shell) but keep in mind that if the Set-Shell was not explicitly specified in the file, it should be selected automatically depending on the OS.

Thank you! Have a nice day!

Rebzzel avatar Oct 29 '22 18:10 Rebzzel

That is a really good point about having different defaults for different operating systems! We should definitely do this! Thank you for the suggestion.

maaslalani avatar Oct 29 '22 18:10 maaslalani

On Windows, the default Terminal needs to be Command Prompt or Powershell 5.

Delta456 avatar Oct 30 '22 11:10 Delta456