aboutsummaryrefslogtreecommitdiffstats
path: root/shell.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2015-01-15 10:21:08 -0500
committerDan Pasanen <dan.pasanen@gmail.com>2015-02-19 15:44:15 -0600
commitbbc8b4849e0921dc4d9742359ca37f527712eccd (patch)
treea7073195c30ebb97866130352e0521fe6a4ccb7e /shell.c
parentc6a8bcd4a5660e7d0bc4759f08a272c97bea369d (diff)
downloadandroid_external_bash-stable/cm-12.0-YNG4N.tar.gz
android_external_bash-stable/cm-12.0-YNG4N.tar.bz2
android_external_bash-stable/cm-12.0-YNG4N.zip
Change-Id: Id50c454f86c5df0e6cab6226ab7e5cc1a9b37883
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))