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

Streaming stdout output does not play nice with the REPL #8049

Open
caspervonb opened this issue Oct 20, 2020 · 2 comments
Open

Streaming stdout output does not play nice with the REPL #8049

caspervonb opened this issue Oct 20, 2020 · 2 comments
Labels
bug Something isn't working correctly repl related to the Read-Eval-Print-Loop functionality of Deno

Comments

@caspervonb
Copy link
Contributor

caspervonb commented Oct 20, 2020

Start something that will write to stdout/stderr in a repl

$ deno
> setInterval(() => console.log(Math.random()), 1000);

And try to edit a line, not a good experience.

Problem is that rustyline does not give us any control of any kind of writer or access to the line buffer. So we can't do anything about it until kkawakam/rustyline#235 or a variant of it lands. Or we move away from rustyline, linefeed seems to handle this well.

@kitsonk kitsonk added bug Something isn't working correctly repl related to the Read-Eval-Print-Loop functionality of Deno labels Oct 20, 2020
@birkskyum
Copy link
Contributor

This appear to be working just fine

➜ deno
Deno 1.36.3
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
> setInterval(() => console.log(Math.random()), 1000);
1
> 0.7224430744736088
0.19093274494890866
0.3606157099202092
0.6114824936877588
0.26164013246656026
0.25243730793420793
0.6515413097477727
0.4563109364906546
0.30761606834885136
0.43871716136527295
0.7809966770570556
0.12405176850940203
0.05730388617238513
0.2977045017123099
0.10976879229705316
0.36901057434579365
0.4395197867030154
0.16751027296918908

@bartlomieju
Copy link
Member

@birkskyum try writing some input when the interval is running - you'll see that the input is getting interleaved with the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly repl related to the Read-Eval-Print-Loop functionality of Deno
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants