cantino / mcfly

Fly through your shell history. Great Scott!
MIT License
6.75k stars 176 forks source link

Error on startup with Zellij layouts #355

Closed utkarshgupta137 closed 1 year ago

utkarshgupta137 commented 1 year ago

I've recently started using Zellij with layouts. I've layouts where I would start 3 or 4 panes, each of which will just start with my shell. But from time to time, I get the following error in one of the shells:

mcfly_prompt_command:10: can't rename /var/folders/_s/qgmnltjj0xs4djk_s3p8mpww0000gn/T//mcfly.EYAA0qSk.new to $HISTFILE

It looks like while each shell has a unique MCFLY_SESSION_ID, they all share the same MCFLY_HISTORY, so my guess is that it is causing a race condition. Maybe incorporating MCFLY_SESSION_ID inside MCFLY_HISTORY can solve this issue?

Here is some more information about Zellij's startup process: https://github.com/zellij-org/zellij/issues/1061#issuecomment-1040597253.

Versions (all latest): macOS: 13.3.1 Alacritty: v0.12.0 Zellij: v0.37.0 zsh: v5.9 (nixpkgs) mcfly: v0.8 mktemp: one that ships with macOS (this is used to create MCFLY_HISTORY)

cantino commented 1 year ago

Hey @utkarshgupta137, thanks for the issue. I don't know what Zellij is, but you're welcome to attempt a fix and contribute it back if it works.