Skip to content

Debug Console render newlines unnecessary #72110

@testforstephen

Description

@testforstephen

Version: 1.33.0 (system setup)
Commit: 0dd516d
Date: 2019-04-04T15:14:28.026Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.17763

Run the following the Java program multiple times, DEBUG CONSOLE sometimes add some newlines unnecessary.

PrintfTest.java:

import java.util.stream.IntStream;

public class PrintfTest {
    public static void main(String[] args) {
        IntStream.range(0, 10).forEach(it ->
            System.out.format("This is iteration %d. Hello VS Code! Hello RedHat!%n", it));
    }
}

DEBUG CONSOLE output:

This is iteration  <- Unnecessary newline here.
0. Hello VS Code! Hello RedHat!
This is iteration 1. Hello VS Code! Hello RedHat!
This is iteration 2. Hello VS Code! Hello RedHat!
This is iteration 3. Hello VS Code! Hello RedHat!
This is iteration 4. Hello VS Code! Hello RedHat!
This is iteration 5. Hello VS Code! Hello RedHat!
This is iteration 6. Hello VS Code! Hello RedHat!
This is iteration 7. Hello VS Code! Hello RedHat!
This is iteration 8. Hello VS Code! Hello RedHat!
This is iteration 9. Hello VS Code! Hello RedHat!

Dump the DAP event:

{"event":"output","body":{"category":"stdout","output":"This is iteration ","type":"output"},"seq":12,"type":"event"}
{"event":"output","body":{"category":"stdout","output":"0. Hello VS Code! Hello RedHat!\r\nThis is iteration 1. Hello VS Code! Hello RedHat!\r\nThis is iteration 2. Hello VS Code! Hello RedHat!\r\nThis is iteration 3. Hello VS Code! Hello RedHat!\r\nThis is iteration 4. Hello VS Code! Hello RedHat!\r\nThis is iteration 5. Hello VS Code! Hello RedHat!\r\nThis is iteration 6. Hello VS Code! Hello RedHat!\r\nThis is iteration 7. Hello VS Code! Hello RedHat!\r\nThis is iteration 8. Hello VS Code! Hello RedHat!\r\nThis is iteration 9. Hello VS Code! Hello RedHat!\r\n","type":"output"},"seq":13,"type":"event"}

It looks like vscode debug console renders an extra newline for each outputEvent even if it doesn't end with CRLF.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugdebugDebug viewlet, configurations, breakpoints, adapter issuesrelease-notesRelease notes issuesverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions