CeleritasCelery/emacs-native-shell-complete

Automatically running the .bashrc commands on remote servers

Opened this issue · 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?

That seems like a good way to do it.