mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-10 13:04:03 +03:00
Wrap EOF errors when doing terminal I/O
This commit is contained in:
parent
d8574f8f85
commit
86af1d5c16
@ -333,6 +333,8 @@ func (self *Loop) run() (err error) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
case rwerr := <-err_channel:
|
||||
return fmt.Errorf("Failed doing I/O with terminal: %w", rwerr)
|
||||
case s := <-signal_channel:
|
||||
err = self.on_signal(s.(unix.Signal))
|
||||
if err != nil {
|
||||
@ -340,7 +342,12 @@ func (self *Loop) run() (err error) {
|
||||
}
|
||||
case input_data, more := <-tty_read_channel:
|
||||
if !more {
|
||||
return io.EOF
|
||||
select {
|
||||
case rwerr := <-err_channel:
|
||||
return fmt.Errorf("Failed to read from terminal: %w", rwerr)
|
||||
default:
|
||||
return fmt.Errorf("Failed to read from terminal: %w", io.EOF)
|
||||
}
|
||||
}
|
||||
err := self.dispatch_input_data(input_data)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user