fix(login): capture the full claude auth URL on a wide tmux window

Testing the web login surfaced a truncated authorization URL
(…client_id=9d1c250a-e61b-44d9-88) and a "missing redirect_uri" error: the
login session ran at the default 80 columns, so claude clipped the long URL and
capture-pane read it back cut off.

- Launch the login session with a very wide, tall window (500x50) via new
  optional width/height on tmux.new_session, so claude prints the URL on one
  unclipped line.
- Harden URL extraction to stop at box-drawing glyphs (U+2500–U+257F) in case
  the TUI renders the link flush against a border.

Tests: assert the wide window is requested, and that extraction keeps a full
redirect_uri/PKCE URL intact and strips a trailing box border. Suite green (197).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YKVyBmKvWDVgrFC9WER2f2
This commit is contained in:
Claude
2026-07-13 19:19:19 +00:00
parent 32327a18c4
commit 882a071521
4 changed files with 55 additions and 7 deletions
+3 -2
View File
@@ -79,9 +79,10 @@ def fake_tmux(monkeypatch):
from handler.control import tmux
def new_session(name, cwd, command, env):
def new_session(name, cwd, command, env, *, width=None, height=None):
calls["new_session"].append(
{"name": name, "cwd": cwd, "command": command, "env": env}
{"name": name, "cwd": cwd, "command": command, "env": env,
"width": width, "height": height}
)
live.add(name)