Closed jlkalberer closed 1 month ago
@SBoudrias I've tracked back https://github.com/yeoman/generator/issues/1098 to this issue. It's reported in a lot of places, node.js included (https://github.com/nodejs/node/issues/21210https://github.com/nodejs/node/issues/21210)
Removing rl.close();
fix the issue, but I don't know the consequences.
Maybe make it conditional for non windows.
After this fix, there are more problems
list
or checkbox
cannot be selected. When input UP or DOWN, option will not be switched, instead the last input value showed up
Seems this have to be reverted. @Diablohu what is your environment? Is this a regression?
@mshima Windows 10 1909 (18363.476) I tried both in PowerShell and the new Windows Terminal. They have the same problems
7.0.1 is fine 7.0.0 has the hang problem
@Diablohu node 8?
I tried on both node 10 and 12. Has the same problem
Created a PR reverting last commit https://github.com/SBoudrias/Inquirer.js/pull/881 and another with skip closing workaround https://github.com/SBoudrias/Inquirer.js/pull/882.
Adding
process.stdin.unpipe(this.rl.input);
before
this.rl.output.end();
this.rl.pause();
this.rl.close();
fix the hang problem.
But not the list and checkbox problem. That can related to other readline uses: https://github.com/SBoudrias/Inquirer.js/blob/0bc1b011e8441e663e788cba66b71ef40aed5252/packages/core/index.js#L42-L46 https://github.com/SBoudrias/Inquirer.js/blob/0bc1b011e8441e663e788cba66b71ef40aed5252/packages/core/hooks.js#L86-L90
I use inquirer@7.0.1 then it fixed.
i met the same problem, here is my env
then i fixed the problem by revert the version with v7.*
This Issue still exists for me. Using bun 1.1.3 on powershell Win 11 22H2. Tried via bunx @inquirer/demo@latest
.
Hi @just-maik, this is a bug you should report to bun (not here.)
I dug into this a bit because of https://github.com/Microsoft/AppCenter-SDK-React-Native/issues/471#event-2067227003
Inquirer uses
stdout
to write to the command prompt. It looks like if this line is run, it will cause windows to "hang". Also, it turns out that node 8.15.0 works with this code so it could also just be a regressionI think what is really going on is that the stream is just ending so we don't see any more output.
Here is a repro of the bug.
With this simple example removing
rl.output.end()
fixes things but the only way to work around it ininquirer
is to remove therl.close()
line.