sudo-rs icon indicating copy to clipboard operation
sudo-rs copied to clipboard

Sudo-rs hangs when you suspend a process with ^Z

Open squell opened this issue 2 years ago • 1 comments

With original sudo: sudo vi, press ^Z -> you drop to the shell.

With sudo-rs: the process does get suspended, but the process seems stuck. This is probably something with the signal handling? (We should wait for use_pty to be supported before fixing this)

squell avatar Apr 25 '23 15:04 squell

Yeah this sounds like something that should be fixed in the use_pty case before trying to fix it not.

That being said exec_nopty.c has a special case for SIGTSTP with the following documentation:

	/*
	 * Only forward user-generated signals not sent by a process other than
	 * the command itself or a member of the command's process group (but
	 * only when either sudo or the command is the process group leader).
	 * Signals sent by the kernel may include SIGTSTP when the user presses
	 * ^Z.  Curses programs often trap ^Z and send SIGTSTP to their own
	 * process group, so we don't want to send an extra SIGTSTP.
	 */

but this particular behavior is already implemented already on main so it is either wrong or there's another catch somewhere.

exec_pty.c does some special handling for SIGTSTP too so this will be relevant even after use_pty gets merged.

Edit: I pressed "Close issue" instead of "Comment" :sweat_smile:

pvdrz avatar Apr 25 '23 16:04 pvdrz

Current behavior: ^Z doesn't even suspend the process

pvdrz avatar May 15 '23 10:05 pvdrz