When starting commands such as vite dev or next dev from nr, the terminal input may be corrupted when exiting. The following is a reproduction of what happens in each environment when using vite dev.
The problem doesn't occur with npm run dev, so I'm thinking it might be an nr issue.
Create a vite project with npm create, perform npm install
Use npm run dev in windows terminal and exit with Ctrl+C, Y, Enter
No problem.
Use npm run dev in windows terminal and exit with Ctrl+C, Ctrl+C
No problem.
Use nr dev in windows terminal and exit with Ctrl+C, Y, Enter
Nothing will be displayed, but if you press Enter several times it will return to normal.
Use nr dev in windows terminal and exit with Ctrl+C, Ctrl+C
^C is displayed. Then press Enter and it will go back to normal.
In the vscode integrated terminal, use npm run dev and exit with Ctrl+C, Y, Enter
No problem.
In the vscode integrated terminal, use npm run dev and exit with Ctrl+C, Ctrl+C
No problem.
In the vscode integrated terminal, use nr dev and exit with Ctrl+C, Y, Enter
Nothing will be displayed, but if you press Enter several times it will return to normal.
In the vscode integrated terminal, use nr dev and exit with Ctrl+C, Ctrl+C
^C is displayed. Even if you press Enter, it doesn't seem to be finished yet, so press Ctrl+C again. It looks like it's finished, but my keystrokes only respond once in two until I close the terminal. It is extremely painful.
In writing this issue, I found a workaround.
Press Ctrl+C and after "Terminate batch job (Y/N)?" is displayed, press Ctrl+C three times.
The message continues to remain on the screen, but I was able to avoid a situation where I could not type it.
Reproduction
In the vscode integrated terminal, use nr dev and exit with Ctrl+C, Ctrl+C
Describe the bug
When starting commands such as
vite dev
ornext dev
fromnr
, the terminal input may be corrupted when exiting. The following is a reproduction of what happens in each environment when usingvite dev
.The problem doesn't occur with npm run dev, so I'm thinking it might be an nr issue.
https://github.com/antfu/ni/assets/3516343/c43d90ac-4945-4036-97c0-2bd5170a819a
workaround
https://github.com/antfu/ni/assets/3516343/7d181035-a809-4ccc-847b-f67b926e8b52
In writing this issue, I found a workaround. Press Ctrl+C and after "Terminate batch job (Y/N)?" is displayed, press Ctrl+C three times. The message continues to remain on the screen, but I was able to avoid a situation where I could not type it.
Reproduction
In the vscode integrated terminal, use
nr dev
and exit with Ctrl+C, Ctrl+CSystem Info
Used Package Manager
npm
Validations