You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works well if I run it once, but if I try to read the console input multiple times (by calling readInput in a loop for example), the input isn't read any more after the first iteration and the for await (const line of console) loop isn't called anymore.
Is this a bug or am I doing something wrong?
Example that doesn't work:
asyncfunctionreadInputMultipleTimes(): void{for(inti=0;i<10;i++){// Only the first readInput() will work properlyawaitreadInput();}}
…g the console iterator (oven-sh#5216)
* Fixoven-sh#5177
* Fixoven-sh#5175
* make most globals deletable/overridable
* not done
* cool
* a
* done
* fix test
* oops
* yippee
I'm using the following code mentioned in the docs to read lines from the console:
This works well if I run it once, but if I try to read the console input multiple times (by calling
readInput
in a loop for example), the input isn't read any more after the first iteration and thefor await (const line of console)
loop isn't called anymore.Is this a bug or am I doing something wrong?
Example that doesn't work:
Originally reported on Discord:
Reading from console using
for await (const line of console)only works once
The text was updated successfully, but these errors were encountered: