From 3ec467047856eb76945dc7804d1ba7743935fb2d Mon Sep 17 00:00:00 2001
From: Matt Johnston <matt@ucc.asn.au>
Date: Wed, 10 Apr 2013 21:32:44 +0800
Subject: [PATCH] reset terminal modes before printing a message

---
 cli-chansession.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/cli-chansession.c b/cli-chansession.c
index 65d1f4fc..17e0d53e 100644
--- a/cli-chansession.c
+++ b/cli-chansession.c
@@ -82,14 +82,12 @@ out:
 
 /* If the main session goes, we close it up */
 static void cli_closechansess(struct Channel *UNUSED(channel)) {
+	cli_tty_cleanup(); /* Restore tty modes etc */
 
 	/* This channel hasn't gone yet, so we have > 1 */
 	if (ses.chancount > 1) {
 		dropbear_log(LOG_INFO, "Waiting for other channels to close...");
 	}
-
-	cli_tty_cleanup(); /* Restore tty modes etc */
-
 }
 
 void cli_start_send_channel_request(struct Channel *channel, 
-- 
GitLab