Optimized and improved the code

Optimized and improved the code for killing core processes in non-Windows environments. Now uses a shell script for precise processing.
This commit is contained in:
2dust
2025-07-30 19:52:45 +08:00
parent 6715d7dce6
commit 3d23f3e3a2
9 changed files with 170 additions and 46 deletions

View File

@@ -66,8 +66,7 @@ public partial class SudoPasswordInputView : UserControl
{
// Use sudo echo command to verify password
var arg = new List<string>() { "-c", "sudo -S echo SUDO_CHECK" };
var result = await CliWrap.Cli
.Wrap(Global.LinuxBash)
var result = await CliWrap.Cli.Wrap(Global.LinuxBash)
.WithArguments(arg)
.WithStandardInputPipe(CliWrap.PipeSource.FromString(password))
.ExecuteBufferedAsync();