emacs-native-shell-complete icon indicating copy to clipboard operation
emacs-native-shell-complete copied to clipboard

Automatically running the .bashrc commands on remote servers

Open quotuva opened this issue 1 year ago • 1 comments

I use the following hack in shell-mode-hook:

(lambda nil
  (when (file-remote-p default-directory)
    (let* ((proc (get-buffer-process (current-buffer))))
      (accept-process-output proc)
      (delete-line)
      (process-send-string
       proc "export HISTCONTROL=ignoreboth; bind 'set enable-bracketed-paste off'; history -d $(history 1)\n")))
  ...)

to do this (and to avoid an annoying double prompt display).

Is there a better way?

quotuva avatar Dec 19 '23 23:12 quotuva

That seems like a good way to do it.

CeleritasCelery avatar Dec 20 '23 04:12 CeleritasCelery