mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:48:11 +00:00
Shell: Only prompt the user for a second 'exit' when in interactive mode
This commit is contained in:
parent
71bb62d03c
commit
2610477836
1 changed files with 7 additions and 5 deletions
|
@ -262,11 +262,13 @@ int Shell::builtin_exit(int argc, const char** argv)
|
|||
if (!parser.parse(argc, const_cast<char**>(argv)))
|
||||
return 1;
|
||||
|
||||
if (!jobs.is_empty()) {
|
||||
if (!m_should_ignore_jobs_on_next_exit) {
|
||||
fprintf(stderr, "Shell: You have %zu active job%s, run 'exit' again to really exit.\n", jobs.size(), jobs.size() > 1 ? "s" : "");
|
||||
m_should_ignore_jobs_on_next_exit = true;
|
||||
return 1;
|
||||
if (m_is_interactive) {
|
||||
if (!jobs.is_empty()) {
|
||||
if (!m_should_ignore_jobs_on_next_exit) {
|
||||
fprintf(stderr, "Shell: You have %zu active job%s, run 'exit' again to really exit.\n", jobs.size(), jobs.size() > 1 ? "s" : "");
|
||||
m_should_ignore_jobs_on_next_exit = true;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
stop_all_jobs();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue