diff options
| author | blasty <blasty@local> | 2026-07-23 23:34:22 +0200 |
|---|---|---|
| committer | blasty <blasty@local> | 2026-07-23 23:34:22 +0200 |
| commit | 8e6dfbf33eede528aaf60769364e060b49ac539e (patch) | |
| tree | bfc68e727538d8fc5a6efb780c063deb4f0a4e0b /idatui/launch.py | |
| parent | fix: keep the pseudocode cursor/scroll when a rename re-decompiles (diff) | |
| download | ida-tui-8e6dfbf33eede528aaf60769364e060b49ac539e.tar.gz ida-tui-8e6dfbf33eede528aaf60769364e060b49ac539e.tar.xz ida-tui-8e6dfbf33eede528aaf60769364e060b49ac539e.zip | |
ux: show TUI chrome + a "loading…" overlay during binary open/analysis
Two parts:
1) A LoadingScreen modal is pushed on mount and dismissed once we land on a
function (or the symbol picker). Its note line mirrors _status, so you see
"opening… analyzing", then "N functions…", instead of staring at empty panes.
Esc hides it if you'd rather watch the status bar.
2) The real fix for the dead air BEFORE the TUI drew anything: the launcher used
to block on idb_open (full analysis of a big binary) *before* starting the
TUI, so the overlay only flashed after the wait was already over. Now the
launcher only adopts an already-open session (instant); otherwise it defers
the open to the TUI via open_path, and _connect does idb_open (with the
crashed-worker lock-sweep + retry moved here) while the chrome + overlay are
on screen. Added a ttl arg to IdaTui for the deferred open.
Verified: overlay pushed on mount, present through open+function-load, dismissed
on landing; TUI-driven open (open_path, db=None) opens echo and lands on main
with notes "opening echo — analyzing…" -> "echo — 128 functions…"; startup/
palette/view_toggle/disasm_nav/search/rename/follow_xrefs/decomp_nav/mouse/
listing_view/continuous_view/func_banners green.
Diffstat (limited to 'idatui/launch.py')
| -rw-r--r-- | idatui/launch.py | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/idatui/launch.py b/idatui/launch.py index c585668..b02bf05 100644 --- a/idatui/launch.py +++ b/idatui/launch.py @@ -202,21 +202,28 @@ def main(argv: list[str] | None = None) -> int: _log("supervisor is down and --no-server was given") return 1 - # 2) resolve the session (open/adopt the binary, or use --db / the sole one) + # 2) resolve the session. If a session is already open on this binary, adopt + # it (instant). Otherwise DON'T open here — defer the (possibly long) + # analysis to the TUI so its chrome + "loading…" overlay are on screen + # during the wait, instead of a blank terminal before the TUI even starts. db = args.db - if binary is not None: + open_path = None + if binary is not None and db is None: try: client = IDAClient(args.url) client.connect() - db = _open_binary(client, binary, args.ttl) - except IDAError as e: - _log(f"could not open {binary}: {e}") - return 1 + db = _existing_session(client, binary) + except Exception: # noqa: BLE001 -- probe only; the TUI will open it + db = None finally: try: client.close() except Exception: # noqa: BLE001 pass + if db: + _log(f"adopting the open session for {os.path.basename(binary)} ({db})") + else: + open_path = binary # TUI opens it with the loading overlay up # 3) hand off to the TUI (imported late so --help works without textual) try: @@ -225,8 +232,8 @@ def main(argv: list[str] | None = None) -> int: _log(f"the TUI needs textual; run with ~/ida-venv/bin/python ({e})") return 1 rpc_path = os.path.abspath(os.path.expanduser(args.rpc)) if args.rpc else None - IdaTui(url=args.url, db=db, keepalive=not args.no_keepalive, - rpc_path=rpc_path).run() + IdaTui(url=args.url, db=db, open_path=open_path, ttl=args.ttl, + keepalive=not args.no_keepalive, rpc_path=rpc_path).run() return 0 |
