Skip to content

Commit

Permalink
fix(shell): use syscall.stdin instead of os.stdin.fd() (#183)
Browse files Browse the repository at this point in the history
* fix(shell): int issue

* use syscall.stdin
  • Loading branch information
DexterYan authored Sep 3, 2024
1 parent 240b09e commit eb28ee6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ func ShellCmd() *cobra.Command {
defer func() { signal.Stop(ch); close(ch) }()

// Set stdin to raw mode.
oldState, err := term.MakeRaw(int(os.Stdin.Fd()))
oldState, err := term.MakeRaw(syscall.Stdin)
if err != nil {
panic(err)
}
defer func() {
_ = term.Restore(int(os.Stdin.Fd()), oldState)
_ = term.Restore(syscall.Stdin, oldState)
fmt.Printf("sbctl shell exited\n")
}()

Expand Down

0 comments on commit eb28ee6

Please sign in to comment.