Clear the arguments if the command is not found

This mimics what other terminals do.

(cherry picked from commit 39ffddb777)
This commit is contained in:
Kurt Hindenburg
2025-05-28 18:54:39 -04:00
parent 15a39e3591
commit 09d20dea10

View File

@@ -512,8 +512,10 @@ void Session::run()
// if a program was specified via setProgram(), but it couldn't be found (but a fallback was), print a warning
if (exec != checkProgram(_program)) {
terminalWarning(i18n("Could not find '%1', starting '%2' instead. Please check your profile settings.", _program, exec));
_arguments.clear(); // ignore args if program is invalid
} else if (exec != checkProgram(exec)) {
terminalWarning(i18n("Could not find '%1', starting '%2' instead. Please check your profile settings.", exec, checkProgram(exec)));
_arguments.clear(); // ignore args if program is invalid
}
// if no arguments are specified, fall back to program name