Skip to content

Pressing Ctrl+C after vp run dev, pnpm run dev, or npm run dev leaves the terminal in a broken state on Windows #1176

Closed

Description

@Curtion

Describe the bug

  • On Windows, after starting the dev server and stopping it with Ctrl+C, the terminal is left in a broken or unusable state.

  • Common symptoms include:

    • terminal input becomes sluggish or freezes
    • Backspace behaves incorrectly and prints ^H
    • Ctrl+C is echoed as ^C
  • This issue is reproducible with vp run dev, pnpm run dev, and npm run dev.

  • The issue does not reproduce with:

    • bun run dev
    • .\node_modules\.bin\vite.CMD
    • .\node_modules\.bin\vite.ps1
    • C:\Users\Curtion\Desktop\node-v24.14.1-win-x64\npm.cmd run dev(Native Node.js)
    • C:\Users\Curtion\Desktop\node-v24.14.1-win-x64\npm.ps1 run dev(Native Node.js)
PixPin_2026-03-28_12-59-32.mp4

Reproduction

https://github.com/Curtion/report-vite-plus-1

Steps to reproduce

  • Open a terminal on Windows.
  • Go to the project root directory.
  • Run one of the following commands:
    • vp run dev
    • pnpm run dev
    • npm run dev
  • Wait for the dev server to start.
  • Press Ctrl+C once to stop the process.
  • Observe that the terminal enters an abnormal state:
    • input becomes slow or unresponsive
    • Backspace prints ^H
    • Ctrl+C prints ^C

System Info

@Curtion ➜ report-vite-plus-1 git(main) vp env current
VITE+ - The Unified Toolchain for the Web

Environment:
  Version  24.14.1
  Source   lts

Tool Paths:
  node  C:\Users\Curtion\.vite-plus\js_runtime\node\24.14.1\node.exe
  npm   C:\Users\Curtion\.vite-plus\js_runtime\node\24.14.1\npm.cmd
  npx   C:\Users\Curtion\.vite-plus\js_runtime\node\24.14.1\npx.cmd
@Curtion ➜ report-vite-plus-1 git(main) vp --version  
VITE+ - The Unified Toolchain for the Web

vp v0.1.14

Local vite-plus:
  vite-plus  Not found

Tools:
  vite             Not found
  rolldown         Not found
  vitest           Not found
  oxfmt            Not found
  oxlint           Not found
  oxlint-tsgolint  Not found
  tsdown           Not found

Environment:
  Package manager  pnpm v10.28.0
  Node.js          v24.14.1
@Curtion ➜ report-vite-plus-1 git(main)

Used Package Manager

pnpm

Logs

Validations

