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

Feature Request: Ability to use Cthulhu within RemoteREPL #15

Open
Ellipse0934 opened this issue Jul 14, 2021 · 1 comment
Open

Feature Request: Ability to use Cthulhu within RemoteREPL #15

Ellipse0934 opened this issue Jul 14, 2021 · 1 comment

Comments

@Ellipse0934
Copy link

😅

@c42f
Copy link
Collaborator

c42f commented Jul 15, 2021

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.TTYTerminal is consistently passed around in a way we can override it (or should that be Base.TTY?). Perhaps make the TTY overridable with a task local variable. Cthulhu implicitly uses REPL.TerminalMenus.readkey to read keys from the user; eventually that needs to end up as a read to the client-side TTY.
  • Alternatively, invent a way for RemoteREPL to redirect and steal the global stdout and stdin of 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 a TTY.

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.

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

2 participants