mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
- added option to open Wox Settings from the tray menu
- added a checkbox option specifying whether to leave the command line open after having run a command like >ping google.com
This commit is contained in:
@@ -68,6 +68,9 @@ namespace Wox.Infrastructure.Storage.UserSettings
|
||||
[JsonProperty]
|
||||
public OpacityMode OpacityMode { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
public bool LeaveCmdOpen { get; set; }
|
||||
|
||||
public List<WebSearch> LoadDefaultWebSearches()
|
||||
{
|
||||
List<WebSearch> webSearches = new List<WebSearch>();
|
||||
@@ -137,7 +140,8 @@ namespace Wox.Infrastructure.Storage.UserSettings
|
||||
QueryBoxFont = FontFamily.GenericSansSerif.Name;
|
||||
ResultItemFont = FontFamily.GenericSansSerif.Name;
|
||||
Opacity = 1;
|
||||
OpacityMode = OpacityMode.Normal;
|
||||
OpacityMode = OpacityMode.Normal;
|
||||
LeaveCmdOpen = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.IO;
|
||||
using Wox.Infrastructure.Storage.UserSettings;
|
||||
|
||||
namespace Wox.Infrastructure
|
||||
{
|
||||
@@ -102,7 +103,21 @@ namespace Wox.Infrastructure
|
||||
startDir = dir;
|
||||
}
|
||||
|
||||
global::System.Diagnostics.ProcessStartInfo startInfo = new global::System.Diagnostics.ProcessStartInfo();
|
||||
if (UserSettingStorage.Instance.LeaveCmdOpen)
|
||||
{
|
||||
string cmdExe;
|
||||
string dummy;
|
||||
EvaluateSystemAndUserCommandLine("cmd.exe", startDir, out cmdExe, out dummy, dwSeclFlags);
|
||||
|
||||
// check whether user typed >cmd, because we don't want to create 2 nested shells
|
||||
if (cmdExe != cmd)
|
||||
{
|
||||
args = string.Format("/k {0} {1}", cmd, args);
|
||||
cmd = cmdExe;
|
||||
}
|
||||
}
|
||||
|
||||
global::System.Diagnostics.ProcessStartInfo startInfo = new global::System.Diagnostics.ProcessStartInfo();
|
||||
startInfo.UseShellExecute = true;
|
||||
startInfo.Arguments = args;
|
||||
startInfo.FileName = cmd;
|
||||
|
||||
Reference in New Issue
Block a user