[konsole] [Bug 495276] New: Konsole unnecessarily sets IXOFF stty option
Jay Berry
bugzilla_noreply at kde.org
Thu Oct 24 01:08:24 BST 2024
https://bugs.kde.org/show_bug.cgi?id=495276
Bug ID: 495276
Summary: Konsole unnecessarily sets IXOFF stty option
Classification: Applications
Product: konsole
Version: master
Platform: Arch Linux
OS: Linux
Status: REPORTED
Severity: minor
Priority: NOR
Component: emulation
Assignee: konsole-devel at kde.org
Reporter: email at jb2170.com
Target Milestone: ---
SUMMARY
Looking at the output of running `$ stty` in a shell using Konsole as its
terminal emulator (and looking at the source code of `src/Pty.cpp`) Konsole
unnecessarily sets the IXOFF tty ioctl flag, which is completely ignored by
PTYs, and is only relevant to physical hardware terminals eg a terminal
connected via an RS232 cable. This is probably due to the at-first confusing
documentation of IXON and IXOFF in `$ man 1 stty`.
The output of `$ stty` for me is
```
[jb2170 at WD:~]$ stty
speed 38400 baud; line = 0;
-brkint ixoff -imaxbel iutf8
```
Other terminal emulators such as Zutty, Alacritty, Kitty, Mate-Terminal do not
have `ixoff` in their output. It's completely harmless to have `ixoff` there,
it doesn't do anything for ptys, but it would be nice to have one less loose
end, one less non-default string in the output of stty as all other terminal
emulators seem to do.
IXON is whether the pty driver / tty driver should process ^S and ^Q. This is
implemented correctly by Konsole.
IXOFF is whether a tty driver connected to a physical dumb-terminal (eg over a
RS232) should send electrical signals down the RTS/CTS etc lines to tell the
terminal 'slow down on the keyboard, the program hasn't read all your data
yet'. Since a pty resides in the kernel and the kernel has possession of both
the master side and ancillary side there is no IXOFF control for ptys. Konsole
incorrectly / unnecessarily sets the IXOFF termios flag.
My guess is that in the development of Konsole one looked at the documentation
for IXON in `man stty` reading "enable XON/XOFF flow control" and thought to
implement both IXON and IXOFF, with IXON corresponding to ^Q and IXOFF
corresponding to ^S, or some other incorrect behaviour, but only due to the
cryptic documentation of ancient tty settings lol.
This is a 10 second fix of removing the `IXOFF` flag from the body of
`setFlowControlEnabled` in `src/Pty.cpp` and maybe adding a comment, plus
renaming `Pty`'s member variable `_xonXoff` to `_ixon` for clarity.
STEPS TO REPRODUCE
1. Open Konsole
2. Run `stty`
OBSERVED RESULT
ixoff is present in the output
EXPECTED RESULT
ixoff should not be present
SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux, KDE Konsole 24.08.2-1 via "pacman -Qi konsole"
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the konsole-devel
mailing list