feat: add readline and history WIP
This adds support for basic readline-like behavior using chzyer/readline, including persistence of history for the admin shell between sessions.
Weirdly for now this doesn't seem to work in docker while it works outside of it.
Hi @jle64 is it still in WIP or do you need a review?
Hi @moul it's still broken when I run it in docker and I have no idea why. I don't see what difference it should make to be in docker but it results in the user input being hidden, while it works perfectly if I just run the sshportal binary directly on the host.
So it's not ready but if you have an idea of what could be wrong with it or some time to look at it I would be grateful.
Hum, super strange, I don't have an issue when running sshportal within Docker
I'm running it this way: make docker.build && docker run -it --rm -p 2222:2222 moul/sshportal

Hum, if I launch it like you do it works, however if I launch it without the -t docker option it doesn't anymore.
So it seems the fact that the server is being run in a docker with terminal or not changes how it behaves when a client connects, which isn't right.
yes -t if for "tty", it can be checked dynamically from within go, so you can maybe make a condition that uses readline or the previous mode dynamically :)
So it seems the fact that the server is being run in a docker with terminal or not changes how it behaves when a client connects, which isn't right.
yes, thinking more about it, it's unrelated, so maybe, the script is checking if the current process has tty support instead of checking if the SSH user has tty support, we should probably prevent the library from checking itself