Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: can't set HISTFILE to /dev/null



On Thu, 23 Jun 2011 12:46:24 -0700
Danek Duvall <duvall@xxxxxxxxxxxxxx> wrote:
> A colleague of mine saw this today:
> 
>  zsh: locking failed for /dev/null: operation not supported: reading anyway
>...
>  zsh: locking failed for /dev/null: permission denied: reading anyway
> 
> Turns out he was setting HISTFILE=/dev/null, rather than unsetting it.
> 4.3.10 was silent in this case, but 4.3.12 now complains.  Is this
> intentional?

Error messages apart, which is down to OS behaviour (both of those look
reasonable), this is behaving as designed.  We've had problems with
history file locking in the past, which can cause silent corruption, so
it now alerts the user if there was a failure to lock the file so they
can do something about it.

Using /dev/null was never a supported method of turning *off* history
saving --- indeed, it doesn't turn it off, the shell busily saves all
the contents straight to the bit bucket, which is a waste of time.  This
has always happened, all that's changed is that the shell now says "this
doesn't seem to be doing what I expect, is this what you really wanted?"

The recommended way of turning off file saving (by me, anyway) is to set
SAVEHIST to 0.

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog



Messages sorted by: Reverse Date, Date, Thread, Author