-
Notifications
You must be signed in to change notification settings - Fork 23
Disable terminal reflow during resize for cmux stability #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2726,8 +2726,13 @@ pub fn resize( | |
| try primary.resize(.{ | ||
| .cols = cols, | ||
| .rows = rows, | ||
| .reflow = self.modes.get(.wraparound), | ||
| .prompt_redraw = self.flags.shell_redraws_prompt, | ||
| // cmux: preserve terminal content stability across aggressive pane | ||
| // resize churn (especially for SSH-driven shells). Prefer tmux-style | ||
| // no-reflow semantics over potential history loss. | ||
| .reflow = false, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This hardcoded Consider either:
|
||
| // cmux: prompt redraw on resize can blank substantial history under | ||
| // repeated split-resize churn. Preserve scrollback over prompt cleanup. | ||
| .prompt_redraw = .false, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Setting Useful? React with 👍 / 👎.
Comment on lines
+2729
to
+2735
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for cmux-related build options and reflow/prompt_redraw patterns
rg -n "cmux|resize_no_reflow|prompt_redraw.*reflow" src/Repository: manaflow-ai/ghostty Length of output: 277 🏁 Script executed: #!/bin/bash
# Check for build options file structure
fd -t f "build" . --max-depth 3 | head -20Repository: manaflow-ai/ghostty Length of output: 631 🏁 Script executed: #!/bin/bash
# Examine the full context of the resize function around lines 2729-2735
cat -n src/terminal/Terminal.zig | sed -n '2700,2750p'Repository: manaflow-ai/ghostty Length of output: 1955 🏁 Script executed: #!/bin/bash
# Search for resize tests or test patterns
rg -n "test.*resize|resize.*test" src/terminal/Terminal.zig | head -10Repository: manaflow-ai/ghostty Length of output: 696 🏁 Script executed: #!/bin/bash
# Check build.zig for cmux-related options
cat -n build.zig | grep -i "cmux\|option" | head -30Repository: manaflow-ai/ghostty Length of output: 262 🏁 Script executed: #!/bin/bash
# Look for build_options import or usage in Terminal.zig
rg -n "build_options|@import.*build" src/terminal/Terminal.zig | head -10Repository: manaflow-ai/ghostty Length of output: 663 🏁 Script executed: #!/bin/bash
# Examine the actual reflow test implementation to see if it expects reflow to work
sed -n '12043,12090p' src/terminal/Terminal.zigRepository: manaflow-ai/ghostty Length of output: 1582 🏁 Script executed: #!/bin/bash
# Search for any conditional check before the resize call on the primary screen
sed -n '2710,2740p' src/terminal/Terminal.zig | rg -n "if|cmux|build_options"Repository: manaflow-ai/ghostty Length of output: 434 🏁 Script executed: #!/bin/bash
# Search for any cmux-related build option definition in build.zig or terminal_options
rg -n "cmux|no_reflow" build.zig build.zig.zon src/Repository: manaflow-ai/ghostty Length of output: 277 🏁 Script executed: #!/bin/bash
# Look for terminal_options definition/generation
find . -name "*terminal_options*" -o -name "*options*" | grep -v node_modulesRepository: manaflow-ai/ghostty Length of output: 123 🏁 Script executed: #!/bin/bash
# Search for the terminal_options import source
rg -n "pub const cmux\|pub const reflow\|pub const prompt_redraw" src/ build.zigRepository: manaflow-ai/ghostty Length of output: 45 🏁 Script executed: #!/bin/bash
# Check if the reflow test is expected to pass or skip
rg -B5 "test.*resize with reflow and saved cursor" src/terminal/Terminal.zig | head -20Repository: manaflow-ai/ghostty Length of output: 349 🏁 Script executed: #!/bin/bash
# Examine the terminal build_options file
cat -n src/terminal/build_options.zigRepository: manaflow-ai/ghostty Length of output: 2416 🏁 Script executed: #!/bin/bash
# Search for all available build options in the terminal module
rg -n "pub const" src/terminal/build_options.zigRepository: manaflow-ai/ghostty Length of output: 124 🏁 Script executed: #!/bin/bash
# Check if there's any reference to cmux anywhere in build configuration
rg -n "cmux" build.zig build.zig.zon src/Repository: manaflow-ai/ghostty Length of output: 277 Scope mismatch: no-reflow is applied globally without a cmux-specific build option. This change unconditionally hard-disables reflow and prompt redraw for all primary-screen resizes. The comments reference cmux behavior, but no cmux build option exists in the codebase to gate this. This will alter default Ghostty resize semantics globally rather than only for a cmux-specific mode. The reflow tests ("resize with reflow and saved cursor", etc.) will now silently run with reflow disabled despite their names implying reflow should be active, making them misleading. To align with the stated cmux-only intent, either:
🤖 Prompt for AI AgentsThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same issue as above - |
||
| }); | ||
|
|
||
| // Alternate screen, if it exists, doesn't reflow | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard-coding
reflow = falseinTerminal.resizeremoves the existing DECAWM-dependent behavior and makes primary-screen resize always use no-reflow semantics. This regresses normal terminal behavior outside the cmux scenario: when wraparound is enabled, shrinking or expanding columns no longer reflows soft-wrapped lines (the repository already encodes this expectation intest "Terminal: resize with wraparound on"insrc/terminal/Terminal.zig).Useful? React with 👍 / 👎.