Skip to content

launcher.bat could not pass on redirected input into the java program being debugged #756

Closed
microsoft/vscode-java-debug
#1077
@Nibikibaba

Description

If a developer would like to redirect a file as stdin to a java program to be debugged, one would set up a launch config in launch.json like this:

...
{
  ...
  "console": "integratedTerminal",
  "args": ["<", "input.txt"]
}

While integratedTerminal indeed preserved the < input.txt and passed it on unmodified, input.txt in the above example is redirected to launcher.bat as its stdin, instead of stdin for the java program to be launched.

A quick fix would be to replace the %* line in launcher.bat by more | %* so that data streamed into stdin of launcher.bat would be piped into the java program being launched using the more program. Unfortunately, more would treat input as text and modify line breaks. It would be better if the developers of this extension could fix this issue properly, by perhaps NOT using an intermediate launcher.bat script (which only perform one additional function which is the changing of code-page) but directly launch the java program with input redirection specified in the "args" array performed on the java program directly.

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions