Function to drain controlling tty

This commit is contained in:
Kovid Goyal
2023-01-23 16:07:00 +05:30
parent a009d6b258
commit cc1f0bc3fe
4 changed files with 29 additions and 3 deletions

View File

@@ -7,6 +7,8 @@ import (
"io"
"os"
"golang.org/x/sys/unix"
"kitty/tools/tty"
"kitty/tools/utils"
)
@@ -56,7 +58,7 @@ func read_from_tty(pipe_r *os.File, term *tty.Term, results_channel chan<- []byt
wait_for_read_available := func() {
for {
n, err := selector.WaitForever()
if err != nil {
if err != nil && err != unix.EINTR {
err_channel <- err
keep_going = false
return

View File

@@ -8,6 +8,8 @@ import (
"os"
"time"
"golang.org/x/sys/unix"
"kitty/tools/tty"
"kitty/tools/utils"
)
@@ -143,7 +145,7 @@ func write_to_tty(
wait_for_write_available := func() {
for {
n, err := selector.WaitForever()
if err != nil {
if err != nil && err != unix.EINTR {
err_channel <- err
keep_going = false
return