Skip to content

fix(layout): honor DECCOLM logical widths#340

Merged
forketyfork merged 1 commit into
mainfrom
fix/honor-deccolm-logical-widths
Jul 5, 2026
Merged

fix(layout): honor DECCOLM logical widths#340
forketyfork merged 1 commit into
mainfrom
fix/honor-deccolm-logical-widths

Conversation

@forketyfork

@forketyfork forketyfork commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Solution

vttest enables DEC mode 40, switches to 80-column DECCOLM, and then draws part of the cursor movement border by relying on cursor-forward clamping at the right edge. Architect delegated that sequence to ghostty-vt, but the next layout pass treated the 80-column model as stale and resized it back to the current tile or window width. That made the lower plus border start too far to the right.

This keeps ghostty-vt's 80/132-column logical width while Architect's own layout target is unchanged. Window, font, grid, and full/grid changes still reset the terminal to the computed size, so normal reflow behavior remains intact. The resize policy now has regression coverage for preserved DECCOLM widths, reset on a real layout change, and correction of ordinary terminal-width drift.

Test plan

  • Run vttest "Test of cursor movements" in Architect and confirm the lower + border aligns with the upper one in the 80-column pass.
  • Resize the Architect window after the test and confirm the terminal reflows to the current window/grid size.

Issue: vttest cursor movement screens drew the lower plus border shifted because Architect resized ghostty-vt back to the window-derived width immediately after DECCOLM selected 80-column mode.

Solution: Preserve ghostty-vt's 80/132-column logical width when DEC mode 40 is enabled and Architect's layout target is unchanged. Reset to the computed grid or full size on real layout changes so window, font, and grid resizes still reflow normally.
@forketyfork forketyfork requested a review from Copilot July 5, 2026 05:15
@forketyfork forketyfork marked this pull request as ready for review July 5, 2026 05:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a layout/terminal-model interaction where applications using DECCOLM (80/132-column mode) could have their ghostty-vt logical width incorrectly “corrected” back to the current tile/window target width on the next layout pass, causing cursor-movement drawing (e.g., vttest borders) to misalign.

Changes:

  • Preserve ghostty-vt’s 80/132-column logical width when DECCOLM mode is active and Architect’s computed winsize target is unchanged.
  • Add regression tests covering (1) preserving DECCOLM width, (2) resetting to layout width on real layout changes, and (3) correcting ordinary non-DECCOLM width drift.
  • Document DECCOLM support in the README and describe the resize policy behavior in the architecture docs.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/app/layout.zig Avoids resizing the terminal model when DECCOLM is active and the PTY/layout target hasn’t changed; adds focused regression tests for the new policy.
README.md Notes VT-compatible DECCOLM (80/132-column) mode handling as a supported feature.
docs/ARCHITECTURE.md Documents the updated terminal resize behavior, including DECCOLM logical-width preservation and reset conditions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@forketyfork forketyfork merged commit 2a2c604 into main Jul 5, 2026
5 checks passed
@forketyfork forketyfork deleted the fix/honor-deccolm-logical-widths branch July 5, 2026 05:19

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 82588cfdf6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/app/layout.zig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants