Skip to content

Add projectile-run-ghostel project terminal commands#2022

Merged
bbatsov merged 1 commit into
bbatsov:masterfrom
Silex:ghostel
Jun 20, 2026
Merged

Add projectile-run-ghostel project terminal commands#2022
bbatsov merged 1 commit into
bbatsov:masterfrom
Silex:ghostel

Conversation

@Silex

@Silex Silex commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Wire the ghostel terminal emulator (libghostty-powered, a faster mouse-capable alternative to vterm/eat) into the C-c p x prefix, mirroring the existing vterm/eat integration:

  • projectile-run-ghostel (x G) and projectile-run-ghostel-other-window (x 4 G), backed by a shared projectile--ghostel helper.
  • ghostel is loaded lazily via require ... noerror, so it stays an optional dependency just like vterm and eat (no change to Package-Requires).
  • Added to the transient dispatch menu and the Run... easy-menu.
  • Documented in usage.adoc, projectile_vs_project.adoc, and the changelog.

Implementation notes

ghostel's entry point (ghostel &optional arg) creates its buffer from the dynamic value of ghostel-buffer-name and reuses buffers by a stored identity rather than the live buffer name — so reuse keeps working even after ghostel asynchronously retitles the visible buffer (OSC 2 / OSC 7). The helper therefore just let-binds ghostel-buffer-name to a project-scoped name (via projectile-generate-process-name) inside projectile-with-default-dir, the same shape as projectile--eat.

ghostel-buffer-name is declared special with a valueless defvar (next to the existing eat-buffer-name/eshell-buffer-name declarations) so the let-binding is dynamic under lexical-binding.

Testing

  • emacs -Q --batch -L . -f batch-byte-compile projectile.el — clean, no warnings.
  • Verified the keybindings resolve (x Gprojectile-run-ghostel, x 4 Gprojectile-run-ghostel-other-window) and that invoking the command without ghostel installed errors with Package 'ghostel' is not available.
  • The live terminal behaviour (opening/reusing a buffer, the other-window placement, C-u for an extra process) requires ghostel's native module and was not exercised in CI/batch.

Wire the ghostel terminal emulator (https://github.com/dakra/ghostel)
into the C-c p x prefix, mirroring the existing vterm/eat integration:

* projectile-run-ghostel (x G) and
  projectile-run-ghostel-other-window (x 4 G), backed by a shared
  projectile--ghostel helper.
* Load ghostel lazily via `require ... noerror`, so it stays an
  optional dependency like vterm and eat.
* Add entries to the transient menu and the Run... easy-menu.
* Document the commands in usage.adoc, projectile_vs_project.adoc and
  the changelog.

The helper let-binds `ghostel-buffer-name` to a project-scoped name;
declare that external variable special so the binding is dynamic under
lexical-binding. ghostel reuses buffers by stored identity, so reuse
keeps working even after it retitles the visible buffer.
@bbatsov bbatsov merged commit fd1c6c4 into bbatsov:master Jun 20, 2026
5 checks passed
@bbatsov

bbatsov commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Thanks!

@Silex Silex deleted the ghostel branch June 23, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants