PowerToys: [PT run] Initial selection is not consistent and sometimes even incorrect

Microsoft PowerToys version

0.45.0

Running as admin

  • Yes

Area(s) with issue?

PowerToys Run

Steps to reproduce

Inconsistent selection highlighting

I have no 1:1 reproduction steps as this behavior is most probably highly dependant on the indexed files & search history but I can explain what happens:

When typing something, most of the time the first entry in the result list is highlighted so that I know at one glance that this will be executed when pressing enter without moving the selection at all. However, sometimes nothing is selected:

https://user-images.githubusercontent.com/30658772/133963383-e5a3e183-4d5f-49c3-bc5f-c484bde6f236.mp4

As you can see in this video:

  • ✅ When searching for fire, the first entry is selected.
  • ❌ When searching for finan, the first entry is not selected as expected. However, when pressing enter in this state, the first entry is still executed.

Incorrect selection highlighting

Sometimes it even happens, that the wrong entry is selected:

https://user-images.githubusercontent.com/30658772/133963867-6998278a-16f0-4169-8233-890e6181d366.mp4

Here, I only typed fin and did not move the selection, however, it is still the second entry which is highlighted. What is even more confusing then: When I press enter in the shown state, the first entry FinanceControl gets executed, not the highlighted one 🤷‍♂️

✔️ Expected Behavior

  • Always highlight the first entry after typing
  • Always execute the item which is highlighted when pressing enter

❌ Actual Behavior

  • Sometimes no entry is highlighted at all
  • Sometimes incorrect entry is highlighted

Other Software

No response

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 4
  • Comments: 15 (2 by maintainers)

Most upvoted comments

I’m still having this problem which is really annoying in combination with stuff like this TBH.

However, I think this is now easier to reproduce with the “Global sort order score modifier”:

  • Set Global sort order score modifier of Windows Search plugin to some very large number. E.g. 200 did the trick for me.
  • Search for something which yields results from both plugins Windows Search & Program
  • The result from the Windows Search plugin is shown first in list ✅, but the first one from Program is actually selected 🔥

https://user-images.githubusercontent.com/30658772/196896393-6cd72557-b5d4-4c3a-92c5-82d5ca317387.mp4

FYI, like I also stated in #12856 multiple times: I literally never started the Groove Music app from PT run, whilst I run Show Music Tab.exe on an almost daily basis which makes it really annoying that the Groove Music app is always selected first when searching for music…

@htcfreek, I believe this is because of the addition of calculator in global results in the settings. The calculator engine throws an exception so we catch and log it, but I assume it’s an expected exception in this case. I don’t think issues are needed for these, we’re mostly just logging everything.