Merge pull request #77 from Sh4d1/fix_panic_pipe

This commit is contained in:
Manfred Touron 2020-04-27 12:37:42 +02:00 committed by GitHub
commit 7dbfe0223c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -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)
}