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

Re: shared history file



On Sat, Oct 2, 2021 at 10:53 AM Pier Paolo Grassi <pierpaolog@xxxxxxxxx> wrote:
> is it possibile in zsh to disable locking the history file during write operations? I am the only one writing to those files so I shouldn't risk a concurrent operation.

The lock mechanism is not to protect against multiple users writing
those files, it's to protect against multiple zsh processes writing to
the files.  E.g. if you have more than one window open on the same
"project", both zsh might attempt to write the file, even though you
are "the only one" who needs to write.

The problem here seems to be that your host system has symbolic links,
so zsh is compiled to use that locking mechanism, but the remote
server doesn't support creating one.

Your best bet is to store the project history in a directory where a
symbolic link can be created, instead of storing it inside the
remote-mounted directory.

The ~/.zlogin file is sourced before, and the ~/.zlogout file after,
reading/saving history respectively, so if you need to copy the file
contents from/to the remote directory to/from the file used by the
current shell, you can do so there ... or in whatever other functions
etc. you are using to keep track of which project you're in.




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