mirror of
https://github.com/mudler/luet.git
synced 2025-09-13 22:01:39 +00:00
Bumps [helm.sh/helm/v3](https://github.com/helm/helm) from 3.3.4 to 3.6.1. - [Release notes](https://github.com/helm/helm/releases) - [Commits](https://github.com/helm/helm/compare/v3.3.4...v3.6.1) --- updated-dependencies: - dependency-name: helm.sh/helm/v3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
36 lines
916 B
Go
36 lines
916 B
Go
// +build !windows
|
|
|
|
package term
|
|
|
|
import (
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
// Termios is the Unix API for terminal I/O.
|
|
type Termios = unix.Termios
|
|
|
|
// MakeRaw puts the terminal connected to the given file descriptor into raw
|
|
// mode and returns the previous state of the terminal so that it can be
|
|
// restored.
|
|
func MakeRaw(fd uintptr) (*State, error) {
|
|
termios, err := tcget(fd)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
oldState := State{termios: *termios}
|
|
|
|
termios.Iflag &^= (unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON)
|
|
termios.Oflag &^= unix.OPOST
|
|
termios.Lflag &^= (unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN)
|
|
termios.Cflag &^= (unix.CSIZE | unix.PARENB)
|
|
termios.Cflag |= unix.CS8
|
|
termios.Cc[unix.VMIN] = 1
|
|
termios.Cc[unix.VTIME] = 0
|
|
|
|
if err := tcset(fd, termios); err != nil {
|
|
return nil, err
|
|
}
|
|
return &oldState, nil
|
|
}
|