Skip to content
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

feature: tmuxinator support #154

Closed
wants to merge 18 commits into from
Closed

Conversation

kadriandev
Copy link
Contributor

@kadriandev kadriandev commented Sep 3, 2024

Hey Josh,

Long time user of the T script and switched over to using sesh about a week ago. I've been loving it so far and I recently discovered tmuxinator as well and was looking for a way to make them work together. Originally I just started to muck around with the fzf-tmux binds and filters, but wasn't quite able to get the behavior I wanted so decided to try my hand at messing around in Go and maybe doing some open source (first time open source PR so please be easy on me).

I ended up adding list and connect support for tmuxinator configs using the -T flag. The solution isn't perfect because there are no safeguards currently for if tmuxinator is not installed, and my changes also cause some of the tests to fail. I'm really unfamiliar with the Go testing library, but I'll try and add tests and fix up any failing ones if needed. I also am not sure if using the -T flag is desirable.

Anyways, I've added some basic instructions on how to use the new commands, let me know what you think!

List Tmuxinator configurations using:
sesh list -T

Connect to sessions with Tmuxinator using:
sesh connect -T <configName>

@kadriandev kadriandev changed the title feature: Tmuxinator support feature: tmuxinator support Sep 3, 2024
@kadriandev
Copy link
Contributor Author

I realized that in the sesh config there was already a Tmuxinator config option that wasn't implemented yet so I scrapped the lister and tmuxinatorStrategy for the connector and used the configStrategy now with support for specifying the name of a Tmuxinator config

@joshmedeski
Copy link
Owner

Thanks, I'll look this over give some feedback in the next week.

@joshmedeski joshmedeski self-requested a review September 4, 2024 17:25
@joshmedeski
Copy link
Owner

It looks like the sesh list -T flag doesn't exist in the PR.

Can you check your local branch and make sure you've pushed everything?

@joshmedeski
Copy link
Owner

Here's a quick patch file that will fix the testing. You needed to update the test file to pass the mockTmuxifier as you defined it in the dependencies for the connector.

fix_test.patch

Download this file and run git apply fix_test.patch to apply it.

@kadriandev
Copy link
Contributor Author

It looks like the sesh list -T flag doesn't exist in the PR.

Can you check your local branch and make sure you've pushed everything?

Hi, I added a comment afterwards, I actually decided that implementing a new flag for tmuxinator was not the best way to go about a solution. Instead I added a Tmuxinator SessionConfig option to the sesh config files to specify a tmuxinator config name to use. This is what it would look like in sesh.toml:

[[session]]
name = "dotfiles"
path = "~/dotfiles"
tmuxinator = "dotfiles"

@joshmedeski
Copy link
Owner

I'm thinking listing tmuxinator configs and creating a custom strategy is still useful for tmuxinator users. The main thing that needs overwritten is the ability to create a new session via a custom command instead of tmux new -s . I will be working on it soon and would love you help! I stream on Thursday nights if you'd be interested in helping me then.

@kadriandev
Copy link
Contributor Author

I'm thinking listing tmuxinator configs and creating a custom strategy is still useful for tmuxinator users. The main thing that needs overwritten is the ability to create a new session via a custom command instead of tmux new -s . I will be working on it soon and would love you help! I stream on Thursday nights if you'd be interested in helping me then.

I'll join this Thursday!!

@joshmedeski
Copy link
Owner

Closing in favor of #171

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants