mirror of https://github.com/Icinga/icinga2.git
Merge pull request #6519 from Icinga/fix/erroneous-console-exit
Reset terminal on erroneous console exit
This commit is contained in:
commit
c8d4e785a1
|
@ -532,6 +532,12 @@ void ConsoleCommand::ExecuteScriptCompletionHandler(boost::mutex& mutex, boost::
|
|||
} catch (const std::exception& ex) {
|
||||
Log(LogCritical, "ConsoleCommand")
|
||||
<< "HTTP query failed: " << ex.what();
|
||||
|
||||
#ifdef HAVE_EDITLINE
|
||||
/* Ensures that the terminal state is resetted */
|
||||
rl_deprep_terminal();
|
||||
#endif /* HAVE_EDITLINE */
|
||||
|
||||
Application::Exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
@ -554,6 +560,12 @@ void ConsoleCommand::AutocompleteScriptCompletionHandler(boost::mutex& mutex, bo
|
|||
} catch (const std::exception& ex) {
|
||||
Log(LogCritical, "ConsoleCommand")
|
||||
<< "HTTP query failed: " << ex.what();
|
||||
|
||||
#ifdef HAVE_EDITLINE
|
||||
/* Ensures that the terminal state is resetted */
|
||||
rl_deprep_terminal();
|
||||
#endif /* HAVE_EDITLINE */
|
||||
|
||||
Application::Exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ extern "C" {
|
|||
|
||||
char *readline(const char *prompt);
|
||||
int add_history(const char *line);
|
||||
void rl_deprep_terminal();
|
||||
|
||||
typedef char *ELFunction(const char *, int);
|
||||
|
||||
|
|
Loading…
Reference in New Issue