display message if a specific session/window/pane is killed/exited?

13 views
Skip to first unread message

Sivaram Neelakantan

unread,
Sep 19, 2020, 6:36:17 AM9/19/20
to tmux-...@googlegroups.com
How do I set a hook/condition that if named session is killed or
exited or detached I show a message to the user. Say I have
session=="help" and if the user tries to exit or kill, I show a
warning message.

sivaram
--

nicholas...@gmail.com

unread,
Sep 22, 2020, 1:09:39 AM9/22/20
to tmux-users
Where do you want to show this warning message? Once the client is detached, tmux can't write anything else to the terminal.

Sivaram Neelakantan

unread,
Sep 22, 2020, 1:37:45 PM9/22/20
to tmux-...@googlegroups.com
On Mon, Sep 21 2020,nicholas...@gmail.com nicholas...@gmail.com wrote:

> Where do you want to show this warning message? Once the client is
> detached, tmux can't write anything else to the terminal.
>

good point. In my case,it's the current active session pane. Since
that killed session was invoked through popup in an existing session,
if it gets killed, the current session should see a message.


[snipped 9 lines]



sivaram
--

Nicholas Marriott

unread,
Sep 22, 2020, 2:15:37 PM9/22/20
to Sivaram Neelakantan, tmux-users
And after-kill-session or one of the other hooks with display-message doesn't work? You will probably need to specify the session or client to display-message with -t (obviously the one you want to display on, not the one you are killing).

--
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/krpqx3h7rpn259.fsf%40gmail.com.

Sivaram Neelakantan

unread,
Sep 22, 2020, 11:56:58 PM9/22/20
to tmux-...@googlegroups.com
On Tue, Sep 22 2020,Nicholas Marriott wrote:

> And after-kill-session or one of the other hooks with
> display-message doesn't work? You will probably need to specify the
> session or client to display-message with -t (obviously the one you
> want to display on, not the one you are killing).

Well, I want the message only after a specific session is closed or
killed. I don't see how the hook can check for a specific session to
trigger in the man page.

[snipped 23 lines]


sivaram
--

Nicholas Marriott

unread,
Sep 23, 2020, 1:32:33 AM9/23/20
to Sivaram Neelakantan, tmux-users
You can use the hook_session format variable and "if -F" or give it to a shell script?

--
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages