mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
Fix leave open option for cmd plugin
Add "Wait for a key press before closing" option. See #141 for more info.
This commit is contained in:
@@ -143,8 +143,12 @@ namespace Wox.Plugin.CMD
|
||||
|
||||
private void ExecuteCmd(string cmd, bool runAsAdministrator = false)
|
||||
{
|
||||
if (context.API.ShellRun(cmd, runAsAdministrator))
|
||||
var fullCmd = CMDStorage.Instance.LeaveCmdOpen ? $"cmd /k \"{cmd}\" & pause & exit" : cmd;
|
||||
var success = context.API.ShellRun(fullCmd, runAsAdministrator);
|
||||
if (success)
|
||||
{
|
||||
CMDStorage.Instance.AddCmdHistory(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
public void Init(PluginInitContext context)
|
||||
|
||||
Reference in New Issue
Block a user