debounce terminal resize, add SIGWINCH, remove padding
test / unit + widget + golden + a11y (push) Failing after 28s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped

Rapid resize during window drag sends many SIGWINCH signals causing
the shell to redraw repeatedly, corrupting xterm's render. Debounce
to 150ms so only the final size is sent.

NativePty.resize now explicitly sends SIGWINCH (signal 28) after
TIOCSWINSZ, matching the legacy Python implementation.

Removed 8px padding from ClidePtyView to eliminate potential
dimension mismatch between widget size and PTY cols/rows.

Default window size increased to 1600x900.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jeroen Schweitzer
2026-05-01 11:40:12 +02:00
co-authored by Claude Opus 4.6
parent 6f12c884cd
commit 2f7435f271
5 changed files with 18 additions and 6 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
{
"exported_at": "2026-05-01T07:24:10Z",
"exported_at": "2026-05-01T09:40:12Z",
"decisions": [
{
"id": "D-1",
+11 -3
View File
@@ -65,6 +65,7 @@ class _ClaudePaneState extends State<ClaudePane> {
@override
void dispose() {
_resizeTimer?.cancel();
_eventSub?.cancel();
_eventSub = null;
final id = _paneId;
@@ -203,6 +204,8 @@ class _ClaudePaneState extends State<ClaudePane> {
_ipc()?.request('pane.write', args: {'id': id, 'text': text});
}
Timer? _resizeTimer;
void _onResize(int cols, int rows, int _, int __) {
if (!_spawned) {
// First resize — TerminalView has real dimensions now.
@@ -210,9 +213,14 @@ class _ClaudePaneState extends State<ClaudePane> {
_spawnWhenReady();
return;
}
final id = _paneId;
if (id == null) return;
_ipc()?.request('pane.resize', args: {'id': id, 'cols': cols, 'rows': rows});
// Debounce resize — rapid SIGWINCH during window drag corrupts
// the terminal rendering. Wait for the resize to settle.
_resizeTimer?.cancel();
_resizeTimer = Timer(const Duration(milliseconds: 150), () {
final id = _paneId;
if (id == null) return;
_ipc()?.request('pane.resize', args: {'id': id, 'cols': cols, 'rows': rows});
});
}
DaemonClient? _ipc() => _kernel()?.ipc;
+4
View File
@@ -278,6 +278,10 @@ class NativePty {
..ref.wsCol = cols;
_ioctl(_fd, _kTiocsWinsz, ws);
calloc.free(ws);
// Explicitly signal the child to re-query its terminal size.
// macOS should auto-send SIGWINCH on TIOCSWINSZ, but the legacy
// Python implementation sent it explicitly for reliability.
_nativeKill(pid, 28); // SIGWINCH = 28 on macOS/Linux
}
/// Send a signal to the child.
+1 -1
View File
@@ -54,7 +54,7 @@ class ClidePtyView extends StatelessWidget {
fontFamily: clideMonoFamily,
fontFamilyFallback: clideMonoFamilyFallback,
),
padding: const EdgeInsets.all(8),
padding: EdgeInsets.zero,
backgroundOpacity: 1,
cursorType: TerminalCursorType.block,
),
+1 -1
View File
@@ -332,7 +332,7 @@
</menu>
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="335" y="390" width="1280" height="720"/>
<rect key="contentRect" x="200" y="200" width="1600" height="900"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1577"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="1280" height="720"/>