Skip to content

fix(tmux): sync genie.tmux.conf and auto-reload on update - #653

Merged
namastex888 merged 1 commit into
devfrom
fix-tmux-sync
Mar 18, 2026
Merged

namastex888 merged 1 commit into
devfrom
fix-tmux-sync

Conversation

@namastex888

Copy link
Copy Markdown
Contributor

Summary

  • syncTmuxScripts now also copies genie.tmux.conf to ~/.genie/scripts/ (previously only .sh files)
  • If ~/.tmux.conf starts with the genie header, it gets overwritten with the updated version
  • Automatically reloads tmux config via execSync('tmux source-file ~/.tmux.conf') after overwrite
  • Extracted syncTmuxConf helper to keep cognitive complexity within lint limits

Test plan

  • Typecheck passes (bun run typecheck)
  • Lint passes — 3 pre-existing warnings, no new ones
  • All 928 tests pass (bun test)
  • Dead-code check passes (bun run dead-code)
  • Manual: run genie update and verify ~/.genie/scripts/genie.tmux.conf exists
  • Manual: verify ~/.tmux.conf is overwritten when genie-managed
  • Manual: verify tmux reloads automatically after update

Wish: fix-tmux-dual-statusbar

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.
@coderabbitai

coderabbitai Bot commented Mar 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d7def7b4-2e63-4dd8-95bf-6ca568573efc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-tmux-sync
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 genie update command's interaction with tmux configurations. It streamlines the process of keeping genie-managed tmux settings up-to-date by ensuring the configuration file is synchronized and automatically reloaded, providing a more seamless experience for users.

Highlights

  • Tmux Configuration Sync: The syncTmuxScripts function now includes genie.tmux.conf for copying to ~/.genie/scripts/, expanding beyond just .sh files.
  • Automatic Tmux Reload: If ~/.tmux.conf is managed by Genie (indicated by a specific header), it will be automatically overwritten with the updated version and the tmux configuration will be reloaded.
  • Code Refactoring: A new helper function, syncTmuxConf, was extracted to manage the tmux configuration update and reload logic, improving code organization and maintaining lint limits for cognitive complexity.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@namastex888
namastex888 merged commit f63dd23 into dev Mar 18, 2026
6 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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' });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
execSync('tmux source-file ~/.tmux.conf', { stdio: 'ignore' });
execSync('tmux source-file "' + tmuxConfDest + '"', { stdio: 'ignore' });

@namastex888
namastex888 deleted the fix-tmux-sync branch March 29, 2026 22:10
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.

1 participant