Thanks to Jekyll Wu for the analyses.
CCBUG: 286367
// current line before sending a new input. This is mandatory,
// otherwise sending a 'cd x' to a existing 'rm -rf *' might
// result in data loss. As workaround SIGINT is send.
// current line before sending a new input. This is mandatory,
// otherwise sending a 'cd x' to a existing 'rm -rf *' might
// result in data loss. As workaround SIGINT is send.
- kill(m_terminal->terminalProcessId(), SIGINT);
+ const int processId = m_terminal->terminalProcessId();
+ if (processId > 0) {
+ kill(processId, SIGINT);
+ }
}
m_terminal->sendInput("cd " + KShell::quoteArg(dir) + '\n');
}
m_terminal->sendInput("cd " + KShell::quoteArg(dir) + '\n');