From fc1331cfdc673c89eee711acd958ea09c0db8600 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 22 Sep 2023 09:37:48 +0530 Subject: [PATCH] Dont call tcgetattr when no operations are specified --- tools/tty/tty.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/tty/tty.go b/tools/tty/tty.go index d777f3236..89b2ba197 100644 --- a/tools/tty/tty.go +++ b/tools/tty/tty.go @@ -179,6 +179,9 @@ func (self *Term) set_termios_attrs(when uintptr, modify func(*unix.Termios)) (e } func (self *Term) ApplyOperations(when uintptr, operations ...TermiosOperation) (err error) { + if len(operations) == 0 { + return + } return self.set_termios_attrs(when, func(t *unix.Termios) { for _, op := range operations { op(t)