vinnymeller / twm

Tmux Workspace Manager
MIT License
35 stars 3 forks source link

Add -g option for attaching to existing group #20

Closed vinnymeller closed 6 months ago

vinnymeller commented 6 months ago

Adds an option -g/--group that opens a fuzzy finder with current sessions, and starts a new session in a group with the selected session

note: you can still use -g with -d and -n

closes #19

vinnymeller commented 6 months ago

@tombuntus do/can you build this yourself to see if this does what you're hoping? or do you just use binary from nix or something?

vinnymeller commented 6 months ago

i originally wanted to avoid adding a fuzzy search through existing sessions but i think it makes sense for this use case, so if this is working i'm also going to add -e/--existing to fuzzy find through open sessions and attach normally

tombuntus commented 6 months ago

I will try and build it later today. I have been giving this some thought and I wonder if a better workflow might be to just add an indicator alongside workspaces that already have a session in the regular twm workspace list, and then have enter attach to that session but ctrl+enter create a new session in a session group.

If we fuzzy find over existing sessions, then realise that the workspace we want to open doesn't have an existing session, we have to exit and relaunch twm to find the workspace and create a new session.

vinnymeller commented 6 months ago

@tombuntus i think both can coexist. e.g. i imagine that most of the time that I want to have a second session in a group, it's probably because I already have the original session open and thus obviously know that session exists. maybe not though?

but a factor I like about the current -g and -e implementation (which I didnt push yet but is same) is that it doesn't have to parse config or do any searching for workspaces, so its very snappy

but i agree adding something like a ctrl+enter to the normal twm to open a new group would be very neat

tombuntus commented 6 months ago

i imagine that most of the time that I want to have a second session in a group, it's probably because I already have the original session open and thus obviously know that session exists

This is probably fair. I do often forget that I already have a client attached to a session, but that's a different issue I think.

I have built this branch and yes it works 👌 A nice side effect is that I can see when I already have a session group I forgot about.