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

Assign each concurrent Zsh session and ID and a codename

Typical solution for granting each Zshell a separate file is to use $$,


This means there will be enormous number of files created. The plugin
zdharma/zsh-unique-id allows to set:


No two concurrent Zsh sessions will have the same code-name. $ZUID_ID can
be used to have numbers 1, 2, ... instead of code-names.

Could be an upstream autoload function a good idea for this?

  autoload -Uz acquire-unique-id
  acquire-unique-id  # sets ZSH_UID and ZSH_UID_CODENAME

The code is simple, it uses zsystem-flock (util-linux/flock for Zsh < 5.3,
but that doesn't matter for upstream), it's the second link. Plugin is at:


Business logic code:

Best regards,
Sebastian Gniazdowski

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