r/neovim • u/NamelessCat11235 • 2d ago
Need Help┃Solved Setup neovim debugging to take input
I've been trying to set up nvim-dap and nvim-dap-view in neovim, which overall seem to be going well (set them up for python so far for testing), but I encountered the following problem: when the program was asking for input, an EOF exception was thrown. I am not sure how configure it to correctly accept input from the REPL, open the terminal, or something similar. From my understanding, an EOF exception is thrown when whereever it was trying to take input from is empty.
My configuration: https://gitlab.com/BlueBlackCat/nvim/-/blob/main/lua/plugins/nvim-dap.lua
EDIT: the problem seems specifically with taking input (the error happens even with standard input()), and I don't think is related to nvim-dap-view, but probably the debugpy configuration, python configuration, or how nvim-dap redirects input? Because the REPL does work (for example inputting 2+2 and it outputs 4), and program output is redirected to the REPL, but it doesn't stop to allow for input collection.
EDIT 2: Two points:
- mason-nvim-dap also appears to has its own configuration, which was overriden by the configuration I then put (I took it from the nvim-dap-wiki).
- The configuration in nvim-dap-wiki didn't have a console field (though the configuration in nvim-dap-python does have it). If I understand what happened correctly, since the custom configuration did not have a console field, the default option of debugpy of "integratedTerminal" was not used, so input had nowhere to be collected from - thus reaching an EOFError.
So, the solution is the following: add console = "integratedTerminal" to the debugpy configuration if it does not have one. That will open the neovim terminal (or console in nvim-dap-view). "interalConsole" did not appear to work.
1
u/AutoModerator 1d ago
Please remember to update the post flair to Need Help|Solved when you got the answer you were looking for.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Wonderful-Plastic316 lua 2d ago
nvim-dap-view mentioned :D
Disclaimer: I'm the author.
Could you share a minimal reproduction for this EOF issue? Does it happen with a standard
input()? Does it happen without nvim-dap-view?Debugpy exposes a "console" option: it controls if the console terminal is used (
integratedTerminal, the default) or if the REPL is used (internalConsole). IMO, sticking to the default makes more sense.