Don't popen pager if command is "exit". Fixes "vtysh screws up my terminal
if I exit" issue.
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 086b5df..cea91b3 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -283,7 +283,10 @@
       break;
     case CMD_SUCCESS_DAEMON:
       {
-	if (pager && vtysh_pager_name)
+	/* FIXME: Don't open pager for exit commands. popen() causes problems
+	 * if exited from vtysh at all. This hack shouldn't cause any problem
+	 * but is really ugly. */
+	if (pager && vtysh_pager_name && (strncmp(line, "exit", 4) != 0))
 	  {
 	    fp = popen (vtysh_pager_name, "w");
 	    if (fp == NULL)