sudo Interaction with Applications That Request Elevation (e.g., Winget)
#123
SamGreenwood1
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone,
With the new Windows
sudocommand now available, I've been thinking about how it's designed to work with applications that already have their own ways of asking for elevation. I'm hoping to get some clarity on the intended interaction model here.The Situation and My Core Question
The Windows
sudocommand is a great addition, allowing us to elevate specific commands directly from an un-elevated terminal.However, many existing command-line applications on Windows, like
winget, are built to request administrative privileges themselves (often triggering a UAC prompt) when they perform actions requiring elevated rights (e.g.,winget installfor system-wide packages).My main question is: How is Windows
sudointended to handle elevation for these types of applications?Specifically, I'm wondering:
sudo winget install <packageID>, issudosupposed to fully elevate thewingetprocess itself, sowingetdoesn't pop up a second UAC prompt?sudo?Why a Smooth Interaction Matters
If
sudocan seamlessly handle the elevation for these applications, it would offer several benefits:sudo) for elevated operations, making the workflow much smoother.sudoworks on other operating systems, which is great for predictability.An Example of Desired Behavior
Ideally, when I type:
...I'd hope that
sudoprovides all the necessary elevation, allowingwingetto proceed with the installation without triggering its own UAC prompt afterward. I'd just interact withsudo's prompt.Looking for Your Insights
I'd really appreciate any technical insights or pointers to documentation regarding
sudo's intended interaction with applications that also request elevation. If anyone has recommendations on patterns for developers to consider for optimalsudocompatibility, that would be incredibly helpful too!Thanks for your time and thoughts!
See discussion I posted to the winget-cli repo here.
Beta Was this translation helpful? Give feedback.
All reactions