From 140043eee8a1cae674c36098f549d3ebb03db67c Mon Sep 17 00:00:00 2001 From: blasty Date: Thu, 23 Jul 2026 23:52:23 +0200 Subject: ux: start the analysis server from inside the TUI (no more dead window) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The remaining "long wait with no feedback" was the launcher's _ensure_server: it started the supervisor and blocked ~10s polling for the port BEFORE the TUI (and its overlay) existed. Only a one-line stderr message covered it. Move that wait behind the overlay. The launcher now only does instant checks (sweep stale locks if the server is down, honor --no-server) and hands the binary straight to the TUI with ensure_server=True. The TUI's _connect starts the server itself and narrates it in the loading overlay ("starting analysis server… (Ns)") before opening/analyzing the binary. idb_open is idempotent, so an already-open session is still adopted instantly (the launcher no longer needs to probe sessions). _ensure_server gained a progress callback so it reports to the overlay instead of stderr (which would corrupt the TUI screen). Verified with the server DOWN: chrome + overlay appear within ~0.5s, notes go "starting analysis server… (0s)" -> "opening echo — analyzing…" -> "echo — 128 functions…" -> land on main. Pilot suite (db/ensure_server=False path) green: startup/palette/view_toggle/disasm_nav/search/rename/follow_xrefs/ decomp_nav/mouse/listing_view/continuous_view/func_banners. --- idatui/app.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'idatui/app.py') diff --git a/idatui/app.py b/idatui/app.py index 462aaf2..6e9388f 100644 --- a/idatui/app.py +++ b/idatui/app.py @@ -2290,12 +2290,13 @@ class IdaTui(App): def __init__(self, url: str, db: str | None, keepalive: bool = True, open_path: str | None = None, rpc_path: str | None = None, - ttl: int = 1800) -> None: + ttl: int = 1800, ensure_server: bool = False) -> None: super().__init__() self._url = url self._db = db self._open_path = open_path self._ttl = ttl + self._ensure_server = ensure_server self._do_keepalive = keepalive self._rpc_path = rpc_path self._rpc = None @@ -2443,6 +2444,17 @@ class IdaTui(App): @work(thread=True, exclusive=True, group="connect") def _connect(self) -> None: try: + if self._ensure_server: + # Start the analysis server here (not in the launcher) so the + # chrome + overlay are already up while we wait for it. + from .launch import _ensure_server as _ensure + if not _ensure(self._url, self._open_path, + progress=lambda m: self.app.call_from_thread( + self._status, m)): + self.app.call_from_thread( + self._status, "could not start the analysis server") + self.app.call_from_thread(self._dismiss_loading) + return client = IDAClient(self._url, db=self._db) client.connect() if self._open_path is not None: -- cgit v1.3.1-sl0p