Repository navigation
Add ghostel ssh and ghostel ssh-install shell commands - #772
Merged
Merged
Conversation
The outbound ssh terminfo wrapper becomes an always-defined ghostel_ssh function; the ssh shadow stays behind ghostel-ssh-install-terminfo and forwards to it. ghostel_ssh also offers INSIDE_EMACS via SendEnv, and its setup probe runs under `sh -c' so a non-POSIX remote login shell (nushell) no longer turns the probe into a parse error and a cached skip. New ghostel_ssh_install pipes the integration scripts and compiled terminfo over a single ssh into ~/.local/share/ghostel on the remote, where etc/shell/remote-install.sh copies the terminfo into ~/.terminfo and hooks the login shell: a marked block in ~/.bashrc or ~/.zshrc, a fish conf.d drop-in, or a nushell vendor autoload file. A ghostel front end exposes cmd, ssh, ssh-install and help subcommands. The documented manual remote layout moves to ~/.local/share/ghostel/shell/.
dakra
force-pushed
the
feat/ghostel-ssh-command
branch
3 times, most recently
from
October 29, 2026 12:50
411dfc5 to
ab261fc
Compare
ghostel_ssh and ghostel_ssh_install now share one push: etc/shell and etc/terminfo are sent to ~/.local/share/ghostel on the remote, mirroring the repo layout, and the terminfo is copied into ~/.terminfo there. No tic or infocmp is needed on either side, and the cache key hashes everything pushed so an update re-pushes. ghostel ssh then starts the remote login shell through etc/shell/remote/login.sh, which sets the same injection environment a local spawn uses (ENV for bash, ZDOTDIR for zsh, XDG_DATA_DIRS for fish and nushell) with EMACS_GHOSTEL_PATH pointing at the pushed copy, so the existing bootstrap shims work unchanged. No rc file on the remote is touched; plain ssh is unaffected until ghostel ssh-install adds its hook (etc/shell/remote/install.sh --hook). Unrecognised login shells start plainly with terminfo only. The -G, -N, -O, -s and -W modes pass through untouched.
dakra
force-pushed
the
feat/ghostel-ssh-command
branch
from
October 29, 2026 13:50
ab261fc to
29e1fa1
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.
Summary
Explicit,
ghostty +ssh-style helpers for working with remote hosts from a ghostel buffer, without turning on anything implicitly. Two commits: the first adds the commands with terminfo-only semantics, the second givesghostel sshper-session shell integration (revert it alone to get the terminfo-only behavior back).ghostel_ssh/ghostel ssh [SSH-ARGS]: drop-in forssh. On first contact with a host, one setup connection pushesetc/shell/andetc/terminfo/to~/.local/share/ghostel/on the remote (mirroring the repo layout) and copies the terminfo into~/.terminfo/. The outcome is cached in~/.cache/ghostel/ssh-terminfo-cache, keyed by target and a hash of the pushed files, so a ghostel update re-pushes. The real connection then starts the remote login shell through the pushedetc/shell/remote/login.sh, which sets the same injection environment a local spawn uses (ENVfor bash,ZDOTDIRfor zsh,XDG_DATA_DIRSfor fish and nushell) withEMACS_GHOSTEL_PATHpointing at the pushed copy, so the existing bootstrap shims work unchanged: directory tracking into TRAMP paths, prompt marks,ghostel_cmd. No rc file on the remote is touched; plainsshis unaffected. Notic/infocmpneeded anywhere. Unknown remote login shells get a plain session with terminfo only. Pass-through for no-host, user remote commands, and the-G/-N/-O/-s/-Wmodes. Plainsshis still only shadowed whenghostel-ssh-install-terminfois on.ghostel_ssh_install/ghostel ssh-install [SSH-OPTIONS] HOST: the same push plusinstall.sh --hook, which hooks the remote login shell persistently: a marked, idempotent block in~/.bashrcor~/.zshrc, a fishconf.ddrop-in, or a nushell vendor-autoload file (path asked fromnu, since it is platform specific). After that, plainssh HOSTloads the integration too.ghostelfront end withcmd,ssh,ssh-install,help(native subcommand defs in nushell).Being shell functions rather than OSC-reachable Elisp commands, neither can be triggered by terminal output, so no allowlist entry or confirmation prompt is needed.
The README's manual remote layout moves to
~/.local/share/ghostel/etc/shell/; the TRAMP wrapper'sTERMINFO_DIRSprobe follows it.Verification
make lint, shell/environment test files (new tests forinstall.shin both modes and forlogin.shagainst a fake login shell).sh(no tic) and bash withAcceptEnv INSIDE_EMACS, driven from sandboxed Emacs sessions with each local shell: integration loads,cdbecomes a TRAMPdefault-directory, prompt lines carryghostel-prompt, cache goesok, plainsshstays unhooked afterghostel ssh,ghostel ssh-installthen plainsshworks, SendEnv forwarding works where sshd accepts it, Alpine gets a plain session withTERM=xterm-ghostty.ghostel sshsessions (remote command); an OpenSSH ControlMaster opened by plainsshcannot forwardINSIDE_EMACSfor later muxed sessions (theTERMgate still works); the bash hook relies on the remote profile sourcing.bashrc.