Use a struct to store connection related data

This commit is contained in:
Kovid Goyal
2023-02-22 08:08:34 +05:30
parent d656017f27
commit fa0773d9d2
2 changed files with 33 additions and 3 deletions

View File

@@ -148,6 +148,13 @@ func (self *Term) Close() error {
return err
}
func (self *Term) WasEchoOnOriginally() bool {
if len(self.states) > 0 {
return self.states[0].Lflag&unix.ECHO != 0
}
return false
}
func (self *Term) Tcgetattr(ans *unix.Termios) error {
return eintr_retry_noret(func() error { return Tcgetattr(self.Fd(), ans) })
}