Daydreamer-riri / PowerToys-Run-WebSearchShortcut

This is a simple PowerToys Run plugin for quickly select a specific search engine to perform searches.
MIT License
115 stars 9 forks source link

Issue with PowerToys-Run-WebSearchShortcut #23

Open DinMon opened 1 month ago

DinMon commented 1 month ago

PowerToys-Run-WebSearchShortcut seems to be an extension of the official Web Search of PowerToys. Therefore, if you to do have Web Search on, WebSearchShortcut will crash with the below stack trace.

Version: 0.82.1.0 OS Version: Microsoft Windows NT 10.0.22621.0 IntPtr Length: 8 x64: True Date: 22/07/2024 1:51:07 PM Exception: System.InvalidOperationException: Cannot start process because a file name has not been provided. at System.Diagnostics.Process.Start() at Wox.Infrastructure.Helper.OpenInShell(String path, String arguments, String workingDir, ShellRunAsType runAs, Boolean runWithHiddenWindow) at Wox.Infrastructure.Helper.OpenCommandInShell(String path, String pattern, String arguments, String workingDir, ShellRunAsType runAs, Boolean runWithHiddenWindow) at Community.PowerToys.Run.Plugin.WebSearchShortcut.Main.OpenInBrowser(String url) at Community.PowerToys.Run.Plugin.WebSearchShortcut.Main.<>cDisplayClass43_0.b_0(ActionContext ) at PowerLauncher.ViewModel.MainViewModel.<>cDisplayClass31_0.b0() at System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout) at System.Windows.Threading.Dispatcher.Invoke(Action callback) at PowerLauncher.ViewModel.MainViewModel.OpenResultsEvent(Object index, Boolean isMouseClick) at PowerLauncher.ViewModel.MainViewModel.b32_10(Object index) at PowerLauncher.ViewModel.RelayCommand.Execute(Object parameter) at System.Windows.Input.CommandManager.TranslateInput(IInputElement targetElement, InputEventArgs inputEventArgs) at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey) at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled) at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers) at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

To resolve the issue make sure official PowerToys Web Search is enabled.

Vurmiraaz commented 1 month ago

@DinMon Thanks! Solved my problem.

Daydreamer-riri commented 1 month ago

‌‌Thank you for reporting this issue. I will look into it, and in the meantime, I should note this in the documentation.

DinMon commented 1 month ago

No worries. I also forget to mention that for the official Web Search of PowerToys a 'Direct activation command' needs to be set up and probably should not conflict with the one of PowerToys Run WebSearchShortcut.

Daydreamer-riri commented 1 month ago

On my computer I can disable web search and use the web search shortcut just fine. I'll try to find a computer that can reproduce the issue.

DinMon commented 1 month ago

Replication Steps for PowerToys Run WebSearchShortcut Issue

To replicate the issue where the PowerToys Run WebSearchShortcut crashes when the official Web Search is enabled, follow these steps:

Step 1: Disable Web Search

  1. Open PowerToys.
  2. Navigate to PowerToys Run.
  3. Go to the Plugins section.
  4. Locate the Web Search settings and toggle the Web Search option to Disabled.

Step 2: Close PowerToys Completely

You can choose one of the following methods:

Option A: Kill the Process Using Task Manager

  1. Open Task Manager:
    • Right-click on the Taskbar and select Task Manager or press Ctrl + Shift + Esc.
  2. Locate PowerToys.Runner:
    • In the Processes tab, find PowerToys.Runner.
  3. End the Process:
    • Right-click on PowerToys.Runner and select End Task.
  4. Verify Closure:
    • Ensure that the PowerToys.Runner process is no longer listed in the Task Manager.

Option B: Restart Your Computer

  1. Click on the Start menu.
  2. Select Power and then choose Restart.

Step 3: Test the WebSearchShortcut

  1. After killing the process or restarting your computer, attempt to use the WebSearchShortcut.
  2. Observe if the shortcut functions correctly without crashing.
DinMon commented 1 month ago

Sorry closing it was a mistake.

Vurmiraaz commented 1 month ago

2024-07-23.txt Still crashes if I disable Web Search (after restarting Powertoys of course). Crash log may shed some light on the issue.