summaryrefslogtreecommitdiffstats
path: root/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'session.c')
-rw-r--r--session.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/session.c b/session.c
index af2e7199..6ab3484e 100644
--- a/session.c
+++ b/session.c
@@ -492,6 +492,13 @@ do_exec_no_pty(Session *s, const char *command)
close(err[0]);
/*
+ * Clear loginmsg, since it's the child's responsibility to display
+ * it to the user, otherwise multiple sessions may accumulate
+ * multiple copies of the login messages.
+ */
+ buffer_clear(&loginmsg);
+
+ /*
* Enter the interactive session. Note: server_loop must be able to
* handle the case that fdin and fdout are the same.
*/