Debugger doesn't block at getch nor gets

Both STDIN.getc and STDIN.getch block when a running Ruby script and so
does STDIN.gets. But, when debugging, only STDIN.getc blocks. The
debugger steps immediately over STDIN.getch and STDIN.gets. How can I
get the debugging environment to behave like the default “running”
environment?

Using ruby -rdebug, RubyMine or NetBeans makes no difference, they all
exhibit the same behavior.