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!

Charles Offenbacher
  • 3,094
  • 3
  • 31
  • 38

5 Answers5

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.

Matt
  • 796
  • 12
  • 25
6

It's a bug, see here:

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

Community
  • 1
  • 1
Matt
  • 245
  • 1
  • 4
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.

vpit3833
  • 7,817
  • 2
  • 25
  • 25
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.

Serge V.
  • 3,377
  • 3
  • 20
  • 28
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.

Andersnk
  • 857
  • 11
  • 25