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:
bao-qian
2015-12-14 00:29:13 +00:00
parent 3beebd42a8
commit e40c1ff09e

View File

@@ -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)