Skip to content

Commit f067543

Browse files
committed
Fix to keep Terminology open
1 parent a7cceac commit f067543

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

mainwindow.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,11 @@ void MainWindow::removeKernelPackages(const QStringList &list)
567567
.arg(rmOldVersions, packages.join(' '));
568568
QProcess terminalProc;
569569
terminalProc.start("x-terminal-emulator", {"-e", "pkexec", helper, terminalCmd});
570-
terminalProc.waitForFinished();
570+
terminalProc.waitForFinished(-1); // Wait indefinitely for terminal to close
571+
if (terminalProc.state() == QProcess::Running) {
572+
terminalProc.kill();
573+
terminalProc.waitForFinished();
574+
}
571575
setCursor(QCursor(Qt::ArrowCursor));
572576
}
573577

@@ -1363,7 +1367,7 @@ void MainWindow::pushRTLremove_clicked()
13631367
if dpkg -l broadcom-sta-dkms 2>/dev/null | grep -q ^ii; then
13641368
echo -n broadcom-sta-dkms
13651369
fi
1366-
fi)");
1370+
fi)", false, true); // Run as user, quiet mode
13671371

13681372
dumpList = dumpList.trimmed();
13691373
if (dumpList.isEmpty()) {
@@ -1376,6 +1380,10 @@ void MainWindow::pushRTLremove_clicked()
13761380
QString terminalCmd = QString("apt-get purge -y %1; apt-get install -f -y").arg(dumpList);
13771381
QProcess terminalProc;
13781382
terminalProc.start("x-terminal-emulator", {"-e", "pkexec", helper, terminalCmd});
1379-
terminalProc.waitForFinished();
1383+
terminalProc.waitForFinished(-1); // Wait indefinitely for terminal to close
1384+
if (terminalProc.state() == QProcess::Running) {
1385+
terminalProc.kill();
1386+
terminalProc.waitForFinished();
1387+
}
13801388
setCursor(QCursor(Qt::ArrowCursor));
13811389
}

scripts/helper-terminal-keep-open

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
export DEBIAN_FRONTEND=dialog
66

7-
# Run the command passed as a single string argument
8-
bash -c "$1"
7+
# Run all arguments as the command (pkexec splits them)
8+
bash -c "$*"
99
EXIT_CODE=$?
1010

1111
# Always show result and wait for user input

0 commit comments

Comments
 (0)