Vector35 / Vector35/binaryninja-api

`interaction.TextLineField` has broken `default=` semantics in CLI

Open
#6,695 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: API Effort: Trivial Impact: Low
Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

Version and Platform (required):

  • Binary Ninja Version: 5.0.7280-test Ultimate (9ef1367f)
  • OS: Debian
  • OS Version: trixie
  • CPU Architecture: x64

Bug Description:
In the GUI, the default value is pre-filled in the field, which works out.

In the CLI, it is never used no matter how the API is called.

Steps To Reproduce:

>>> import binaryninja
>>> binaryninja.get_form_input([f := binaryninja.TextLineField("Type:", default="AAA")], ""); f.result
Type: 123
'123'
>>> binaryninja.get_form_input([f := binaryninja.TextLineField("Type:", default="AAA")], ""); f.result
Type: 
''

Expected Behavior:
One of:

  1. Default value is pre-filled and can be erased by pressing Backspace.
  2. Default value is returned when no input is entered. (While this makes entering an empty string impossible, it's easier to work around that than around lack of default values.)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior with binaryninja.TextLineField and binaryninja.get_form_input in the CLI, using the examples in the issue. Trace the CLI handling of the default value and compare it with the GUI behavior. Done means the documented default semantics work consistently and the reported empty-input cases are covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
api, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.