I have a program that开发者_开发技巧 takes console input that I'm trying to debug. Sending an EOF (Ctrl+D in shell) is important to its function; but Ctrl+D doesn't send one in Eclipse's debugger console.
This should be super simple, but Google (and my limited experience) yields nothing. Thanks so much for any help!
I just found a solution to this problem:
When you finish entering your inputs on console, click on another window (editor, Project Explorer, etc.), then click back on console. Hitting Ctrl + Z will work now.
It's a bug, see here:
Passing End of Transmission (Ctrl + D) character in Eclipse CDT console
I think it(not responding to Ctrl+D on Unix/Linux systems and not responding to Ctrl+Z on DOS?Windows systems) was a bug some 2 3 years back. Eclipse mailing lists or bugs database should have better information about it. Refer here for more info on the bug report.
On mac for C++ projects try to disable this feature: Go to Run -> Run configurations... Uncheck Connect process input & output to a terminal. It worked for me.
For some reason the trick by focusing something else and then refocussing the console only works in the 'normal' perspective, and not in the debugging perspective for me.
Another workaround is to use an external console. This can be configured here:
- Press
Run
in the upper menu - Choose
Debug
Configurations - Go to the
Debugger
tab - Check
Use external console for inferior (open a new console window for input/output)
Works for both the normal perspective and the debugging perspective for me.
精彩评论