rustyline
rustyline copied to clipboard
Support for arbitrary streams for input/output
It seems that rustyline
currently only supports standard input/output. Goose will accept connections via telnet and expose a command line interface, which allows users to control their load tests. We would like to use rustyline
to improve the UX of the said command line, but we would need to be able to wire it into a TCP stream instead of stdin/stdout.
The idea of supporting arbitrary streams was already floated in #377. This approach would allow us to achieve what we want while also opening a lot of other possibilities for the library.
Is this something that would be considered? Are there any plans to do that already?
Like https://github.com/jline/jline3/tree/master/remote-ssh/src/main/java/org/jline/builtins/ssh or https://github.com/prompt-toolkit/python-prompt-toolkit/tree/master/examples/ssh ?
Yes, something like this.
I have no idea how jline3 / python-prompt-toolkit support ssh / telnet session. Maybe only the Terminal implementation differs ?
Possibly another implementation of the Term
trait? Additionally to the Windows and Unix ones that we have already?
In this case, we need a cargo feature to activate the ssh / telnet implementation.
Agreed. Are you generally prepared to accept this feature if I give it a try?
If only tty
module is impacted and all new dependencies are optional except when this feature is activated, I am ok.
OK, I will give it a try and see where it takes me. Thank you for the fast response!
I implemented this here by adding a new variant to config::Behaviour
that allows the user to specify file descriptors to use. Would you like me to file a PR?