-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
connect: fix terminal after executing os.exit() #440
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Thank you for the patch.
See a comment bellow.
cli/connect/console.go
Outdated
@@ -247,6 +247,14 @@ func getExecutor(console *Console) prompt.Executor { | |||
var data string | |||
if _, err := console.conn.Eval(consoleEvalFuncBody, args, opts); err != nil { | |||
if err == io.EOF { | |||
if strings.Contains(console.input, "os.exit(") { | |||
console.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't dug deep, but the same problem has already been fixed in f1111a9 .
Maybe we should
- move the code fixing the console into a separate function
- call it from
console.close()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f1111a9 Doesn't fix it. Moved code
ffbaeaa
to
b7c928b
Compare
2504007
to
d331a2d
Compare
Fixed terminal brake after os.exit() in tt connect session. Have done it by adding workaround for the bug(c-bata/go-prompt#228) in case of executing os.exit(). Closes #425
d331a2d
to
e2d1c61
Compare
Fixed terminal brake after os.exit() in tt connect session. Have done it by adding workaround for the bug(c-bata/go-prompt#228) in case of executing os.exit().
Proof:
Terminal 1:
Terminal 2:
Closes #425