File tree Expand file tree Collapse file tree 1 file changed +0
-19
lines changed
Expand file tree Collapse file tree 1 file changed +0
-19
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,8 @@ package term
77
88import (
99 "errors"
10- "fmt"
1110 "io"
1211 "os"
13- "os/signal"
1412
1513 "golang.org/x/sys/unix"
1614)
@@ -80,7 +78,6 @@ func DisableEcho(fd uintptr, state *State) error {
8078 if err := tcset (fd , & newState ); err != nil {
8179 return err
8280 }
83- handleInterrupt (fd , state )
8481 return nil
8582}
8683
@@ -92,7 +89,6 @@ func SetRawTerminal(fd uintptr) (*State, error) {
9289 if err != nil {
9390 return nil , err
9491 }
95- handleInterrupt (fd , oldState )
9692 return oldState , err
9793}
9894
@@ -102,18 +98,3 @@ func SetRawTerminal(fd uintptr) (*State, error) {
10298func SetRawTerminalOutput (fd uintptr ) (* State , error ) {
10399 return nil , nil
104100}
105-
106- func handleInterrupt (fd uintptr , state * State ) {
107- sigchan := make (chan os.Signal , 1 )
108- signal .Notify (sigchan , os .Interrupt )
109- go func () {
110- for range sigchan {
111- // quit cleanly and the new terminal item is on a new line
112- fmt .Println ()
113- signal .Stop (sigchan )
114- close (sigchan )
115- RestoreTerminal (fd , state )
116- os .Exit (1 )
117- }
118- }()
119- }
You can’t perform that action at this time.
0 commit comments