[Grml] RC: disable zshrc's share_history feature by default?

Michael Prokop mika at grml.org
Mon Mar 25 11:23:57 CET 2013

[Removing grml-devel from Cc]

* Csillag Tamas [Mon Mar 25, 2013 at 11:13:33AM +0100]:
> On Mon, Mar 25, 2013 at 10:47:40AM +0100, Michael Prokop wrote:

> > Grml's zshrc [http://grml.org/zsh/] uses 'setopt share_history' by
> > default since ages.

> > This option is responsible for making the history of one Zsh session
> > available to others "kind-of-immediately". So when sending 'echo
> > foobar' in one terminal, then pressing e.g. <return> in another zsh
> > session of the same user then cursor up will show 'echo foobar' on
> > the command line.

> > While I personally like the feature and somewhat got used to it it's
> > also one of the most discussed settings of grml-zshrc. It has the
> > potential to do harm, especially if you aren't aware of that
> > feature.

> What is the potential harm?

If you have e.g. 'rm -rf $whatever' in one of your sessions and then
<enter><cursor-up> in another session then you might have 'rm -rf
$whatever' in your command line while expecting something different.
(Yeah, don't execute without reading what's there, but if you're
used to something different and fast working...)

> > This is why I'd like to disable this setting by default (but provide
> > it as commented feature so it's trivial to just enable it on
> > request). Of course you will be able to just customize it via e.g.
> > .zshrc.local, it's really just about the default behaviour.

> What will happen then?
> The histories will still get merged, but only at the end of the session?

Yeah, they will be "merged".

> If one or the other overwrites the history file I would vote against it.

No, you won't lose any history information.

> On the other hand it is grml where I learned and got used to zsh and this was
> one of its great features. :)

> Maybe the grml distribution and users fetching grml's zsh config from grml.org/zsh
> has a different use case (I am not sure) let me explain:
> On a server there can be more root users operating in parallel
> on a grml live system there is usually one and typing in one shell then the
> capability to see that on the other's history is a great thing.

Yeah, but people use grml-zshrc also outside of Grml, even on
different operating systems. So we don't have to care just about the
Grml live mode use case but also about the more generic one. :)

Thanks for your feedback,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://ml.grml.org/pipermail/grml/attachments/20130325/29f5a9d7/attachment.pgp>

More information about the Grml mailing list