bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#70519: 30.0.50; Device for Emacs terminal I/O


From: Paul Eggert
Subject: bug#70519: 30.0.50; Device for Emacs terminal I/O
Date: Sat, 4 May 2024 09:36:23 -0700
User-agent: Mozilla Thunderbird

On 2024-05-04 09:19, Eli Zaretskii wrote:
AFAIU, the --terminal option causes
Emacs to close its original stdin, so Ctrl-C does not send SIGINT to
Emacs.  But I'm nowhere near being an expert on that.  Paul, can you
please comment on that?

Closing stdin doesn't change a process's controlling terminal. On GNU/Linux you need to use ioctl with TIOCSCTTY and there are a bunch of other preconditions. See how emacs_spawn uses TIOCSCTTY:

       /* We ignore the return value
          because faith@cs.unc.edu says that is necessary on Linux.  */
       ioctl (std_in, TIOCSCTTY, 0);

This comment (and ignoring ioctl's return value) was added by rms in commit 084fd64ac9daee2a89d393f07ce87ec8df543330 dated 1993. I'm skeptical that the comment is true now. You might try adding code to check the return value and report any errors, though Emacs shouldn't abort (as it did before that 1993 change) if the ioctl fails.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]