Before submitting
Problem
The Gentle Changes viewer renders modified (M) files with corrupted columns and vertical separators in Windows Terminal. Added (A) files render normally. This makes the diff difficult to read and inspect.
Steps to reproduce
-
Use Windows Terminal 1.24.11911.0 with PowerShell.
-
Start Pi 0.87.1 with npm:gentle-pi@3.5.1 enabled in a Git repository.
-
Create or edit an existing text file so that it is modified (M) and contains tab-indented or mixed-content lines. For a deterministic case, modify an existing file containing lines such as:
-
Press Alt+G to open Gentle Changes.
-
Expand the worktree and select the modified file.
The issue is specific to the modified-file diff path; newly added (A) files do not show the same corruption.
Expected behavior
The selected diff should render as a readable, width-constrained two-pane view. Frame borders, separators, indentation, and added/removed lines should remain aligned with the terminal columns.
Actual behavior
The modified-file diff shows displaced text, broken alignment, and vertical frame artifacts across the pane. Lines containing tabs/control characters can cause terminal tab expansion to disagree with the TUI width calculation. The same view is readable for added files.
Environment
- gentle-pi: 3.5.1
- Pi: 0.87.1
- Operating system: Windows 11
- Terminal: Windows Terminal 1.24.11911.0
- Shell: PowerShell
Relevant logs or error output
No runtime exception or error is shown. This is a visual rendering/layout failure. A screenshot demonstrating the issue is available in the original reproduction context.
Suspected cause
lib/shell-changes-view.ts passes diff lines containing tabs/control characters into width-constrained rendering. Normalizing those characters before visibleWidth/truncateToWidth avoids the mismatch.
Proposed fix
Sanitize each diff line and expand tabs before classification/rendering, with regression coverage for tabbed CRLF modified diffs. A local validation run passes 32 focused shell-changes-view tests.
Before submitting
Problem
The Gentle Changes viewer renders modified (
M) files with corrupted columns and vertical separators in Windows Terminal. Added (A) files render normally. This makes the diff difficult to read and inspect.Steps to reproduce
Use Windows Terminal 1.24.11911.0 with PowerShell.
Start Pi 0.87.1 with
npm:gentle-pi@3.5.1enabled in a Git repository.Create or edit an existing text file so that it is modified (
M) and contains tab-indented or mixed-content lines. For a deterministic case, modify an existing file containing lines such as:Press
Alt+Gto open Gentle Changes.Expand the worktree and select the modified file.
The issue is specific to the modified-file diff path; newly added (
A) files do not show the same corruption.Expected behavior
The selected diff should render as a readable, width-constrained two-pane view. Frame borders, separators, indentation, and added/removed lines should remain aligned with the terminal columns.
Actual behavior
The modified-file diff shows displaced text, broken alignment, and vertical frame artifacts across the pane. Lines containing tabs/control characters can cause terminal tab expansion to disagree with the TUI width calculation. The same view is readable for added files.
Environment
Relevant logs or error output
No runtime exception or error is shown. This is a visual rendering/layout failure. A screenshot demonstrating the issue is available in the original reproduction context.
Suspected cause
lib/shell-changes-view.tspasses diff lines containing tabs/control characters into width-constrained rendering. Normalizing those characters beforevisibleWidth/truncateToWidthavoids the mismatch.Proposed fix
Sanitize each diff line and expand tabs before classification/rendering, with regression coverage for tabbed CRLF modified diffs. A local validation run passes 32 focused
shell-changes-viewtests.