-
Notifications
You must be signed in to change notification settings - Fork 132
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
Proposal: add a request for standard input #216
Comments
@eliphatfs ... because output is easy: But how exactly should input work? |
Output is passed through an |
@eliphatfs How would a DAP client use that |
For example, VS Code may have some menu option to enter the std input sending mode, and under that mode when user hits |
@eliphatfs thanks for your answer Using a menu action is not very discoverable for users: an interactive (command line) program typically prompts the user via stdout and then reads data on stdin. Requiring that the user then uses a menu action is not very intuitive. IMO, input cannot be separated from output. That makes a console/terminal a good choice but with that we are running into the problem that both the debug REPL and the program want to read input (actually with feature request #231 there is even a third component, the debugger that wants to read input). If we could find out that a program reads from stdin, then we could bring that information to the client so that the debug console UI could show a different prompt to indicate which component is currently reading input. But I'm not aware of a way to do this. |
To me, running the program in the terminal when you know that you need to give input to stdin doesn't seem like such a bad workaround. Some other options I can think of:
If I had to pick one, I would add a toggle button to the debug console input that switches to "stdin mode". But, my experience with search leads me to suspect that people will click it by mistake and get confused. I'm not sure it's that large of an improvement over using the terminal. |
Just to put this on the radar as an option: vscode-lldb supports stdio redirection as part of the launch configuration: https://github.com/vadimcn/vscode-lldb/blob/master/MANUAL.md#stdio-redirection |
Not sure if it would behave as you want, but my current workaround for this is as follows (debugger is GDB). As you said, input cannot be separated from output.
For some debuggers (like GDB), REPL is not working if an input is requested, since debuggee is still in a |
I was thinking about this over the weekend. A simple program that reads single characters from stdin would work fine with this, but more complex applications have more interaction, and more than can be represented in the current VS Code Debug Console. Even given an omnipotent Debug Console view, interleaving complex stdin/out with REPL might not be possible -- for example, imagine a rich curses-based CLI. In terms of UI, I would imagine instead a split view with the traditional REPL on one side and a terminal for stdin/out on the other.
This is the hard part, and I don't think it's possible universally (the closest would be using Having a REPL separate from stdio may be something that users find generically useful. I would turn on when working with development servers that like to log their incoming requests, for example. If this is just a general feature, that would also avoid the need for specific detection or signaling. Though this is also possible in recent releases of VS code by dragging the terminal to create a spit view with the Debug Console. |
Thank you all for the comments. After reading and contemplating about the comments again, I see two important messages:
From this I conclude that there is no strong need to have a DAP @eliphatfs @connor @roblourens @mfussenegger @yannickowow what do you think? |
I agree |
Closing, since there are no objections. |
There are output events that allow the DAP to send debuggee stdout/stderr to the host. So why not the other direction.
The text was updated successfully, but these errors were encountered: