Files
coder/pty/pty_linux.go
Jon Ayers 17ddee05e5 chore: update golang to 1.24.1 (#17035)
- Update go.mod to use Go 1.24.1
- Update GitHub Actions setup-go action to use Go 1.24.1
- Fix linting issues with golangci-lint by:
  - Updating to golangci-lint v1.57.1 (more compatible with Go 1.24.1)

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <claude@anthropic.com>
2025-03-26 01:56:39 -05:00

25 lines
400 B
Go

//go:build linux
package pty
import (
"github.com/u-root/u-root/pkg/termios"
"golang.org/x/sys/unix"
)
func (p *otherPty) EchoEnabled() (echo bool, err error) {
err = p.control(p.pty, func(fd uintptr) error {
t, err := termios.GetTermios(fd)
if err != nil {
return err
}
echo = (t.Lflag & unix.ECHO) != 0
return nil
})
if err != nil {
return false, err
}
return echo, nil
}