Open c3d opened 1 year ago
Note that Control-Q does not work either, which reinforces the idea that it's an XON/XOFF problem.
Interestingly, Control-Q and Control-S work as XON/XOFF in the terminal itself. So this is more of a problem with Emacs in text mode being able to disable them.
Reduced test case:
#include <termios.h>
#include <unistd.h>
#include <stdio.h>
int main()
{
struct termios ti;
int rc = tcgetattr(0, &ti);
printf("tcgetattr=%d, c_iflag=%x, Terminal IXON is %s\n", rc, ti.c_iflag, ti.c_iflag & IXON ? "on" : "off");
ti.c_iflag &= ~IXON;
rc = tcsetattr(0, TCSANOW, &ti);
printf("tcsettattr=%d, c_iflag=%x, Terminal IXON is %s\n", rc, ti.c_iflag, ti.c_iflag & IXON ? "on" : "off");
rc = tcgetattr(0, &ti);
printf("tcgetattr=%d, c_iflag=%x, Terminal IXON is %s\n", rc, ti.c_iflag, ti.c_iflag & IXON ? "on" : "off");
int i = 0;
for(;;)
printf("Hello %d\n", i++);
}
Ran this on macOS: I cannot use control-S to stop control flow (expected). Ran this on krunvm, I can use Control-S to stop control flow (seems bogus).
So I suspect that you do not correctly transmit the corresponding ioctls to the calling terminal.
Follow these steps on macOS with M1:
Then in Emacs,
Control-X Control-F /tmp/glop RET
to open a file named/tmp/glop
, then put some text in the file, thenControl-X Control-S
(which normally would save the file) and notice that the**
along the file name in the status bar is still there, indicating that the file was not saved. Then typeS
(which completes theControl-X S
command) and notice it will save all files. So theControl-S
was not presented to Emacs.I suspect this is related to XON/XOFF management (historically, Control-S was XOFF, stop terminal output, and Control-Q was XON, resume terminal output).