From 4020dc81096410e2ba631b8bfd25dbc0b85980e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Madeleine=20Sydney=20=C5=9Alaga?= Date: Tue, 26 Aug 2025 13:50:25 -0600 Subject: [PATCH] feat(emacs): tramp --- modules/home/users/msyds/emacs/init.el | 3 ++- .../home/users/msyds/emacs/lisp/syd/tramp.el | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 modules/home/users/msyds/emacs/lisp/syd/tramp.el diff --git a/modules/home/users/msyds/emacs/init.el b/modules/home/users/msyds/emacs/init.el index 6830501..bb81f8c 100644 --- a/modules/home/users/msyds/emacs/init.el +++ b/modules/home/users/msyds/emacs/init.el @@ -29,7 +29,8 @@ syd/top-level-keymaps syd/escape syd/leader - syd/which-key)) + syd/which-key + syd/tramp)) (defun syd-random-permutation (lst &optional seed) "Return a random permutation of list LST using SEED as the random state. The diff --git a/modules/home/users/msyds/emacs/lisp/syd/tramp.el b/modules/home/users/msyds/emacs/lisp/syd/tramp.el new file mode 100644 index 0000000..d4cb20e --- /dev/null +++ b/modules/home/users/msyds/emacs/lisp/syd/tramp.el @@ -0,0 +1,20 @@ +;;; -*- lexical-binding: t; -*- + +(require 'syd/constants) + +(with-eval-after-load 'tramp + ;; Keep junk out of `user-emacs-directory'. + (setq tramp-persistency-file-name + (file-name-concat syd-cache-dir "tramp") + 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)