-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
bugSomething isn't workingSomething isn't workingwindowsSpecific to the Windows platformSpecific to the Windows platform
Description
Summary
uv tool update-shell is updating the PATH in registry, but it seems Windows is not aware it needs to reload the change.
Version: uv 0.9.18 (0cee764 2025-12-16)
Context: Windows 10 22H2
Steps to reproduce
- Ensure
%SYSTEMPROFILE%\.local\binis not already included in%PATH%. - Install any uv tool, like
uv tool install jtbl. - Run
uv tool update-shell. - Open a fresh cmd.exe and try to run the tool, like
jtbl.
Expected result
The tool runs.
Current result
The tool is not found.
Workaround
Before step 4, in Control Panel "System Properties", click "Environment Variables..." then "Ok".
Explanation
uv tool update-shell is updating the PATH in registry, but it seems Windows is not aware it needs to reload the change.
One way to do this is to broadcast WM_SETTINGCHANGE to the system. Here's a PowerShell example that works for me:
$windowBroadcastHandle = [IntPtr]0xffff
$wmSettingChangeMessageId = 0x1A
$environmentChangedParameter = "Environment"
$abortIfHungFlag = 0x0002
Add-Type @"
using System;
using System.Runtime.InteropServices;
public static class NativeMethods
{
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern IntPtr SendMessageTimeout(
IntPtr windowHandle,
int messageId,
IntPtr wParam,
string lParam,
int flags,
int timeoutMilliseconds,
out IntPtr result);
}
"@
[NativeMethods]::SendMessageTimeout(
$windowBroadcastHandle,
$wmSettingChangeMessageId,
[IntPtr]::Zero,
$environmentChangedParameter,
$abortIfHungFlag,
5000,
[ref]([IntPtr]::Zero)
)Platform
Windows 10 22H2
Version
uv 0.9.18 (0cee764 2025-12-16)
Python version
Python 3.14.2
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingwindowsSpecific to the Windows platformSpecific to the Windows platform