Skip to content

Fix Windows/WSL startup and Bash completion stalls#189

Merged
im10furry merged 1 commit into
mainfrom
fix/windows-wsl-startup-bash-completion
Jun 6, 2026
Merged

Fix Windows/WSL startup and Bash completion stalls#189
im10furry merged 1 commit into
mainfrom
fix/windows-wsl-startup-bash-completion

Conversation

@im10furry

@im10furry im10furry commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Fixes #96.

This PR reduces avoidable blocking on the interactive startup path and hardens Bash subprocess handling on Windows/WSL.

Main changes:

  • Move update checking out of the REPL render critical path.
  • Defer GPT-5 profile repair until the first prompt input is ready.
  • Cache parsed global config after \enableConfigs()\ and update the cache after successful saves.
  • Avoid repeated global config reads in \saveGlobalConfig()\ just to preserve \projects.
  • Spawn foreground shell commands with stdin ignored instead of inherited.
  • Use Windows \overlapped\ stdout/stderr pipes for shell subprocesses.
  • Add \KODE_STARTUP_PROFILE-gated timings for config I/O, update checks, query prep, Bash result finalization, and model config saves.
  • Keep CLI flags, output protocols, and command behavior unchanged.

Validation

Automated checks:

  • \run typecheck\
  • \run lint\
  • \ test\
    • 546 pass
    • 8 skip
    • 0 fail
  • \�un run build:npm\

Focused tests added/updated:

  • Config cache behavior
  • Shell stdio selection on Windows/non-Windows
  • Slow Windows-sensitive test timeouts for UNC/LSP checks

Real WSL validation:

  • Environment: WSL 2.6.3, Debian WSL2
  • Verified Windows-side CLI subprocess path executing WSL commands through project \BunShell\ and \BashTool.
  • \wsl -d Debian -- printf ok\
    • cold run about 2.2-2.4s
    • warm runs about 0.2-0.8s
  • \sleep 5 & echo done\ did not wait for the background sleep and did not show a 10s tail.
  • Large stdout (\seq 1 500) returned normally.

Notes

The update banner may now appear after the initial UI render instead of before it. The displayed text is unchanged; only the timing is different so startup is not blocked by npm/registry checks.

…indows/WSL

- Move update checking out of REPL render critical path
- Defer GPT-5 profile repair until first prompt input is ready
- Cache parsed global config after enableConfigs() and update cache after saves
- Avoid repeated global config reads in saveGlobalConfig() to preserve projects
- Spawn foreground shell commands with stdin ignored instead of inherited
- Use Windows overlapped stdout/stderr pipes for shell subprocesses
- Add KODE_STARTUP_PROFILE-gated timings for config I/O, update checks, query prep

Fixes #96
@im10furry im10furry force-pushed the fix/windows-wsl-startup-bash-completion branch from 1a1ed14 to 8de29a6 Compare June 6, 2026 11:26
@im10furry im10furry merged commit 1f82017 into main Jun 6, 2026
3 checks passed
@im10furry im10furry deleted the fix/windows-wsl-startup-bash-completion branch June 6, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kode 在每次执行完命令行或刚启动时卡顿

1 participant