Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird space in front of some output in Node REPL #406

Closed
jcubic opened this issue Nov 8, 2024 · 2 comments
Closed

Weird space in front of some output in Node REPL #406

jcubic opened this issue Nov 8, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jcubic
Copy link
Owner

jcubic commented Nov 8, 2024

Przechwycenie obrazu ekranu_2024-11-08_21-50-13

@jcubic jcubic added the bug Something isn't working label Nov 8, 2024
@jcubic
Copy link
Owner Author

jcubic commented Dec 23, 2024

The space appear when Promise takes longer to execute:

lips> (Promise.resolve "x")
"x"
lips> (new Promise (lambda (r) (setTimeout (lambda () (r "x")) 100)))
 "x"

@jcubic
Copy link
Owner Author

jcubic commented Dec 23, 2024

It was part of the undocumented _refreshLine readline method:

https://github.com/nodejs/node/blob/main/lib/internal/readline/interface.js#L500C1-L503C6

    // Force terminal to allocate a new line
    if (lineCols === 0) {
      this[kWriteToOutput](' ');
    }

@jcubic jcubic closed this as completed Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant