[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tramp (2.2.13.25.2); How to let shell over TRAMP read "~/.bash_histo
From: |
Fan_Yang |
Subject: |
Re: tramp (2.2.13.25.2); How to let shell over TRAMP read "~/.bash_history" as input ring? |
Date: |
Sat, 20 Jul 2019 21:32:57 +0800 |
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 <address@hidden> 写道:
>
> Fan Yang <address@hidden> 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 (2.2.13.25.2); How to let shell over TRAMP read "~/.bash_history" as input ring?, Fan_Yang, 2019/07/18
- tramp (2.2.13.25.2); How to let shell over TRAMP read "~/.bash_history" as input ring?, Fan Yang, 2019/07/18
- Re: tramp (2.2.13.25.2); How to let shell over TRAMP read "~/.bash_history" as input ring?, Bruno Barbier, 2019/07/18
- Re: tramp (2.2.13.25.2); How to let shell over TRAMP read "~/.bash_history" as input ring?, Fan Yang, 2019/07/18
- Re: tramp (2.2.13.25.2); How to let shell over TRAMP read "~/.bash_history" as input ring?, Bruno Barbier, 2019/07/19
- Re: tramp (2.2.13.25.2); How to let shell over TRAMP read "~/.bash_history" as input ring?, Fan Yang, 2019/07/19
- Re: tramp (2.2.13.25.2); How to let shell over TRAMP read "~/.bash_history" as input ring?, Michael Albinus, 2019/07/20
- Re: tramp (2.2.13.25.2); How to let shell over TRAMP read "~/.bash_history" as input ring?,
Fan_Yang <=
- Re: tramp (2.2.13.25.2); How to let shell over TRAMP read "~/.bash_history" as input ring?, Michael Albinus, 2019/07/20
- Re: tramp (2.2.13.25.2); How to let shell over TRAMP read "~/.bash_history" as input ring?, Bruno Barbier, 2019/07/20
- Re: tramp (2.2.13.25.2); How to let shell over TRAMP read "~/.bash_history" as input ring?, Fan_Yang, 2019/07/20