Skip to content
Myr

Exit 2 instead of panic when failed to open /dev/tty

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent a56489b · Browse files · 1 file+2 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−1 removed

  • other:+2 added−1 removed

1 file+2 added−1 removed

modified:src/tui/light.go+2 added-1 removed
30 unmodified lines
3132func openTtyIn() *os.File {33 in, err := os.OpenFile(consoleDevice, syscall.O_RDONLY, 0)34 if err != nil {35 panic("Failed to open " + consoleDevice)35 fmt.Fprintln(os.Stderr, "Failed to open "+consoleDevice)36 os.Exit(2)37 }38 return in39}40
863 unmodified lines