-
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
1,158 additions
and
1,577 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
#sidebar_position: 6 | ||
title: Force elevation in new window | ||
#hide_title: true | ||
--- | ||
|
||
As mentioned in [Security Considerations](../security.md#what-are-the-risks-of-running-gsudo), elevation in the same console exposes a mild risk. You can avoid it altogether by elevating in a new console window, for example by adding the `--new` or `-n` switch. | ||
|
||
In gsudo v2, a new setting was introduced to force elevations in a new window. To enable it simply run: | ||
|
||
``` powershell | ||
gsudo config NewWindow.Force true | ||
``` | ||
|
||
The problem with this approach is that some elevations complete too quickly and the new window may close abruptly. So to leave time to verify the window result, combine it with one of the following new switches: | ||
|
||
- `--KeepWindow`: After running a command in a new console, ask for keypress before closing the console/window. | ||
- `--KeepShell`: After running a command, keep the elevated shell open. | ||
|
||
You set one of those switches permanently by using the following setting: | ||
|
||
``` powershell | ||
gsudo config NewWindow.CloseBehaviour [ KeepShellOpen | PressKeyToClose | OsDefault ] | ||
``` | ||
|
||
Valid values are: | ||
- **KeepShellOpen**: Forces `--keepShell`. Keep the elevated shell open after running the command. | ||
![KeepShellOpen](../static/img/../../../static/img/NewWindow.CloseBehaviour.KeepShellOpen.png) | ||
|
||
- **PressKeyToClose**: Forces `--keepWindow`. Asks for a keypress before closing the window. | ||
![PressKeyToClose](../static/img/../../../static/img/NewWindow.CloseBehaviour.PressKeyToClose.png) | ||
|
||
- **OsDefault**: (default) Launch the command and let the operating system close it or keep it according to the system defaults (typically the window will close). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.