RemoteREPL.jl
RemoteREPL.jl copied to clipboard
Feature Request: Ability to use Cthulhu within RemoteREPL
:sweat_smile:
To what extent is the Cthulhu.jl interface built around having direct access to stdout for display and stdin for user input? Looking at the code it seems this is somewhat assumed.
Seems there's two ways forward:
- Generalize Cthulhu to allow stdout and stdin to be swapped in some way. Eg, make sure a
REPL.Terminals.TTYTerminalis consistently passed around in a way we can override it (or should that beBase.TTY?). Perhaps make the TTY overridable with a task local variable. Cthulhu implicitly usesREPL.TerminalMenus.readkeyto read keys from the user; eventually that needs to end up as a read to the client-side TTY. - Alternatively, invent a way for
RemoteREPLto redirect and steal the globalstdoutandstdinof the server process. Certainly this is possible for stdout; for stdin I'm not sure how this could work. Presumably it'd need to involve aTTY.
The tricky part seems to be finding a way to detect that the server code is waiting on a read of the serverside TTY so that we can forward this read to the client. But without blocking the client TTY by trying to read from it when the server isn't waiting for input.