mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-22 14:06:02 +00:00
kill echo, less chaos
This commit is contained in:
parent
8bea2c87f6
commit
acadb6d6d8
1 changed files with 6 additions and 4 deletions
|
|
@ -52,11 +52,13 @@ func configurePTYTerminal(ptyFile *os.File) error {
|
|||
// Configure local flags
|
||||
// ISIG: Enable signal generation (SIGINT on Ctrl+C, etc)
|
||||
// ICANON: Enable canonical mode (line editing)
|
||||
// ECHO: Enable echo
|
||||
// ECHOE: Echo erase character as BS-SP-BS
|
||||
// ECHOK: Echo kill character
|
||||
// IEXTEN: Enable extended functions
|
||||
termios.Lflag |= unix.ISIG | unix.ICANON | unix.ECHO | unix.ECHOE | unix.ECHOK | unix.IEXTEN
|
||||
termios.Lflag |= unix.ISIG | unix.ICANON | unix.IEXTEN
|
||||
|
||||
// IMPORTANT: Don't enable ECHO for PTY master
|
||||
// The terminal emulator (slave) handles echo, not the master
|
||||
// Enabling echo on the master causes duplicate output
|
||||
termios.Lflag &^= (unix.ECHO | unix.ECHOE | unix.ECHOK | unix.ECHONL)
|
||||
|
||||
// Set control characters to sensible defaults
|
||||
termios.Cc[unix.VEOF] = 4 // Ctrl+D
|
||||
|
|
|
|||
Loading…
Reference in a new issue