Activity

  1. added theissue type on Mar 28, 2026
  2. fengmk2 commented on Mar 28, 2026

    @fengmk2
    Member

    @Curtion Can you show me the vp env doctor result?

  3. Curtion commented on Mar 28, 2026

    @Curtion
    Author

    @Curtion Can you show me the vp env doctor result?

    @Curtion ➜ ~ vp env doctor 
    VITE+ - The Unified Toolchain for the Web
    
    Installation
      ✓ VITE_PLUS_HOME    C:\Users\Curtion\.vite-plus
      ✓ Bin directory     exists
      ✓ Shims             node, npm, npx, vpx
    
    Configuration
      ✓ Shim mode         managed
    
    PATH
      ✓ vp                first in PATH
      ✓ node              C:\Users\Curtion\.vite-plus\bin\node.exe (vp shim)
      ✓ npm               C:\Users\Curtion\.vite-plus\bin\npm.exe (vp shim)
      ✓ npx               C:\Users\Curtion\.vite-plus\bin\npx.exe (vp shim)
      ✓ vpx               C:\Users\Curtion\.vite-plus\bin\vpx.exe (vp shim)
    
    Version Resolution
      Directory         C:\Users\Curtion
      Source            lts
      Version           24.14.1
      ✓ Node binary       installed
    
    ✓ All checks passed
    @Curtion ➜ ~ 
  4. fengmk2 commented on Mar 28, 2026

    @fengmk2
    Member

    I know what the problem is. Since your current project doesn't depend on vite-plus, vp run dev actually falls back to pnpm run dev, which caused this issue. Once #1179 this PR is merged, vp run dev will have the same effect as bun run dev.

  5. self-assigned this
    on Mar 28, 2026
  6. Curtion commented on Mar 28, 2026

    @Curtion
    Author

    I know what the problem is. Since your current project doesn't depend on vite-plus, vp run dev actually falls back to pnpm run dev, which caused this issue. Once #1179 this PR is merged, vp run dev will have the same effect as bun run dev.

    From my env, node, npm, npx are all vp shims. So pnpm run dev also goes through the shim — and it breaks too. Meanwhile native npm.ps1 run dev, bun run dev, and .\node_modules\.bin\vite.ps1 all work fine.

    PR #1179 just changes the routing, but the task runner still spawns Node.js through the same shim, so I suspect the console corruption might still occur.

  7. added 2 commits that reference this issue on Mar 28, 2026
    62a127b
    dbe191e
  8. fengmk2 commented on Mar 28, 2026

    @fengmk2
    Member

    @Curtion I've released an alpha test version, could you help test it? Upgrade via vp upgrade --tag alpha, then run vp run dev to see if the issue still exists.

  9. Curtion commented on Mar 28, 2026

    @Curtion
    Author

    @Curtion I've released an alpha test version, could you help test it? Upgrade via vp upgrade --tag alpha, then run vp run dev to see if the issue still exists.

    I tested with v0.1.15-alpha.5 (vp upgrade --tag alpha), and the issue has been resolved. Thanks for the fix!

  10. added 4 commits that reference this issue on Mar 29, 2026
    fbc8509
    756e54f
    ef4a6ac
    110f3c9
  11. 21 remaining items

  12. added 3 commits that reference this issue on Apr 21, 2026
    14e51eb
    0c260e4
    61d1d9a
  13. added a commit that references this issue on Apr 21, 2026
    c45e5e7
  14. added a commit that references this issue on Apr 21, 2026
    c5e09e7
  15. Type-Delta commented on Oct 3, 2026

    @Type-Delta

    Hey, @fengmk2.

    Sorry for commenting on an old issue, but this still reproduces with vp 1.0.0 when pnpm resolves to the Vite Plus pnpm.exe shim.

    The remaining path appears to be the package-manager shim dispatcher, rather than the task runner covered by the previous fixes.

    Environment: Windows build 26100, PowerShell 7.6.6. Reproduced in a fresh pwsh -NoProfile session, outside the original application, using a package with no dependencies.

    Reproduction

    package.json:

    {
      "name": "pnpm-signal-repro",
      "private": true,
      "scripts": { "dev": "node hold.cjs" }
    }

    hold.cjs:

    console.log('READY', process.pid);
    process.on('SIGINT', () => {
      console.log('SIGINT');
      process.exit(0);
    });
    setInterval(() => {}, 1000);
    1. Confirm Get-Command pnpm resolves to <USERPROFILE>\.vite-plus\bin\pnpm.exe.
    2. Run pnpm dev. In the failing test, Vite Plus selected managed pnpm 12.8.1.
    3. After READY, press Ctrl+C once.
    4. Try Write-Output 'TERMINAL_OK' in the same terminal.

    The application prints SIGINT and exits. PowerShell returns to its prompt, but Terminate batch job (Y/N)? also appears, and the next typed command does not execute normally.

    Before Ctrl+C, the observed chain was:

    pwsh.exe -NoProfile
      -> .vite-plus/bin/pnpm.exe
      -> .vite-plus/current/bin/vp.exe
      -> cmd.exe /c ".../package_manager/pnpm/12.8.1/pnpm/bin/pnpm.cmd dev"
      -> pnpm.native.exe dev
      -> cmd.exe /d /s /c node hold.cjs
      -> node.exe hold.cjs
    

    After Ctrl+C, the application, inner script shell, pnpm, and Vite Plus processes exited, but the outer cmd.exe running pnpm.cmd remained alive, waiting at the batch termination prompt.

    In the v1.0.0 vp_global_cli/src/shim/exec.rs, exec_windows() calls spawn_tool(), which uses std::process::Command::new(path).status(). That route does not apply the managed .cmd to PowerShell rewrite in vp_command/src/ps1_shim.rs.

    It seems the previous fixes did not cover the plain pnpm.exe proxy route.

    Control tests

    • Invoking the same managed pnpm 12.8.1 pnpm.native.exe directly stopped cleanly on one Ctrl+C, with no batch prompt or remaining fixture processes.
    • Resolving the project-selected managed pnpm and invoking its sibling .ps1 launcher directly also stopped cleanly. This passed twice with pnpm 11.9.0, and the next Node command completed in 60 ms.
    • Invoking with vp run dev also stopped cleanly. (this code path is fixed)
  16. reopened this on Oct 3, 2026
  17. fengmk2 commented on Oct 5, 2026

    @fengmk2
    Member

    @Type-Delta Thanks for the feedback, I will fix it.

  18. fengmk2 commented on Oct 5, 2026

    @fengmk2
    Member

    @Type-Delta #2890 (comment) Can you test on the preview build version?

  19. Type-Delta commented on Oct 6, 2026

    @Type-Delta

    @fengmk2 Tested with 0.0.0-commit.2b59191cab2dfa65155e327ba14f28add74e79a7, the issue on pnpm path has been fixed! Thanks a lot!

  20. KiriRainCat commented on Oct 6, 2026

    @KiriRainCat

    Tested the 2b59191cab2dfa65155e327ba14f28add74e79a7 build on Windows + Git Bash (MINGW64) with Bun 1.4.2.

    The Ctrl+C terminal issue is still reproducible with Bun-managed environments.

    Reproduction

    Native/system Bun:
      vp env off bun
      bun run dev
      → Ctrl+C
      → works normally ✅
    
    Vite+ managed Bun:
      vp env on bun
      bun run dev
      → Ctrl+C
      → terminal becomes completely unresponsive ❌
    
    Vite+ task runner:
      vpr dev
      → Ctrl+C
      → terminal becomes completely unresponsive ❌
    
    Vite+ Bun .cmd directly (only when `vp env off bun`):
      .../vite-plus/data/package_manager/bun/1.4.2/bun/bin/bun.cmd dev
      → Ctrl+C (pressed twice)
      → works normally ✅
    
    Vite+ managed Bun binary directly:
      .../vite-plus/data/package_manager/bun/1.4.2/bun/bin/bun.native.exe dev
      → Ctrl+C
      → works normally ✅
    

    After Ctrl+C, Git Bash becomes completely unresponsive to any further input. Unlike the pnpm case described in #1176, where some input is still visible/echoed, in my case Bash does not respond to subsequent commands at all and the terminal needs to be restarted.

    The issue only occurs through the Vite+ managed Bun / vpr path; the same Bun 1.4.2 runtime works correctly when invoked directly.

    This suggests the remaining issue is specific to the Bun package-manager shim / Windows process handling path.

    $ vp --version
    VITE+ - The Unified Toolchain for the Web
    
    vp v0.0.0-commit.2b59191cab2dfa65155e327ba14f28add74e79a7
    
    Local vite-plus:
      vite-plus  v0.0.0-commit.2b59191cab2dfa65155e327ba14f28add74e79a7
    
    $ vp env doctor
    VITE+ - The Unified Toolchain for the Web
    
    Installation
      ✓ Bin dir           ~\AppData\Local\vite-plus\bin
      ✓ Data dir          ~\AppData\Local\vite-plus\data
      ✓ Cache dir         ~\AppData\Local\vite-plus\cache
      ✓ Config dir        ~\AppData\Roaming\vite-plus
      ✓ State dir         ~\AppData\Local\vite-plus\state
      ✓ Shims             node, npm, npx, pnpm, pnpx, pn, pnx, yarn, yarnpkg, bun, bunx, vpx, vpr
    
    Configuration
      ✓ Node.js           managed mode
      ✓ Package manager   managed mode
    
    PATH
      ✓ vp                ~\AppData\Local\vite-plus\bin\vp.exe
      ✓ Shim dir          ~\AppData\Local\vite-plus\bin
      ✓ node              ~\AppData\Local\vite-plus\bin\node.exe (vp shim)
      ✓ npm               ~\AppData\Local\vite-plus\bin\npm.exe (vp shim)
      ✓ npx               ~\AppData\Local\vite-plus\bin\npx.exe (vp shim)
      ✓ pnpm              ~\AppData\Local\vite-plus\bin\pnpm.exe (vp shim)
      ✓ pnpx              ~\AppData\Local\vite-plus\bin\pnpx.exe (vp shim)
      ✓ pn                ~\AppData\Local\vite-plus\bin\pn.exe (vp shim)
      ✓ pnx               ~\AppData\Local\vite-plus\bin\pnx.exe (vp shim)
      ✓ yarn              ~\AppData\Local\vite-plus\bin\yarn.exe (vp shim)
      ✓ yarnpkg           ~\AppData\Local\vite-plus\bin\yarnpkg.exe (vp shim)
      ✓ bun               ~\AppData\Local\vite-plus\bin\bun.exe (vp shim)
      ✓ bunx              ~\AppData\Local\vite-plus\bin\bunx.exe (vp shim)
      ✓ vpx               ~\AppData\Local\vite-plus\bin\vpx.exe (vp shim)
      ✓ vpr               ~\AppData\Local\vite-plus\bin\vpr.exe (vp shim)
    
    Node.js Resolution
        Directory         D:\Code\Projects\...\...
        Source            lts
        Version           24.21.0
      ✓ Node binary       installed
    
    Package Manager Resolution
        Source            devEngines.packageManager
        Version           bun@1.4.2
      ✓ PM binaries       installed
    
    ✓ All checks passed
    
  21. fengmk2 commented on Oct 6, 2026

    @fengmk2
    Member

    @KiriRainCat #2890 (comment) Can you test on the preview build version?

  22. KiriRainCat commented on Oct 6, 2026

    @KiriRainCat

    @fengmk2 Tested v0.0.0-commit.d49ca2523da185609a018e32e548fb553fb2a30d on Windows + Git Bash with Bun 1.4.2, and it works perfectly now. Thanks for the quick fix!

  23. added a commit that references this issue on Oct 6, 2026
    b639509
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Fields

Priority

None yet

Effort

None yet

Target date

None yet

Start date

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions