Repository navigation
Extract a ghostel-shell module along the terminal/shell boundary - #651
Merged
Merged
Conversation
Collect everything that knows a shell is on the other side of the PTY into lisp/ghostel-shell.el: shell detection and spawn-spec resolution (local, TRAMP via ghostel-tramp-shells, and the macOS login wrap), shell-integration injection (local rc bootstrap, remote temp-file setup, and the remote terminfo push tangled into it), the OSC 133 semantic-prompt state with its navigation and imenu consumers (all of ghostel-prompt.el, which is deleted), and shell history retrieval. The core terminal emulator keeps ghostel--start-process as the orchestrator; the local rc-bootstrap that was inline there becomes ghostel--setup-local-integration in the shell module, returning the same (:env :args) plist shape as the remote path so the bash ENV/--posix mechanism lives in one place. Core requires ghostel-shell eagerly, exactly as it required ghostel-prompt, so the native marker handler exists before any VT data is processed.
dakra
force-pushed
the
refactor/ghostel-shell-module
branch
from
August 25, 2026 11:31
9af6416 to
484a4c1
Compare
This branch was previously deployed
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.
Split along the terminal/shell boundary: the core terminal emulator (VT plumbing, rendering, input encoding, PTY spawning) works for any program, while everything that knows a shell is on the other side was smeared across
ghostel.elandghostel-prompt.el. This collects it into one module,lisp/ghostel-shell.el:ghostel--detect-shell,ghostel--resolve-shell-specand friends, the macOSlogin(1)wrap, and theghostel-tramp-shellsoption next to its parser.ghostel--setup-local-integration, returning the same(:env :args)plist shape as the remote path so the bash ENV/--posixmechanism lives in one place), remote (TRAMP) temp-file setup, and the remote terminfo push tangled into it.ghostel-prompt.el(deleted) plus the state it forward-declared from core:ghostel--command-running,ghostel--prompt-positions, the command start/finish hooks.ghostel-shell-historyand its defcustom, grouped withghostel--detect-shellwhich keys it.ghostel--start-processstays in core as the orchestrator, and core requiresghostel-shelleagerly exactly as it requiredghostel-prompt, so the native OSC 133 marker handler exists before any VT data is processed. Allghostel-*.elfiles are internal (users only(require 'ghostel)), so no compatibility shims are needed.Pure code motion apart from the two named changes (the
ghostel--setup-local-integrationextraction and the(:env :args)unification inghostel--start-process).make -j8 all(build, elisp + native + zig tests, evil/consult extensions, lint) is green;test/ghostel-shell-test.elandtest/ghostel-shell-history-test.elalready map 1:1 to the new module.