From 9bd6045c46e907a03b2b8cdc2f75db2b3496766f Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Thu, 1 Oct 2020 17:13:47 -0400 Subject: [PATCH] If the exec'd command executed on its own, don't print a term reason out, just pass through the code --- internal/cmd/commands/proxy/proxy.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/internal/cmd/commands/proxy/proxy.go b/internal/cmd/commands/proxy/proxy.go index 3bd1d2d01..70f9131fb 100644 --- a/internal/cmd/commands/proxy/proxy.go +++ b/internal/cmd/commands/proxy/proxy.go @@ -647,13 +647,8 @@ func (c *Command) Run(args []string) (retCode int) { termInfo.Reason = "Session has expired" default: if c.execCmdReturnValue != nil { - r := c.execCmdReturnValue.Load() - switch r { - case 0: - termInfo.Reason = "" - default: - termInfo.Reason = fmt.Sprintf("Executed command exited with code %d", r) - } + // Don't print out in this case, so ensure we clear it + termInfo.Reason = "" } else { if c.connectionsLeft.Load() == 0 { termInfo.Reason = "No connections left in session"