antfu-collective / ni

💡 Use the right package manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

using nr in vscode integrated terminal on Windows, only 1 out of 2 keystrokes works after exiting.

eai04191 opened this issue · comments

Describe the bug

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.

2024-02-15_20-19-30_keyviz.mp4
  1. Create a vite project with npm create, perform npm install
  2. Use npm run dev in windows terminal and exit with Ctrl+C, Y, Enter
    • No problem.
  3. Use npm run dev in windows terminal and exit with Ctrl+C, Ctrl+C
    • No problem.
  4. 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.
  5. 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.
  6. In the vscode integrated terminal, use npm run dev and exit with Ctrl+C, Y, Enter
    • No problem.
  7. In the vscode integrated terminal, use npm run dev and exit with Ctrl+C, Ctrl+C
    • No problem.
  8. 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.
  9. 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.

workaround

2024-02-15_20-43-00_keyviz.mp4

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

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700KF
    Memory: 42.36 GB / 63.82 GB
  Binaries:
    Node: 20.11.1 - ~\AppData\Local\Volta\tools\image\node\20.11.1\node.EXE
    Yarn: 1.22.21 - ~\AppData\Local\Volta\tools\image\yarn\1.22.21\bin\yarn.CMD
    npm: 10.2.4 - ~\AppData\Local\Volta\tools\image\node\20.11.1\npm.CMD
  Browsers:
    Edge: Chromium (121.0.2277.112)
    Internet Explorer: 11.0.22621.1

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.