Add ghostel-initial-input-mode to start in char or line mode#443
Merged
Conversation
dakra
force-pushed
the
initial-input-mode
branch
from
June 21, 2026 19:56
431c02f to
6b83581
Compare
New defcustom `ghostel-initial-input-mode' (semi-char/char/line) sets the input mode a freshly started `ghostel' terminal begins in, so users coming from `shell' can start directly in line mode. `char' applies immediately at process start. `line' cannot engage until the shell prints its first prompt to anchor the input region, so `ghostel--apply-initial-input-mode' arms a buffer-local flag and the existing per-redraw `ghostel--line-mode-post-redraw' path enters line mode on the first redraw that exposes a real prompt (`ghostel--line-mode-startup-prompt-ready-p' gates on an OSC 133 prompt property or `ghostel-prompt-regexp', not the bare cursor, so it skips a blank pre-prompt screen). A manual mode switch during startup wins. Scoped to the interactive `ghostel' entry point, not `ghostel-exec'. Closes #435
dakra
force-pushed
the
initial-input-mode
branch
from
June 21, 2026 19:59
6b83581 to
c4557b8
Compare
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.
Closes #435.
What
Adds a
ghostel-initial-input-modedefcustom (semi-char(default) /char/line) that sets the input mode a freshly startedghostelterminal begins in, so users coming fromshellcan start directly in line mode without thesleep-for+ghostel-line-mode 'forceadvice from the issue.How
charapplies immediately at process start.linecannot engage until the shell prints its first prompt to anchor the input region, soghostel--apply-initial-input-modearms a buffer-local flag and the existing per-redrawghostel--line-mode-post-redrawpath enters line mode on the first redraw that exposes a real prompt. The newghostel--line-mode-startup-prompt-ready-pgates on an OSC 133 prompt property orghostel-prompt-regexp(not the bare cursor), so it skips a blank pre-prompt screen. No timer/sleep.ghostelentry point, notghostel-exec.Testing
make -j8 allpasses (build, Zig, native, elisp, lint).test/ghostel-line-mode-test.el: deferral-then-entry,charimmediate,linearming, manual-override-cancels.linedefers then enters on the first prompt (~0.5s) with end-to-end editing + send;charenters immediately;semi-charunchanged.