Some improvements for terminal mode
This commit is contained in:
parent
bd0d1aaebe
commit
50da13d169
1 changed files with 12 additions and 0 deletions
12
main.go
12
main.go
|
|
@ -32,9 +32,21 @@ func main() {
|
|||
if res.column > 1 {
|
||||
unix.Write(1, []byte("🚫\n")) // U+1F6AB
|
||||
}
|
||||
|
||||
term, _ := unix.IoctlGetTermios(1, unix.TCGETS)
|
||||
if term != nil {
|
||||
term.Lflag = term.Lflag &^ unix.ECHO
|
||||
unix.IoctlSetTermios(1, unix.TCSETS, term)
|
||||
}
|
||||
|
||||
for _, b := range res.extraBytes {
|
||||
unix.Syscall(unix.SYS_IOCTL, 0, unix.TIOCSTI, uintptr(unsafe.Pointer(&b)))
|
||||
}
|
||||
|
||||
if term != nil {
|
||||
term.Lflag = term.Lflag | unix.ECHO
|
||||
unix.IoctlSetTermios(1, unix.TCSETS, term)
|
||||
}
|
||||
}
|
||||
|
||||
func awaitDSR() <-chan dsrResult {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue