target / lorri

Your project's nix-env
Apache License 2.0
992 stars 69 forks source link

Show and update lorri daemon status in shell #486

Open rvl opened 3 years ago

rvl commented 3 years ago

Feature description

I really like using lorri/direnv except for two problems that I have. The first is #485. The second is that it's difficult to know when the environment is ready to use.

Because lorri daemon builds the shell asynchronously, the shell environment will be updated some time after lorri detects a changed file. In the meantime, there is nothing to tell the user that their environment is stale. If the build fails, the user will continue to get the cached environment, with no indication that this is not current. It's a confusing situation.

Is it possible for lorri to somehow run shell hook functions when the lorri build status has changed? Alternatively, can lorri be configured to send a signal to a certain PID (e.g. the shell's PID). Possible states would be Started/Completed/Failed/Blocked -- something like that.

With that in place, it would be possible to make a zsh prompt that updates in realtime with the lorri status.

Target users

Everyone, but especially:

Metadata

My lorri version is 1.2.0 on NixOS with services.lorri.enable = true;. My current workaround is to monitor journalctl --user -u lorri.service -f or just disable the systemd service and run lorri watch instead.