* Saving all comint history in real time
@ 2012-02-13 21:38 Yaroslav Bulatov
2012-02-14 9:52 ` Tom
0 siblings, 1 reply; 4+ messages in thread
From: Yaroslav Bulatov @ 2012-02-13 21:38 UTC (permalink / raw)
To: help-gnu-emacs
Is there something out there to save all of my comint history after
each command (as opposed to the end of the session?)
I'm using shell-mode right now, and it logs history to
.bash_history.log, but that misses any commands issued when I ssh, and
doesn't save anything until the end of the session
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Saving all comint history in real time
2012-02-13 21:38 Saving all comint history in real time Yaroslav Bulatov
@ 2012-02-14 9:52 ` Tom
2012-02-14 19:44 ` Yaroslav Bulatov
0 siblings, 1 reply; 4+ messages in thread
From: Tom @ 2012-02-14 9:52 UTC (permalink / raw)
To: help-gnu-emacs
Yaroslav Bulatov <yaroslavvb <at> gmail.com> writes:
>
> Is there something out there to save all of my comint history after
> each command (as opposed to the end of the session?)
> I'm using shell-mode right now, and it logs history to
> .bash_history.log, but that misses any commands issued when I ssh, and
> doesn't save anything until the end of the session
>
Try setting the environment variable HISTFILE, before starting M-x shell,
because otherwise history won't be saved for bash (at least that's the
case in Emacs 23 which I use).
Then you can try calling (comint-write-input-ring) from M-: after typing
some commands to see if it saves the inputs to the file you set in HISTFILE.
If it does then you can add an after advise to comint-send-input to call
comint-write-input-ring after each command.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Saving all comint history in real time
2012-02-14 9:52 ` Tom
@ 2012-02-14 19:44 ` Yaroslav Bulatov
2012-02-14 19:57 ` Tom
0 siblings, 1 reply; 4+ messages in thread
From: Yaroslav Bulatov @ 2012-02-14 19:44 UTC (permalink / raw)
To: Tom; +Cc: help-gnu-emacs
Yes, that actually saves all the commands.
However, when I exit the shell, this file is overwritten by something
else, and new version does not include commands from subshells
On Tue, Feb 14, 2012 at 1:52 AM, Tom <adatgyujto@gmail.com> wrote:
> Yaroslav Bulatov <yaroslavvb <at> gmail.com> writes:
>
>>
>> Is there something out there to save all of my comint history after
>> each command (as opposed to the end of the session?)
>> I'm using shell-mode right now, and it logs history to
>> .bash_history.log, but that misses any commands issued when I ssh, and
>> doesn't save anything until the end of the session
>>
>
>
> Try setting the environment variable HISTFILE, before starting M-x shell,
> because otherwise history won't be saved for bash (at least that's the
> case in Emacs 23 which I use).
>
> Then you can try calling (comint-write-input-ring) from M-: after typing
> some commands to see if it saves the inputs to the file you set in HISTFILE.
>
> If it does then you can add an after advise to comint-send-input to call
> comint-write-input-ring after each command.
>
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Saving all comint history in real time
2012-02-14 19:44 ` Yaroslav Bulatov
@ 2012-02-14 19:57 ` Tom
0 siblings, 0 replies; 4+ messages in thread
From: Tom @ 2012-02-14 19:57 UTC (permalink / raw)
To: help-gnu-emacs
Yaroslav Bulatov <yaroslavvb <at> gmail.com> writes:
>
> Yes, that actually saves all the commands.
> However, when I exit the shell, this file is overwritten by something
> else, and new version does not include commands from subshells
>
Did you use some unique log file name, like myemacsshell.log?
Because if you used "bash_history" or something then it may get
overwritten by bash itself.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-02-14 19:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-13 21:38 Saving all comint history in real time Yaroslav Bulatov
2012-02-14 9:52 ` Tom
2012-02-14 19:44 ` Yaroslav Bulatov
2012-02-14 19:57 ` Tom
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).