Skip to content

Commit

Permalink
record: set VHS_RECORD=true environment variable in process (#478)
Browse files Browse the repository at this point in the history
Set the environment variable VHS_RECORD=true in the spawned pty command
to allow processes to detect if it is running in a real TTY or in a VHS
recording. Certain TUI libraries query the terminal for feature
detection which can cause issues when running within a VHS pty.
  • Loading branch information
rockorager authored May 9, 2024
1 parent dd6b6b8 commit d56384f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions record.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ var EscapeSequences = map[string]string{
func Record(_ *cobra.Command, _ []string) error {
command := exec.Command(shell)

command.Env = append(command.Env, "VHS_RECORD=true")

terminal, err := pty.Start(command)
if err != nil {
return err
Expand Down

0 comments on commit d56384f

Please sign in to comment.