fix(tmux): sync genie.tmux.conf and auto-reload on update - #653
Conversation
syncTmuxScripts now also copies genie.tmux.conf to ~/.genie/scripts/, overwrites ~/.tmux.conf when it contains the genie header, and reloads tmux automatically. Extracted syncTmuxConf helper to keep complexity within lint limits.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request enhances the update command to synchronize genie.tmux.conf and automatically reload the tmux configuration upon updates. The logic is encapsulated in a new syncTmuxConf function, which is a good separation of concerns. The changes correctly handle file permissions for the configuration file. I have one suggestion to make the tmux reload command more robust by using an explicit path.
| success('Updated ~/.tmux.conf (genie-managed)'); | ||
|
|
||
| try { | ||
| execSync('tmux source-file ~/.tmux.conf', { stdio: 'ignore' }); |
There was a problem hiding this comment.
The execSync call uses a hardcoded path with ~, which relies on shell expansion and can be brittle (e.g., with spaces in the home directory path). It's more robust to use the tmuxConfDest variable, which holds the full path, and to quote it.
| execSync('tmux source-file ~/.tmux.conf', { stdio: 'ignore' }); | |
| execSync('tmux source-file "' + tmuxConfDest + '"', { stdio: 'ignore' }); |
Summary
syncTmuxScriptsnow also copiesgenie.tmux.confto~/.genie/scripts/(previously only.shfiles)~/.tmux.confstarts with the genie header, it gets overwritten with the updated versionexecSync('tmux source-file ~/.tmux.conf')after overwritesyncTmuxConfhelper to keep cognitive complexity within lint limitsTest plan
bun run typecheck)bun test)bun run dead-code)genie updateand verify~/.genie/scripts/genie.tmux.confexists~/.tmux.confis overwritten when genie-managedWish: fix-tmux-dual-statusbar