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

ts-node -i repl do not fflush stdout #1013

Closed
wsdjeg opened this issue Apr 18, 2020 · 6 comments · Fixed by #1019
Closed

ts-node -i repl do not fflush stdout #1013

wsdjeg opened this issue Apr 18, 2020 · 6 comments · Fixed by #1019
Labels

Comments

@wsdjeg
Copy link

wsdjeg commented Apr 18, 2020

hello, and thanks for working for this project, and I just want to add typescript repl support in SpaceVim

the code runner works well now, but the repl do not work in my plugin, as the ts-node -i do not fflush the sdtout buffer until we send (os/exit).

@blakeembrey
Copy link
Member

@wsdjeg Can you briefly describe what you're trying to do? The REPL is written to stdout here:

ts-node/src/bin.ts

Lines 407 to 408 in 2a0f1f3

if (name) repl.outputStream.write(`${name}\n`)
if (comment) repl.outputStream.write(`${comment}\n`)
(it's initialized here:

ts-node/src/bin.ts

Lines 343 to 345 in 2a0f1f3

input: process.stdin,
output: process.stdout,
terminal: process.stdout.isTTY,
). There might be some options to tweak here.

@wsdjeg
Copy link
Author

wsdjeg commented Apr 19, 2020

what is terminal: process.stdout.isTTY,? I do not use ts-node in terminal but in pipe.

@cspotcode
Copy link
Collaborator

@wsdjeg it's an option passed to repl.start, explained here: https://nodejs.org/docs/latest-v13.x/api/repl.html#repl_repl_start_options

@cspotcode
Copy link
Collaborator

cspotcode commented Apr 22, 2020

EDIT disregard this comment, I think I'm wrong about this. (previous comment is still accurate)

@cspotcode
Copy link
Collaborator

@wsdjeg This should be fixed by #1019, which has been released in v8.9.1

Thank you for the bug report!

@wsdjeg
Copy link
Author

wsdjeg commented Apr 26, 2020

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants