Commit 18d7babc289b

Vincent Demeester <vincent@sbr.pm>
2026-06-29 11:35:14
feat(emacs): re-enable ghostel terminal emulator
Added ghostel package and toggle function (C-c t g) to replace vterm long-term as primary terminal.
1 parent b886e5a
Changed files (2)
dots
config
emacs
home
common
dots/config/emacs/init.el
@@ -1021,6 +1021,24 @@ minibuffer, even without explicitly focusing it."
   (vterm-kill-buffer-on-exit t)
   (vterm-max-scrollback 100000))
 
+(use-package ghostel
+  :commands (ghostel)
+  :bind ("C-c t g" . vde/ghostel-toggle)
+  :config
+  (defun vde/ghostel-buffer ()
+    "Return the active ghostel buffer, or nil if none exists."
+    (seq-find (lambda (buf)
+                (string-match-p "\\*ghostel:" (buffer-name buf)))
+              (buffer-list)))
+  (defun vde/ghostel-toggle ()
+    "Toggle ghostel terminal buffer."
+    (interactive)
+    (let ((buf (vde/ghostel-buffer)))
+      (cond
+       ((not buf) (ghostel))
+       ((eq (current-buffer) buf) (bury-buffer))
+       (t (switch-to-buffer buf))))))
+
 ;; TODO adapt this to my needs
 ;; (defun tkj/vc-git-grep-current-line ()
 ;;   "Search Git project for the current line."
home/common/dev/emacs.nix
@@ -107,6 +107,7 @@ let
       rg
       ready-player
       pkgs.ytr
+      ghostel
       scopeline
       shr-tag-pre-highlight
       surround