Tvaroh
Tvaroh

Reputation: 6763

IntelliJ IDEA: send EOF symbol to Java application

When running a command-line Java application from IntelliJ IDEA, is it possible to send EOF symbol to the program awaiting input? In console this can be done using ctrl-d combination but in IDEA it doesn't work.

Upvotes: 34

Views: 9424

Answers (3)

xdavidliu
xdavidliu

Reputation: 3042

I ran into this problem while running a Kotlin command-line application from within Intellij. Other people were saying Ctrl+D or ^ both work, but neither worked for me.

I realized it's because the keymap I was using (a slightly modified version of a VSCode keymap from Jetbrains) had Ctrl+D already bound to something else. I searched the keymap commands for "EOF" and it turns out there's a "send EOF" command that had no bindings. I set that to Ctrl+D while replacing the others, and that worked perfectly.

(using Intellij 2023.2.1)

Upvotes: 2

Pavel
Pavel

Reputation: 3539

It's been implemented, use Ctrl+D / ⌘+D on Mac. https://www.jetbrains.com/idea/help/debug-tool-window-console.html

Upvotes: 40

Jean-Philippe Briend
Jean-Philippe Briend

Reputation: 3525

In Dec 2012, it was still not possible : http://devnet.jetbrains.com/thread/436131

Upvotes: 4

Related Questions