aboutsummaryrefslogtreecommitdiffstats
path: root/shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell.c')
-rw-r--r--shell.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/shell.c b/shell.c
index 05870c8..5bbc9d2 100644
--- a/shell.c
+++ b/shell.c
@@ -73,6 +73,7 @@
#endif
#if defined (READLINE)
+# include <readline/readline.h>
# include "bashline.h"
#endif
@@ -909,6 +910,14 @@ exit_shell (s)
fflush (stdout); /* XXX */
fflush (stderr);
+ /* Clean up the terminal if we are in a state where it's been modified. */
+#if defined (READLINE)
+ if (RL_ISSTATE (RL_STATE_TERMPREPPED) && rl_deprep_term_function)
+ (*rl_deprep_term_function) ();
+#endif
+ if (read_tty_modified ())
+ read_tty_cleanup ();
+
/* Do trap[0] if defined. Allow it to override the exit status
passed to us. */
if (signal_is_trapped (0))