restoreTerminal restores the terminal state if SetRawTerminal succeeded earlier.
()
| 45 | |
| 46 | // restoreTerminal restores the terminal state if SetRawTerminal succeeded earlier. |
| 47 | func (s *commonStream) restoreTerminal() { |
| 48 | if s.state != nil { |
| 49 | _ = term.RestoreTerminal(s.fd, s.state) |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | func (s *commonStream) setRawTerminal(setter func(uintptr) (*term.State, error)) error { |
| 54 | if !s.tty || os.Getenv("NORAW") != "" { |
no test coverage detected