Skip to content

Commit 969190f

Browse files
aarondfrancisclaude
andcommitted
Fix interactive mode garbling and login shell PATH conflict
The diff renderer was not invalidated when entering/exiting interactive mode, causing the cell buffer to get out of sync when the frame layout changed (different box style, hotkeys). Force a full redraw on mode transitions. Also switch from bash -lc to bash -c for subprocess execution. Login shell initialization can reorder PATH and shadow the user's preferred PHP binary (e.g. Herd) with a system install. The subprocess already inherits the correct environment from the parent process. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8dc46c8 commit 969190f

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/Commands/Concerns/ManagesProcess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ protected function buildCommandArray(Screen $screen): array
170170
'exec ' . $this->command,
171171
]);
172172

173-
return ['bash', '-lc', $built];
173+
return ['bash', '-c', $built];
174174
}
175175

176176
protected function localeEnvironmentVariables(): string

src/Prompt/Dashboard.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,13 @@ public function enterInteractiveMode(): void
269269
}
270270

271271
$this->currentCommand()->setMode(Command::MODE_INTERACTIVE);
272+
$this->diffRenderer?->invalidate();
272273
}
273274

274275
public function exitInteractiveMode(): void
275276
{
276277
$this->currentCommand()->setMode(Command::MODE_PASSIVE);
278+
$this->diffRenderer?->invalidate();
277279
}
278280

279281
public function selectTab(int $index): void

tests/Unit/ManagesProcessTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function buildWithDimensions(): array
3131
$result = $command->buildWithDimensions();
3232

3333
$this->assertSame('bash', $result['built'][0]);
34-
$this->assertSame('-lc', $result['built'][1]);
34+
$this->assertSame('-c', $result['built'][1]);
3535
$this->assertStringContainsString(
3636
sprintf('stty cols %d rows %d', $result['width'], $result['height']),
3737
$result['built'][2]

0 commit comments

Comments
 (0)