Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setting echo attribute in ptylib on Unix98 systems #491

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# gdbgui release history

## 0.15.2.1
- Fix setting echo attribute in ptylib on Unix98 systems

## 0.15.2.0
- Update default python version to 3.12
- utf-8 decode error bugfix
Expand Down
5 changes: 3 additions & 2 deletions gdbgui/server/ptylib.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,18 @@ def sigint_handler(_sig, _frame):
(master, slave) = pty.openpty()
self.stdin = master
self.stdout = master
self.slave = slave
self.name = os.ttyname(slave)
self.set_echo(echo)

def set_echo(self, echo_on: bool) -> None:
(iflag, oflag, cflag, lflag, ispeed, ospeed, cc) = termios.tcgetattr(self.stdin)
(iflag, oflag, cflag, lflag, ispeed, ospeed, cc) = termios.tcgetattr(self.slave)
if echo_on:
lflag = lflag & termios.ECHO # type: ignore
else:
lflag = lflag & ~termios.ECHO # type: ignore
termios.tcsetattr(
self.stdin,
self.slave,
termios.TCSANOW,
[iflag, oflag, cflag, lflag, ispeed, ospeed, cc],
)
Expand Down