Killing and Renaming Groups

37 views
Skip to first unread message

Jake Grossman

unread,
Sep 3, 2021, 2:00:44 PM9/3/21
to tmux-...@googlegroups.com
I was tinkering trying to implement one of the suggested features from https://github.com/tmux/tmux/issues/2346. First off, is anyone already doing this? Don't want to duplicate work!

Should it be a flag for the target, or it's own target (i.e. kill-session -g -t foo vs kill-session -g foo)? Which would be preferable?

Thanks,
Jake

Jake Grossman

unread,
Sep 3, 2021, 2:08:06 PM9/3/21
to tmux-users
I was leaning towards a flag, btw.

Nicholas Marriott

unread,
Sep 3, 2021, 2:17:18 PM9/3/21
to Jake Grossman, tmux-users
Hi

I'd probably go for -g with a group name. If -t is there as well you can either make it an error or only kill the group if the given session is in it.


--
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/CAMaYsBciVDpy85NCByzeejrHvJ0gAjLPp%2BMoOWfTv8WvaXa7tQ%40mail.gmail.com.

Jake Grossman

unread,
Sep 4, 2021, 2:20:21 PM9/4/21
to tmux-users
Hi,

I've gotten -g working for kill-session, but there are more kinks with adding -g to rename-session (it works, but I'm not happy with it. I feel there is more to do before it is ready for feedback). I've attached a patch for cmd-kill-session.c below.

I'm not super stoked about the updated usage or the error message for kill-session. I decided to implement it so -g with -t is an error, but I'm not sure how to indicate "either or" in the usage, or how to to tell the user they cannot use both. I'd love opinions on that, as well as anything else!
cmd-kill-session.patch

Nicholas Marriott

unread,
Sep 4, 2021, 2:22:58 PM9/4/21
to Jake Grossman, tmux-users
Thanks.

Don't worry about trying to indicate they are mutually exclusive in the usage, it can't show everything. Just add -g and if you like mention that it is invalid with -t in the text.

I'll look at the diff next week.



Jake Grossman

unread,
Sep 4, 2021, 9:05:54 PM9/4/21
to tmux-users
Hello,

Which do you think is the most appropriate behavior for combining -g and -t with rename-session:

  1.  don't allow it, behaves like kill-session
  2. change the group name of the group specified by -t
  3. change the group name of the group the session species by -t belongs to
Thanks!

Jake Grossman

unread,
Sep 4, 2021, 11:23:50 PM9/4/21
to tmux-users
Hello,

I realized I wasn't destroying the groups correctly (just deleting the sessions). I've updated the patch to reflect that change and attached it here. Unless there's anything you see when you look at the diff, I'm happy with it.

kill-session.patch

Nicholas Marriott

unread,
Sep 5, 2021, 2:49:34 AM9/5/21
to Jake Grossman, tmux-users
The two commands should behave the same wrt -g, so if you want kill-session not to allow it then make rename-session do also.



Reply all
Reply to author
Forward
0 new messages