mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Improve code quality
This commit is contained in:
parent
07f440768e
commit
89214fb58a
1 changed files with 10 additions and 4 deletions
|
|
@ -200,6 +200,7 @@ namespace Flow.Launcher.Plugin.Shell
|
|||
WorkingDirectory = workingDirectory,
|
||||
};
|
||||
var notifyStr = Context.API.GetTranslation("flowlauncher_plugin_cmd_press_any_key_to_close");
|
||||
var addedCharacter = _settings.UseWindowsTerminal ? "\\" : "";
|
||||
switch (_settings.Shell)
|
||||
{
|
||||
case Shell.Cmd:
|
||||
|
|
@ -213,9 +214,16 @@ namespace Flow.Launcher.Plugin.Shell
|
|||
{
|
||||
info.FileName = "cmd.exe";
|
||||
}
|
||||
|
||||
if (_settings.LeaveShellOpen)
|
||||
{
|
||||
info.ArgumentList.Add("/k");
|
||||
}
|
||||
else
|
||||
{
|
||||
info.ArgumentList.Add("/c");
|
||||
}
|
||||
info.ArgumentList.Add(
|
||||
$"{(_settings.LeaveShellOpen ? "/k" : "/c")} {command}" +
|
||||
$"{command}" +
|
||||
$"{(_settings.CloseShellAfterPress ?
|
||||
$" && echo {notifyStr} && pause > nul /c" :
|
||||
"")}");
|
||||
|
|
@ -226,7 +234,6 @@ namespace Flow.Launcher.Plugin.Shell
|
|||
{
|
||||
// Using just a ; doesn't work with wt, as it's used to create a new tab for the terminal window
|
||||
// \\ must be escaped for it to work properly, or breaking it into multiple arguments
|
||||
var addedCharacter = _settings.UseWindowsTerminal ? "\\" : "";
|
||||
if (_settings.UseWindowsTerminal)
|
||||
{
|
||||
info.FileName = "wt.exe";
|
||||
|
|
@ -257,7 +264,6 @@ namespace Flow.Launcher.Plugin.Shell
|
|||
{
|
||||
// Using just a ; doesn't work with wt, as it's used to create a new tab for the terminal window
|
||||
// \\ must be escaped for it to work properly, or breaking it into multiple arguments
|
||||
var addedCharacter = _settings.UseWindowsTerminal ? "\\" : "";
|
||||
if (_settings.UseWindowsTerminal)
|
||||
{
|
||||
info.FileName = "wt.exe";
|
||||
|
|
|
|||
Loading…
Reference in a new issue