From 97b7db2d02863c718c53faf02d13a92260035ea8 Mon Sep 17 00:00:00 2001 From: hasso Date: Wed, 20 Oct 2004 19:07:48 +0000 Subject: Don't popen pager if command is "exit". Fixes "vtysh screws up my terminal if I exit" issue. --- vtysh/vtysh.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'vtysh/vtysh.c') diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 086b5dfe..cea91b3e 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -283,7 +283,10 @@ vtysh_execute_func (const char *line, int pager) 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) -- cgit v1.2.1