20

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!

5

5 Answers 5

16

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.

1
6

It's a bug, see here:

Passing End of Transmission (Ctrl + D) character in Eclipse CDT console

0
2

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.

1
  • Exactly. It is a cross platform bug concerning End Of File Character, which maps to Ctrl+D on Unix/Linux systems and Ctrl+Z on DOS. Mar 9, 2015 at 15:05
0

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.

0

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)

enter image description here

Works for both the normal perspective and the debugging perspective for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.