-
Notifications
You must be signed in to change notification settings - Fork 80
Multiple windows for session configuration in sesh.toml #237
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
Conversation
|
Any reason specifically you change this? |
|
Is this going to be for #201? |
|
Yes. I changed to go env go path mainly for myself as the GOPATH bar is not in my environment and I thought other people might have a similar problem. However, adding the variable to my env would not be an issue so I can undo this if you want. |
…window to be created
|
Thanks, I'll look this over and provide feedback this week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces multi-window support for session configuration through the sesh.toml file by adding new commands and configuration options.
- Added NewWindow and NextWindow functions in the tmux package and their associated mock methods.
- Extended session and configuration models to support a list of window configurations.
- Updated the session listing and connector logic to leverage the new window definitions.
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tmux/tmux.go | Added NewWindow and NextWindow functions to initiate new windows. |
| tmux/mock_Tmux.go | Added mocks for the new tmux window functions. |
| model/sesh_session.go | Extended session model to include window configurations. |
| model/config.go | Defined WindowConfig and added windows array to configuration models. |
| lister/config.go | Updated configuration parsing to map and assign window settings. |
| connector/tmux.go | Implemented multi-window startup in session connector. |
| README.md | Updated documentation to cover the new multi-window configuration. |
Files not reviewed (1)
- Makefile: Language not supported
joshmedeski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, it's a solid idea and simple interface. I'm still hesitant to integrate complicated tooling like this, because so many other existing tools already exist list tmuxinator, or even just simple bash scripts, that make it more flexible without sesh having to deal with the overhead of bugs and additional feature requests (like panes).
What do you think? Have you tried other tmux project scaffolding tools and how do you think it compares to this?
Thanks again for putting in the work, it's a great start and if we agree that this is a good idea to expand on then I'm happy to continue through the code review process and get this merged soon.
|
I used to use tmuxifier which worked with shell scripts, however I recently moved to NixOS and tmuxifier is not in nixpkgs. For some reason, I never came across tmuxinator and found this as well. As I really liked the multi-window feature in tmuxifier I tried to reproduce it here. |
joshmedeski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After examining the window logic I'm realizing now there is a better place for it, once you move it I'll do some final testing and merge!
Overall, I really like how composable this approach is and I could see myself using it for my own workflow 😁
joshmedeski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this work!
|
Would it be possible to get a new release with this functionality included? Redoing my dev setup and would love to make use of it |
|
Yes, I was waiting for one more feature to be complete. But I may just move forward with a release! |
|
Hey, that's a really nice feature that I've been waiting for. [default_session]
windows = [ "nvim", "terminal" ]
[[window]]
name = "nvim"
startup_script = "nvim"
disable_startup_script = false
[[window]]
name = "terminal"Before, I just used an sh script that I run on every default session. Also, I don't know if that's the right place to ask, I can move it to discussions if needed! |
|
@jakmaz I think |
Changes
Makefile: changed togo env GOPATHin case you don't haveGOPATHin your env.WindowConfigtype to be loaded from toml file.SessionConfigthat will be matched toWindowConfigstruct later on.SeshSessionto be used when starting the session.NewWindowfunction.NextWindowfunction to be used to go to last window of session when session is started with multiple windows.Result
You can now define windows in the configuration file. There are four different configuration options. If
pathis omitted, the session's path will be used.Then, you can populate the
windowsarray in session configurations with the names of the windows that the session will use.