Hi Michael, thanks!  You’ve saved a lot of my time!

This seems reasonable, and probably I should file an Emacs bug
to report this~

This issue session can be ended, thanks again,
Fan

> 在 2019年7月20日,16:06,Michael Albinus <[email protected]> 写道:
> 
> Fan Yang <[email protected]> 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
[email protected]
https://lists.gnu.org/mailman/listinfo/tramp-devel

Reply via email to