From 1cdbebe98a07d899b38b1769945bdd183ca254d2 Mon Sep 17 00:00:00 2001 From: John Southworth Date: Tue, 26 Jul 2011 20:00:36 -0700 Subject: Bugfix 6828: Make bash print a friendly message when exiting configuration mode with ctrl+d --- parse.y | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/parse.y b/parse.y index 31f6ea9..19218fd 100644 --- a/parse.y +++ b/parse.y @@ -5614,8 +5614,14 @@ handle_eof_input_unit () { if (eof_encountered < eof_encountered_limit) { - fprintf (stderr, _("Use \"%s\" to leave the shell.\n"), + char *vyatta_configure_mode = getenv ( "_OFR_CONFIGURE" ); + if (*vyatta_configure_mode != NULL) { + fprintf (stderr, _("Use \"%s\" to leave configuration mode.\n"), login_shell ? "logout" : "exit"); + } else { + fprintf (stderr, _("Use \"%s\" to leave the shell.\n"), + login_shell ? "logout" : "exit"); + } eof_encountered++; /* Reset the parsing state. */ last_read_token = current_token = '\n'; -- cgit v1.2.3