Skip to content

Commit

Permalink
fix: panic when using pipes
Browse files Browse the repository at this point in the history
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
  • Loading branch information
Sh4d1 committed Apr 21, 2020
1 parent caa0db8 commit 00386c0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gotty-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,11 @@ func (c *Client) Loop() error {
return err
}
}
term := console.Current()
err := term.SetRaw()
term, err := console.ConsoleFromFile(os.Stdout)
if err != nil {
return fmt.Errorf("os.Stdout is not a valid terminal")
}
err = term.SetRaw()
if err != nil {
return fmt.Errorf("Error setting raw terminal: %v", err)
}
Expand Down

0 comments on commit 00386c0

Please # to comment.