Fan Yang <fan_y...@sjtu.edu.cn> writes:

> Hi Bruno,

Hi Fan,

> Thanks for your reply!  Searching command history saves a lot of
> typing and quickens my
> workflows,  I probably will still head for a solution.
>
> Some more questions, if I may,
> 1. Should I attribute this issue to TRAMP or to shell-mode?

It isn't Tramp.

> 2. Where should I start, is there any suggestions?

In shell-mode, always the *local* history file is read:

--8<---------------cut here---------------start------------->8---
      (setq comint-input-ring-file-name
            (or (getenv "HISTFILE")
                (cond ((string-equal shell "bash") "~/.bash_history")
                      ((string-equal shell "ksh") "~/.sh_history")
                      (t "~/.history"))))
--8<---------------cut here---------------end--------------->8---

> I am still going to investigate this issue a little bit, any
> suggestion/solution is appreciated!

The code above must be improved to read the *remote* history
file. Something like this (not tested):

--8<---------------cut here---------------start------------->8---
      (setq comint-input-ring-file-name
            (concat
              (file-remote-p default-directory)
              (or (and (not (file-remote-p default-directory ))
                       (getenv "HISTFILE"))
                  (cond ((string-equal shell "bash") "~/.bash_history")
                        ((string-equal shell "ksh") "~/.sh_history")
                        (t "~/.history")))))
--8<---------------cut here---------------end--------------->8---

> Thanks in advance,
> Fan

Best regards, Michael.

_______________________________________________
Tramp-devel mailing list
Tramp-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/tramp-devel

Reply via email to