mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
14 lines
269 B
Go
14 lines
269 B
Go
// go:build linux
|
|
|
|
package pty
|
|
|
|
import "golang.org/x/sys/unix"
|
|
|
|
func (p *otherPty) EchoEnabled() (bool, error) {
|
|
termios, err := unix.IoctlGetTermios(int(p.pty.Fd()), unix.TCGETS)
|
|
if err != nil {
|
|
return false, err
|
|
}
|
|
return (termios.Lflag & unix.ECHO) != 0, nil
|
|
}
|