Skip to content

Commit

Permalink
fix(tramp): fix Tramp bug (thanks Phundrak)
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Sep 19, 2023
1 parent 537a5bc commit d40fb21
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion core/me-builtin.el
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,25 @@
(tramp-auto-save-directory (concat minemacs-local-dir "tramp/auto-save/"))
(tramp-backup-directory-alist backup-directory-alist)
(tramp-persistency-file-name (concat minemacs-local-dir "tramp/persistency.el"))
(tramp-default-remote-shell "/bin/bash"))
(tramp-default-remote-shell "/bin/bash")
:config
;; BUG: Fix taken from: github.com/Phundrak/dotfiles/commit/566861ee
;; There is currently a bug in Emacs TRAMP as described in issue
;; github.com/magit/magit/issues/4720 of Magit and bug
;; debbugs.gnu.org/cgi/bugreport.cgi?bug=62093 of Emacs. A workaround is to
;; redefine the old `tramp-send-command' function through an advice.
(defun +tramp-send-command--workaround-stty-icanon-bug (conn-vec orig-command &rest args)
"See: https://github.com/magit/magit/issues/4720"
(let ((command
(if (string= "stty -icrnl -icanon min 1 time 0" orig-command)
"stty -icrnl"
orig-command)))
(append (list conn-vec command) args)))

(advice-add
'tramp-send-command :filter-args
(defun +tramp-send-command--workaround-stty-icanon-bug--filter-args (args)
(apply #'+tramp-send-command--workaround-stty-icanon-bug args))))

(use-package eshell
:straight (:type built-in)
Expand Down

0 comments on commit d40fb21

Please sign in to comment.