diff --git a/Notify/Cli/CliRunner.cs b/Notify/Cli/CliRunner.cs index 982683b..da45c02 100644 --- a/Notify/Cli/CliRunner.cs +++ b/Notify/Cli/CliRunner.cs @@ -99,59 +99,6 @@ public static class CliRunner return 0; } - // 仅用于自测:acttest ,尝试激活指定窗口并把结果写入临时日志 - public static int ActTest(string[] args) - { - if (args.Length < 2 || !long.TryParse(args[1], out var h)) - { - return 1; - } - - var before = Win32.GetForegroundWindow().ToInt64(); - var ok = WindowActivator.Activate(new IntPtr(h)); - var after = Win32.GetForegroundWindow().ToInt64(); - - try - { - System.IO.File.WriteAllText( - System.IO.Path.Combine(System.IO.Path.GetTempPath(), "notify-acttest.log"), - $"target={h} before={before} after={after} ok={ok}\n"); - } - catch - { - // 忽略 - } - - return ok ? 0 : 1; - } - - // 仅用于自测:wttest ,切到该标签后回读当前选中项 - public static int WtTest(string[] args) - { - if (args.Length < 3 || !long.TryParse(args[1], out var h)) - { - return 1; - } - - var hwnd = new IntPtr(h); - var ok = WinTerminalTabs.SelectTab(hwnd, args[2]); - System.Threading.Thread.Sleep(250); - var now = WinTerminalTabs.GetSelectedTabRuntimeId(hwnd); - - try - { - System.IO.File.WriteAllText( - System.IO.Path.Combine(System.IO.Path.GetTempPath(), "notify-wttest.log"), - $"select ok={ok} expected={args[2]} nowSelected={now} match={(now == args[2])}\n"); - } - catch - { - // 忽略 - } - - return ok ? 0 : 1; - } - // SessionEnd:清理会话状态 public static int Cleanup() { diff --git a/Notify/Program.cs b/Notify/Program.cs index d19bd13..ab6e241 100644 --- a/Notify/Program.cs +++ b/Notify/Program.cs @@ -31,8 +31,6 @@ internal static class Program "notify" => CliRunner.Notify(), "input" => CliRunner.Input(), "cleanup" => CliRunner.Cleanup(), - "acttest" => CliRunner.ActTest(args), - "wttest" => CliRunner.WtTest(args), _ => RunHost(args), }; }