Skip to content
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

Remote CLI combined with Local CLI causes IO Issues #193

Open
e-fin opened this issue Sep 28, 2021 · 0 comments
Open

Remote CLI combined with Local CLI causes IO Issues #193

e-fin opened this issue Sep 28, 2021 · 0 comments

Comments

@e-fin
Copy link

e-fin commented Sep 28, 2021

Long story short, I have a terminal using this library and one of the options connects to a remote CLI listening on some port using this library. I can successfully connect, but once I close the connection to the remote CLI and return to the original prompt it seems to only read half of the keys im pressing. Ive made a small POC instead of sending over all my applications:

Client:
client.txt

Server:
server.txt

to re-create the error compile both binaries and do the following:

root@localhost:/readlineTest/client$ ./server &
root@localhost:
/readlineTest/client$ ./client
»
»
»
» help
commands:
...
» remote
readline-remote: help
receive:help
readline-remote: test
receive:test
readline-remote: exit
»

after you type "exit" in the "readline-remote" context and it returns to the original prompt, it will not read every key you type but the prompt still works if you can struggle to get all the characters typed in.

Ive tried many things like properly closing the remote prompt, killing and re-starting the original readline prompt but no luck, the IO always seems screwed up after doing this. Ive tried messing around with goroutines but no luck with that either

Edit: sorry I tried to use code blocks for the actual code but githubs code blocks dont like it when you put code in them apparently....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant