Skip to content

Refresh Windows PATH for Hyper CLI session#8172

Open
alokshukla631 wants to merge 1 commit intovercel:canaryfrom
alokshukla631:fix/windows-cli-path-refresh
Open

Refresh Windows PATH for Hyper CLI session#8172
alokshukla631 wants to merge 1 commit intovercel:canaryfrom
alokshukla631:fix/windows-cli-path-refresh

Conversation

@alokshukla631
Copy link
Copy Markdown

Summary

  • refresh Hyper's in-process Windows PATH after updating the user PATH registry entry
  • keep removing stale legacy Hyper paths before appending the current CLI bin path
  • add focused unit coverage for the PATH refresh logic

Why

Fixes #2823.

Updating the user PATH registry entry does not refresh the environment of the already-running Hyper process. As a result, the first Hyper session after install can still fail to resolve hyper until Windows reloads environment variables.

This change keeps the registry update, then refreshes Hyper's current process PATH so new shells spawned by Hyper can use the CLI immediately. Other terminal apps may still need to restart to pick up the registry change.

Testing

  • corepack yarn ava test/unit/cli-install.test.ts
  • corepack yarn eslint app/utils/cli-install.ts app/utils/windows-path.ts test/unit/cli-install.test.ts
  • corepack yarn test:unit

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.

Add Hyper CLI to user PATH without reboot needing

1 participant