Vector35 / binaryninja-api

Public API, examples, documentation and issues for Binary Ninja
https://binary.ninja/
MIT License
927 stars 209 forks source link

"Select None" Not Working #5866

Closed utkonos closed 1 month ago

utkonos commented 2 months ago

Version and Platform (required):

Bug Description: The "Select None" entry in the "Edit" menu does not clear the selected instruction when in Linear View. Also, if you have a particular token selected in the Graph View and then use "Select None" the selection of a particular instruction is cleared, but the selection of a particular token remains. Look at the screenshots below to see that the behavior in Linear and the behavior in Graph are both working incorrectly in opposite ways.

Steps To Reproduce:

  1. Set Linear View
  2. Select any instruction line
  3. In the Edit menu click "Select None"
  4. Notice instruction still selected
  5. Change to Graph View
  6. Select one token (eax for example)
  7. In the Edit menu click "Select None"
  8. Notice cleared instruction but remaining token is selected.

Expected Behavior: All selected entities in the view will be unselected

Screenshots/Video Recording: Before:

image

After Select None:

image

Before:

image

After Select None:

image
xusheng6 commented 2 months ago

Btw, I am just curious -- what actually prompts you to use the ""Select None" action? Normally I would think one can do it by just clicking at a location where there is nothing to achieve the same goal

utkonos commented 2 months ago

Clean screenshots of your beautiful UI. Both of those views, when using Select None, leave at least one UI element still selected. And, yes, clicking somewhere else is one workaround, but isn't a workaround for small functions where there isn't anywhere off-screen that one can click.

fuzyll commented 2 months ago

A better workaround might be to use Select None from the command palette (Cmd-P), which appears to work correctly in linear view.

utkonos commented 2 months ago

@fuzyll Command pallete does the same thing. At least on macos. are you testing on macos?

https://github.com/user-attachments/assets/12f474b4-b141-4395-8db7-1e9a7571a8b3

fuzyll commented 2 months ago

Oh, I understand now. No, you are correct, it also doesn't work. It removes all of the selections except for the current line in linear view. I misread what you were saying earlier.

utkonos commented 2 months ago

Yes, and interestingly, Graph and Linear have opposite behaviors. Select None leaves the instruction selected or leaves the token selected depending on which view you're looking at.

fuzyll commented 1 month ago

Forgot to update this, but I believe Graph View should be fixed as of builds >= 4.2.6025-dev. Linear View was not quite as easy and I haven't finished fixing that yet.

fuzyll commented 1 month ago

Should be fixed in builds >= 4.2.6105-dev. I had made two changes to linear view earlier, which cancelled each other out. Making just one of them was more successful. 🙂