-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(POC): initial support for tab notifications #2
Conversation
Notes after using it for a few days:
nice to have: only clear panes from internal state after the user focused on them. |
panes should send a process status like this: zellij pipe --name zj-status-bar:process_status --args "pane_id=$ZELLIJ_PANE_ID,exit_code=$?" then the plugin will find the pane's tab using `pane_id` tab background color will be green/red depending on `exit_code`
just pushed another refactor to use pipe args to send the process status... Today I explored just subscribing to pane updates and find command panes by check if pane.exit_status was defined (like folks on discord suggested last month), it worked but I found one blocker: by inserting panes that had For now I think best way to use this (at least until the 2nd cmd-runner plugin is done) will be by appending this to each command:
now that the tab index isn't required to be passed this can be wrapped in a shell func like zellij's
|
broadcast internal state so that new instances "catch up" on alerts already sent.
Done ✅ final TODO:
|
initial POC for tab notifications.
use-cases:
Notify finished processes on non-active tabs by start blinking on tab section.
I had this idea a few weeks ago when I had to run
gh pr checks
in watch mode in ~3 tabs at the morning, then forgot to check back for a few hours even when I had the tabs opened in the same session.This POC uses zellij pipes to allow the status bar to receive data (currently the tab index, maybe it should accept exit status too?).
https://zellij.dev/documentation/plugin-pipes
demo
send tab index via
zellij pipe
, the plugin will keep these in a hashmap and use timers to trigger a re-render every 1s.The tab section will keep blinking until you visit it, then it's cleared internally from the hashmap.
Screencast.from.05-01-2024.06.13.43.PM.webm
side-notes
Thinking about the end UX... having to append
zellij pipe
to every command pane isn't good. I use mostlyzellij run --in-place
to do thishttps://zellij.dev/documentation/zellij-run
explored creating a 2nd plugin that creates spawns command panes in-place but these don't emit the
RunCommandResult
event:https://zellij.dev/documentation/plugin-api-events#runcommandresult
once the status bar POC is done I'll either re-create command panes using
run_command
or append something to the command pane names to be able to find them programatically.