Skip to content

If node is started with --debug a space appears on the following line #7755

Description

@pke
  • Version: 6.2.1
  • Platform: Windows
  • Subsystem: 8.1

image

See the discussion over here

Activity

  1. bnoordhuis commented on Jul 16, 2016

    @bnoordhuis
    Member

    FWIW, cannot reproduce on Linux with v4, v5, v6 and master, assuming exit.js looks like this:

    console.log('line 1')
    console.log('line 2')

    A full test case would be appreciated.

  2. pke commented on Jul 16, 2016

    @pke
    Author

    well, that is Windows and I wouldn't know what a test case would look like other than what you already can see on the screenshot. And yes, its only those 2 lines you write in exit.js

  3. bnoordhuis commented on Jul 16, 2016

    @bnoordhuis
    Member

    @nodejs/platform-windows Can someone confirm?

  4. seishun commented on Jul 16, 2016

    @seishun
    Contributor

    Same here.

    C:\Users\Nikolai\Desktop>node --version
    v6.3.0
    
    C:\Users\Nikolai\Desktop>node --debug exit.js
    Debugger listening on [::]:5858
     line 1
    line 2
    
  5. seishun commented on Jul 16, 2016

    @seishun
    Contributor

    It seems this happens because WriteConsoleW is called with a string that has a null character at the end here, which the console turns into a space. For some reason the null character is omitted if stderr is piped to a file. Replacing n with n-1 fixes the issue.

  6. pke commented on Jul 16, 2016

    @pke
    Author

    Super, Thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions