GNU bug report logs - #73101
Regarding a bug in suspend-emacs

Previous Next

Package: emacs;

Reported by: Riza Dindir <riza.dindir <at> gmail.com>

Date: Sat, 7 Sep 2024 14:44:03 UTC

Severity: normal

Merged with 73100

To reply to this bug, email your comments to 73101 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#73101; Package emacs. (Sat, 07 Sep 2024 14:44:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Riza Dindir <riza.dindir <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 07 Sep 2024 14:44:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Riza Dindir <riza.dindir <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Regarding a bug in suspend-emacs
Date: Sat, 7 Sep 2024 16:34:45 +0300
[Message part 1 (text/plain, inline)]
Hello

Note: Sending this a second time, I forgot to confirm my request to
register to the bug-gnu-emacs list.

I am running Linux with kernel 6.6.47 and am running emacs in xterm, using
the -nw command line argument.

I am new to emacs and was experimenting with the suspend-emacs command.
Following the example on
https://www.gnu.org/software/emacs/manual/html_node/elisp/Suspending-Emacs.html
.

When following the example, I added the suspend-resume-hook to my
.emacs.d/init.el file. When I run M-: (suspend-emacs "pwd") it does not
show the current working directory. But when I do fg from the terminal that
I got into, I see the "Resumed!" message.

I asked in the libera chat about that, and also in the gnu-help-emacs list.
I have been talking to wasamasa on libera chat (#emacs-beginners) and we
pinpointed the problem to the stuff_char function (in
https://git.savannah.gnu.org/cgit/emacs.git/tree/src/sysdep.c#n403). We
came to this point from stuff_buffered_input (
https://git.savannah.gnu.org/cgit/emacs.git/tree/src/keyboard.c#n11963),
and from  suspend-emacs function definition (in
https://git.savannah.gnu.org/cgit/emacs.git/tree/src/keyboard.c#n11908).

The stuff_char function is using ioctl with TIOCSTI. TIOCSTI requires
CAP_SYS_ADMIN capability. You can set this capability using sysctl setting
dev.tty.legacy_tiocsti to 1.

Unless I had set "dev.tty.legacy_tiocsti" to 1 I could not run the
suspend-emacs command with an argument string.

Either emacs can check the return value of ioctl in stuff_char and if there
return value is EPERM, then handle this accordingly, with a message
regarding the problem.

Or the information relating to the kernel version and CAP_SYS_ADMIN can be
added to the infor page os suspend_emacs, along with the information on how
to set this capability using sysctl.

Kind Regards
Riza Dindir
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73101; Package emacs. (Sat, 07 Sep 2024 15:23:01 GMT) Full text and rfc822 format available.

Message #8 received at 73101 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Riza Dindir <riza.dindir <at> gmail.com>
Cc: 73101 <at> debbugs.gnu.org
Subject: Re: bug#73101: Regarding a bug in suspend-emacs
Date: Sat, 07 Sep 2024 18:22:07 +0300
merge 73101 73100
thanks

> From: Riza Dindir <riza.dindir <at> gmail.com>
> Date: Sat, 7 Sep 2024 16:34:45 +0300
> 
> Note: Sending this a second time, I forgot to confirm my request to register to the bug-gnu-emacs list.

That was a mistake, because by doing that you have created an
identical copy of the first bug report.

I'm now merging them.




Merged 73100 73101. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 07 Sep 2024 15:23:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73101; Package emacs. (Sat, 07 Sep 2024 18:22:03 GMT) Full text and rfc822 format available.

Message #13 received at 73101 <at> debbugs.gnu.org (full text, mbox):

From: Riza Dindir <riza.dindir <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 73101 <at> debbugs.gnu.org
Subject: Re: bug#73101: Regarding a bug in suspend-emacs
Date: Sat, 7 Sep 2024 18:42:50 +0300
[Message part 1 (text/plain, inline)]
I apologize for the duplicate.

On Sat, Sep 7, 2024, 18:22 Eli Zaretskii <eliz <at> gnu.org> wrote:

> merge 73101 73100
> thanks
>
> > From: Riza Dindir <riza.dindir <at> gmail.com>
> > Date: Sat, 7 Sep 2024 16:34:45 +0300
> >
> > Note: Sending this a second time, I forgot to confirm my request to
> register to the bug-gnu-emacs list.
>
> That was a mistake, because by doing that you have created an
> identical copy of the first bug report.
>
> I'm now merging them.
>
[Message part 2 (text/html, inline)]

This bug report was last modified 1 year and 13 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.