diff --git a/.pql/pql-plan.json b/.pql/pql-plan.json index 0e39e917..dfc998bc 100644 --- a/.pql/pql-plan.json +++ b/.pql/pql-plan.json @@ -1,5 +1,5 @@ { - "exported_at": "2026-04-30T20:42:24Z", + "exported_at": "2026-05-01T07:24:10Z", "decisions": [ { "id": "D-1", diff --git a/lib/builtin/claude/src/claude_pane.dart b/lib/builtin/claude/src/claude_pane.dart index c3fe870b..3bf7d8ae 100644 --- a/lib/builtin/claude/src/claude_pane.dart +++ b/lib/builtin/claude/src/claude_pane.dart @@ -52,12 +52,15 @@ class _ClaudePaneState extends State { String _statusLine = 'attaching…'; @override + bool _spawned = false; + void initState() { super.initState(); _terminal = Terminal(maxLines: _maxLines); _terminal.onOutput = _onOutput; _terminal.onResize = _onResize; - WidgetsBinding.instance.addPostFrameCallback((_) => _spawnWhenReady()); + // Don't spawn here — wait for the first onResize from TerminalView + // so the PTY gets real dimensions, not 80x24 defaults. } @override @@ -201,6 +204,12 @@ class _ClaudePaneState extends State { } void _onResize(int cols, int rows, int _, int __) { + if (!_spawned) { + // First resize — TerminalView has real dimensions now. + _spawned = true; + _spawnWhenReady(); + return; + } final id = _paneId; if (id == null) return; _ipc()?.request('pane.resize', args: {'id': id, 'cols': cols, 'rows': rows});