Fabian Peters | 16 Jun 2012 20:41

Any fish equivalent to zsh's SHARE_HISTORY?

Hi all,

Subject says it all: 

> SHARE_HISTORY <K>
> This option both imports new commands from the history file, and also causes your typed commands to be
appended to the history file (the latter is like specifying INC_APPEND_HISTORY)

I'm new to fish and really hope there's an equivalent? 

cheers, Fabian
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Martin Bähr | 16 Jun 2012 22:05
Picon

Re: Any fish equivalent to zsh's SHARE_HISTORY?

On Sat, Jun 16, 2012 at 08:41:36PM +0200, Fabian Peters wrote:
> > SHARE_HISTORY <K>
> > This option both imports new commands from the history file, and also causes your typed commands to be
appended to the history file (the latter is like specifying INC_APPEND_HISTORY)
> 
> I'm new to fish and really hope there's an equivalent? 

there shoudln't be any need. history is shared across all running
shells, thus you never need to import from or export to the history file
in order to share history with other shells, because it efectively
happens automatically every time you run a command. (the command is
added to the history file and imported to the history of all other
running shells.

greetings, martin.
--

-- 
cooperative communication with sTeam      -     caudium, pike, roxen and unix
services:   debugging, programming, training, linux sysadmin, web development
--
pike programmer      working in china                 societyserver.(org|net)
foresight developer  community.gotpike.org                 foresightlinux.org
unix sysadmin        (open-steam|www.caudium).org                  realss.com
Martin Bähr          http://societyserver.org/mbaehr/      

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
(Continue reading)

Fabian Peters | 17 Jun 2012 00:02

Re: Any fish equivalent to zsh's SHARE_HISTORY?

Am 16.06.2012 um 22:05 schrieb Martin Bähr:

> On Sat, Jun 16, 2012 at 08:41:36PM +0200, Fabian Peters wrote:
>>> SHARE_HISTORY <K>
>>> This option both imports new commands from the history file, and also causes your typed commands to be
appended to the history file (the latter is like specifying INC_APPEND_HISTORY)
>> 
>> I'm new to fish and really hope there's an equivalent? 
> 
> there shoudln't be any need. history is shared across all running
> shells, thus you never need to import from or export to the history file
> in order to share history with other shells, because it efectively
> happens automatically every time you run a command. (the command is
> added to the history file and imported to the history of all other
> running shells.

Thanks, Martin! Unfortunately this is not what I'm seeing. I used the OS X installer from
http://ridiculousfish.com/shell/beta.html. It looks to me as if there's a delay before any commands
are appended. Which would match my understanding of https://github.com/fish-shell/fish-shell/blob/master/history.cpp?:

> /** Interval in seconds between automatic history save */
> #define SAVE_INTERVAL (5*60)
> 
> /** Number of new history entries to add before automatic history save */
> #define SAVE_COUNT 5

cheers, Fabian
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
(Continue reading)

Martin Bähr | 17 Jun 2012 16:37
Picon

Re: Any fish equivalent to zsh's SHARE_HISTORY?

On Sun, Jun 17, 2012 at 12:02:11AM +0200, Fabian Peters wrote:
> > there shoudln't be any need. history is shared across all running
> > shells, thus you never need to import from or export to the history file
> > in order to share history with other shells, because it efectively
> > happens automatically every time you run a command. (the command is
> > added to the history file and imported to the history of all other
> > running shells.
> Thanks, Martin! Unfortunately this is not what I'm seeing. I used the
> OS X installer from http://ridiculousfish.com/shell/beta.html. It
> looks to me as if there's a delay before any commands are appended.
> Which would match my understanding of
> https://github.com/fish-shell/fish-shell/blob/master/history.cpp?:
> > #define SAVE_INTERVAL (5*60)
> > #define SAVE_COUNT 5

ah, yes, forgot about the delay.
well it doesn't contradict what i said, it's just not immideate.

i suppose it would be nice to have a command to force a history sync. i
don't know what kind of effort would be involved...

greetings, martin.
--

-- 
cooperative communication with sTeam      -     caudium, pike, roxen and unix
services:   debugging, programming, training, linux sysadmin, web development
--
pike programmer      working in china                 societyserver.(org|net)
foresight developer  community.gotpike.org                 foresightlinux.org
unix sysadmin        (open-steam|www.caudium).org                  realss.com
Martin Bähr          http://societyserver.org/mbaehr/      
(Continue reading)


Gmane