Vscode-java-debug: no way to take input

Created on 10 Oct 2017  路  6Comments  路  Source: microsoft/vscode-java-debug

Hi, is it me or is there no way to take input from the user, with ex.

public class App {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        System.out.println("Hello " + s.nextLine());
    }
}

There is no console to type input into ?
I've tried using the "console": "internalTerminal" and other's but it does not work with any of that, is it an limitation from this ext ?

feature request

Most helpful comment

It's fixed in 0.4.0. By changing console to integratedTerminal/externalTerminal in launch.json, it supports console input now.

All 6 comments

@TheSinding currently the debug console doesn't support typing input yet.
But you can launch your java program manually in a standalone terminal.
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=1049 -cp ./bin YourMainClass

Then start the debug with attach mode.

    {
      "type": "java",
      "name": "Java Debug (Attach)",
      "request": "attach",
      "hostName": "localhost",
      "port": 1049
   }

Arh okay, thanks!

@testforstephen can we support launching in the integrated terminal for this scenario?

@akaroml yes, the feature supportsRunInTerminalRequest provided by VSCode is exactly for this scenario.

It's fixed in 0.4.0. By changing console to integratedTerminal/externalTerminal in launch.json, it supports console input now.

@testforstephen thanks man.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

llgcode picture llgcode  路  7Comments

radu-ion picture radu-ion  路  5Comments

PG-practice picture PG-practice  路  3Comments

AlexMAS picture AlexMAS  路  5Comments

gcbartlett picture gcbartlett  路  3Comments