From 4062a4fff62455a5e2657bc08f7fb107e72a15a0 Mon Sep 17 00:00:00 2001 From: Madeleine Sydney Date: Sun, 23 Mar 2025 23:16:03 -0600 Subject: [PATCH] fix(emacs): Explicitly set TRAMP host shell to Bash Fixes hang during connection. --- modules/home/users/crumb/emacs/modules/syd-tramp.el | 7 +++++++ modules/home/users/crumb/readline.nix | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/home/users/crumb/emacs/modules/syd-tramp.el b/modules/home/users/crumb/emacs/modules/syd-tramp.el index 4ace725..73710e0 100644 --- a/modules/home/users/crumb/emacs/modules/syd-tramp.el +++ b/modules/home/users/crumb/emacs/modules/syd-tramp.el @@ -5,6 +5,13 @@ (file-name-concat syd-cache-dir "tramp")) (setq tramp-auto-save-directory (file-name-concat syd-cache-dir "tramp-autosave/")) + ;; TRAMP's default settings try to disable Readline, *rc files, profiles, etc. + ;; This is all very important and prevents unexpected behaviour and various + ;; hangs/crashes. However, the default settings (`tramp-sh-extra-args') can + ;; only kick in when the shell is accurately identified — on my NixOS system, + ;; /bin/sh links to Bash. Thus, the appropriate flags are never applied, + ;; unless we make the Bash of the matter explicit. + (setq tramp-encoding-shell (executable-find "bash")) (add-to-list 'tramp-remote-path 'tramp-own-remote-path)) (provide 'syd-tramp) diff --git a/modules/home/users/crumb/readline.nix b/modules/home/users/crumb/readline.nix index b473015..99f6771 100644 --- a/modules/home/users/crumb/readline.nix +++ b/modules/home/users/crumb/readline.nix @@ -10,7 +10,7 @@ in { programs.readline = { enable = true; extraConfig = '' - # Unfortunately, the Vi mode is... bad! + # Unfortunately, the Vi mode is... bad. set editing-mode emacs # Mimmic Comint/Eshell binds.