Change session exit detection
Previously we waited for all opened file descriptors to the terminal to be closed. This caused problem when e.g. running "sleep 900 &" and then exiting the shell, with sleep keeping the session alive and had to be killed manually (killing the process group did not help - the shell had already exited and was in zombie state). This is also what most other terminal emulators do. Relatedly, switch to sending SIGKILL to force quit a session instead of SIGHUP, since SIGHUP can be ignored.
This commit is contained in:
@@ -208,11 +208,6 @@ JNIEXPORT int JNICALL Java_com_termux_terminal_JNI_waitFor(JNIEnv* TERMUX_UNUSED
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_termux_terminal_JNI_hangupProcessGroup(JNIEnv* TERMUX_UNUSED(env), jclass TERMUX_UNUSED(clazz), jint procId)
|
||||
{
|
||||
killpg(procId, SIGHUP);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_termux_terminal_JNI_close(JNIEnv* TERMUX_UNUSED(env), jclass TERMUX_UNUSED(clazz), jint fileDescriptor)
|
||||
{
|
||||
close(fileDescriptor);
|
||||
|
||||
Reference in New Issue
Block a user