-
-
Notifications
You must be signed in to change notification settings - Fork 639
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
Add ability to run commands in the current session via external scripts #3581
Comments
Zellij set the env var |
How should this help when running an external script that does not run in any Zellij context? The point is to that the script doesn't know the current active session (the one with the latest client interaction) so it has to rely on Zellij giving the option to say |
How does Most importantly, does your answers apply only to you or to every workflow? To me the best zellij can provide is a way to specify the session. You can list all with If you describe a bit more what you want this script do outside of zellij to a specific session I would be happy to brainstorm with you. For starter I don’t understand the need for this script to be run from outside of zellij. Is it run as a cron job? |
Use case:In tmux I had some keyboard shortcuts (defined outside of tmux) that run some scripts and also call some command or print some characters into the current tmux session. Regarding reliability:Worked pretty stable in tmux, only case where it didn't work was: Zellij kitty protocol support:I guess the kitty protocol support (hopefully coming soon with the next release of Zellij) also makes these use-cases quite possible, since more keyboard combinations will (hopefully, think Conclusion:To enhance scriptability, it would be a valuable addition to Zellij if users could send actions without specifying a particular session, allowing Zellij to automatically target the most recently used session. Note:To clear up: Last recent used should only be determined by last recent user interaction. Not any command output or other stuff that happens in the background. |
When multiple sessions are active, Zellij requires the name of a session to send actions to. Alas a WezTerm pane does not inherit a shell's environment and therefore cannot use the ZELLIJ_SESSION_NAME environment variable. wez/wezterm#5906 zellij-org/zellij#3581 zellij-org/zellij#2100
Disclaimer:
I know this is a tmux comparison, but it's (in my opinion) not some special feature, rather a core functionality that Zellij should have.
In tmux, I frequently run actions or commands in the current session using external scripts. For
example:
or
# sends the keys "foobar" to the last active pane tmux send-keys foobar
Zellij can do this, but as soon as I have more than one session it wants me to explicitly state the session name in my command. That's a significant limitation for scripting around zellij.
I assume Zellij already internally tracks session activity, so it should be relatively straightforward to add an option like
--in-current-session
(or something like that) to the zellij command.Implementing this feature would greatly enhance Zellij's usability for users who rely on external scripts to manage their terminal sessions.
The text was updated successfully, but these errors were encountered: