GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — repl: strange behaviour in the last nightlies on Windows · Issue #18189 · nodejs/node

repl: strange behaviour in the last nightlies on Windows #18189

New issue
Copy link
New issue
Copy link
Closed
Closed
repl: strange behaviour in the last nightlies on Windows#18189
Copy link
Labels
fsIssues and PRs related to file-system APIs and the fs module.ttyIssues and PRs related to the tty subsystem.windowsIssues and PRs related to the Windows platform.

Description

@vsemozhetbyt
vsemozhetbyt
opened on Jan 16, 2018
Issue body actions
  • Version: 10.0.0 nightly 2018 01 14–16
  • Platform: Windows 7 x64, cmd.exe shell
  • Subsystem: repl

Steps to reproduce:

  1. download a Windows nightly from 2018 01 14 up to 2018 01 16.
  2. Start REPL session.
  3. Evaluate some last commands from the history with UP+ENTER keys.

Anomalies:

  1. Strange prompt symbols / output wrappings (ANSI escape codes?).
  2. These symbols are preserved and added with each UP key press.
  3. The output is decolorized.
10.0.0 nightly 2018 01 13 screenshot:

13


10.0.0 nightly 2018 01 14–16 screenshot:

14-16


Not sure if this is reproducible in other OSs.

Activity

  1. vsemozhetbyt
    added
    replIssues and PRs related to the REPL subsystem.
    windowsIssues and PRs related to the Windows platform.
    on Jan 16, 2018
  2. apapirovski commented on Jan 16, 2018

    @apapirovski
    apapirovski
    on Jan 16, 2018
    Contributor
    More actions

    /cc @addaleax it seems very likely this is related to 8b751f7

  3. addaleax commented on Jan 17, 2018

    @addaleax
    addaleax
    on Jan 17, 2018
    Member
    More actions

    @vsemozhetbyt @apapirovski Thanks, I’ll take a look!

  4. addaleax
    added
    fsIssues and PRs related to file-system APIs and the fs module.
    ttyIssues and PRs related to the tty subsystem.
    and removed
    replIssues and PRs related to the REPL subsystem.
    on Jan 17, 2018
  5. addaleax commented on Jan 17, 2018

    @addaleax
    addaleax
    on Jan 17, 2018
    Member
    More actions

    Fwiw, I cannot reproduce the exact problem as described by you, but printing a simple non-ASCII string like '\xf6' seems to be enough to trigger this issue. :/

    But yes, it seems like this is being triggered by #18019, and in released versions of Node this also doesn't quite work the way I'd expect it to:

    > fs.writeSync(1, 'Ö\n')
    Ö
    3

    I guess that's happening because the default code page isn't expecting UTF-8?

    Thinking a bit harder about it, I think it's okay to just revert the changes to lib/tty.js from that PR. libuv supports blocking uv_try_write()s for TTYs across platforms, and even if that were not the case, nothing terribly bad actually happens. (I'll open a PR with that shortly.)


    As a side note: We currently actually recommend fs.writeSync(1, ...) in the async_hooks docs as a way to do synchronous logging. If that is broken on Windows we might want to re-think that recommendation and/or just expose process._rawDebug or some other fprintf(stderr, ...) thingy as public API. /cc @AndreasMadsen

  6. addaleax
    added a commit that references this issue on Jan 17, 2018

    tty: fix console printing on Windows

    c2bb5ab
  7. vsemozhetbyt commented on Jan 17, 2018

    @vsemozhetbyt
    vsemozhetbyt
    on Jan 17, 2018
    ContributorAuthor
    More actions

    FWIW, changing of a shell code page seems to not fix the issue:

    > chcp 65001
    Active code page: 65001
    
    > node.10.0.0.v8-6.3.20180116.nightly.exe
     [1G [0J>  [3G
    
    > chcp 1252
    Active code page: 1252
    
    > node.10.0.0.v8-6.3.20180116.nightly.exe
    �[1G�[0J> �[3G
    
    > chcp 850
    Active code page: 850
    
    > node.10.0.0.v8-6.3.20180116.nightly.exe
    ←[1G←[0J> ←[3G
    
  8. addaleax commented on Jan 17, 2018

    @addaleax
    addaleax
    on Jan 17, 2018
    Member
    More actions

    @vsemozhetbyt Can you try #18214 and see if you’re still seeing those issues?

    Reacted by Vse Mozhe Buty
  9. BridgeAR
    added a commit that references this issue on Jan 19, 2018

    tty: fix console printing on Windows

    ea7400c
  10. BridgeAR
    closed this as completedin ea7400con Jan 19, 2018
  11. addaleax
    added 2 commits that reference this issue on Feb 26, 2018

    tty: fix console printing on Windows

    35b0936

    tty: fix console printing on Windows

    38fd790
  12. MayaLekova
    added a commit that references this issue on May 8, 2018

    tty: fix console printing on Windows

    8221bad
  13. MylesBorins
    added a commit that references this issue on Aug 17, 2018

    tty: fix console printing on Windows

    9fdba04
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

    fsIssues and PRs related to file-system APIs and the fs module.ttyIssues and PRs related to the tty subsystem.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

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.