File tree Expand file tree Collapse file tree 2 files changed +9
-18
lines changed Expand file tree Collapse file tree 2 files changed +9
-18
lines changed Original file line number Diff line number Diff line change @@ -1038,10 +1038,9 @@ func (ghost *Ghost) SpawnTTYServer(res *Response) error {
1038
1038
}
1039
1039
1040
1040
termios .Cfmakeraw (& term )
1041
- term .Iflag &= (unix .IXON | unix .IXOFF )
1042
- term .Cflag |= unix .CLOCAL
1043
- term .Ispeed = unix .B115200
1044
- term .Ospeed = unix .B115200
1041
+ term .Iflag &^= (unix .IXON | unix .IXOFF ) // Disable software flow control
1042
+ term .Cflag |= unix .CLOCAL // Ignore modem control lines
1043
+ term .Cflag &^= unix .CRTSCTS // Disable hardware flow control
1045
1044
1046
1045
if err = termios .Tcsetattr (tty .Fd (), termios .TCSANOW , & term ); err != nil {
1047
1046
return err
Original file line number Diff line number Diff line change @@ -616,20 +616,12 @@ def SpawnTTYServer(self, unused_var):
616
616
else :
617
617
fd = os .open (self ._tty_device , os .O_RDWR )
618
618
tty .setraw (fd )
619
- # 0: iflag
620
- # 1: oflag
621
- # 2: cflag
622
- # 3: lflag
623
- # 4: ispeed
624
- # 5: ospeed
625
- # 6: cc
626
- attr = termios .tcgetattr (fd )
627
- attr [0 ] &= ~ (termios .IXON | termios .IXOFF )
628
- attr [2 ] |= termios .CLOCAL
629
- attr [2 ] &= ~ termios .CRTSCTS
630
- attr [4 ] = termios .B115200
631
- attr [5 ] = termios .B115200
632
- termios .tcsetattr (fd , termios .TCSANOW , attr )
619
+
620
+ attrs = termios .tcgetattr (fd )
621
+ attrs [0 ] &= ~ (termios .IXON | termios .IXOFF ) # Disable software flow control
622
+ attrs [2 ] |= termios .CLOCAL # Ignore modem control lines
623
+ attrs [2 ] &= ~ termios .CRTSCTS # Disable hardware flow control
624
+ termios .tcsetattr (fd , termios .TCSANOW , attrs )
633
625
634
626
def _ProcessBuffer (buf ):
635
627
if buf == b'\x04 ' :
You can’t perform that action at this time.
0 commit comments