fix(ghostel): support ghostel >= 0.22.0 (ghostel--copy-mode-active removed) - #142
Open
dsdshcym wants to merge 1 commit into
Open
fix(ghostel): support ghostel >= 0.22.0 (ghostel--copy-mode-active removed)#142dsdshcym wants to merge 1 commit into
dsdshcym wants to merge 1 commit into
Conversation
…mode-active with ghostel--input-mode
ghostel commit bdd2b85 ("Add eat-style input modes") removed `ghostel--copy-mode-active`
and replaced it with `ghostel--input-mode`. The three ghostel backend methods that
referenced the old variable caused a `void-variable` error when called against new ghostel.
This error was silently swallowed by Emacs's C-level window resize callback, causing
`claude-code--adjust-window-size-advice` to return nil and suppress SIGWINCH. As a
result, Claude Code's PTY was never notified of the correct terminal width and stayed at
the 80-column fallback set at spawn time (the buffer is not yet displayed in any window
when `ghostel-exec` is called, so it falls back to 80×24).
Fix: extract `claude-code--ghostel-in-copy-mode-p` helper that checks for
`ghostel--input-mode` first (>= 0.22.0: `(memq ghostel--input-mode '(copy emacs))`)
and falls back to `(bound-and-true-p ghostel--copy-mode-active)` for older ghostel.
Also handle `ghostel-copy-mode-exit` → `ghostel-readonly-exit` rename with an `fboundp`
guard so both old and new ghostel work.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@stevemolitor does this look ok to you? should it be a breaking change like #136? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After upgrading ghostel past commit
bdd2b85(v0.22.0, "Add eat-style input modes"), claude-code buffers are stuck at 80 columns wide.Root cause
ghostel
bdd2b85removedghostel--copy-mode-activeand replaced it withghostel--input-mode. The three ghostel backend methods still referenced the old variable.When
claude-code--adjust-window-size-advicefires during window resize, it callsclaude-code--term-in-read-only-p→ghostel--copy-mode-active→ void-variable error. This error is silently swallowed by Emacs's C-level window resize callback, causing the advice to returnniland suppress SIGWINCH.Without SIGWINCH, Claude Code's PTY is never notified of the correct terminal width and stays at the 80-column fallback set at spawn time. (The buffer is not yet displayed in any window when
ghostel-execis called, so it falls back to 80×24.)Note: ghostel's libghostty internal model does resize correctly — only Claude Code's PTY signal is suppressed, so output wraps at 80 columns even in a wider window.
What changed in ghostel
ghostel--copy-mode-active(bool)ghostel--input-mode(symbol:semi-char/char/emacs/copy/line)ghostel-copy-mode-exitghostel-readonly-exitFix
claude-code--ghostel-in-copy-mode-phelper that detects the API version at runtime(memq ghostel--input-mode '(copy emacs))(>= 0.22.0)(bound-and-true-p ghostel--copy-mode-active)(< 0.22.0)ghostel-copy-mode-exit→ghostel-readonly-exitwithfboundpguard for backward compatTest plan
ghostel-copy-mode) still works (read-only detection correct)bound-and-true-p/fboundpguards🤖 Generated with Claude Code