-
Notifications
You must be signed in to change notification settings - Fork 79
Add dir_length option #274
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
|
Sorry for not responding to this sooner, can you fix the merge conflicts on this? I'm happy to look it over this week and help get it merged, I know people will appreciate this feature! |
be00682 to
6131288
Compare
User can use dir_length config for the session name. Defaults to 1 if empty dir_length = 2
6131288 to
8c73c5e
Compare
|
No worries. I have rebased the branch. Do let know your thoughts! |
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 adds a new dir_length configuration option that allows users to control how many directory components are included in tmux session names, addressing the issue where sessions with identically named directories in different parent paths would collide.
Key Changes:
- Added
DirLengthfield tomodel.Configwith default value of 1 for backwards compatibility - Updated
dirName()function to support multi-component directory paths based on configuration - Modified
NewNamer()to accept config parameter and propagate it throughout the codebase
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| model/config.go | Added DirLength field to Config struct |
| namer/dir.go | Implemented logic to extract N directory components from paths |
| namer/dir_test.go | Added comprehensive test coverage for directory naming with various lengths |
| namer/namer.go | Updated constructor to accept and store config |
| namer/git.go | Modified to use dirName() for repository naming |
| namer/git_bare.go | Modified to use dirName() for bare repository naming |
| namer/root_git.go | Simplified error handling and switched to dirName() |
| configurator/configurator.go | Added validation to ensure DirLength defaults to 1 if not set |
| seshcli/root_command.go | Updated NewNamer() call to pass config |
| namer/namer_test.go | Updated all test cases to include config parameter |
| namer/git_test.go | Updated all test cases to include config parameter |
| go.mod | Moved lipgloss dependency from direct to indirect |
| README.md | Added documentation for the new configuration option |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
This looks good, thanks for your patience on this.
Add dir_length configuration option
Fixes: #272
This PR adds a new
dir_lengthconfiguration option that allows users to control how many directory components are included in session names.What's Changed
dir_lengthin sesh.toml (defaults to 1 for backwards compatibility)Problem
sesh only uses the current directory name, which won't work if you have the same directory name with different parent. In the example below, both will only refer to the same one
childsession:New changes
Configuration
Would love feedback on these changes. Thanks!