Skip to content

fix: tmux Wayland clipboard and serena mutable config - #786

Merged
shunkakinoki merged 3 commits into
mainfrom
fix/tmux-wayland-serena-config
Feb 12, 2026
Merged

fix: tmux Wayland clipboard and serena mutable config#786
shunkakinoki merged 3 commits into
mainfrom
fix/tmux-wayland-serena-config

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Feb 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • tmux: Add WAYLAND_DISPLAY and SWAYSOCK to update-environment so wl-copy/wl-paste work inside tmux sessions
  • serena: Replace home.file with an activation script so the config is a writable file instead of a read-only Nix store symlink

Test plan

  • Start a new tmux session and verify pwd | wl-copy works
  • Verify ~/.serena/serena_config.yml is a regular writable file after make switch

Summary by cubic

Fix Wayland clipboard in tmux by adding WAYLAND_DISPLAY and SWAYSOCK to update-environment, show seconds in the tmux clock, and change the Hyprland clipse shortcut to $mod+Ctrl+V to avoid xremap conflicts. Make Serena config writable by replacing the read-only home.file symlink with an activation script that copies serena_config.yml to ~/.serena and sets permissions.

Written for commit 4a1f97a. Summary will update on new commits.

Add WAYLAND_DISPLAY and SWAYSOCK so clipboard tools like
wl-copy work inside tmux sessions.

fix(serena): use activation script for mutable config file

Replace home.file with activation script so the config file
is a regular writable file instead of a read-only symlink.
Copilot AI review requested due to automatic review settings February 11, 2026 17:54
@mesa-dot-dev

mesa-dot-dev Bot commented Feb 11, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@coderabbitai

coderabbitai Bot commented Feb 11, 2026

Copy link
Copy Markdown
📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Tmux timestamps now display seconds in the status bar.
    • Added Wayland environment support to tmux.
  • Chores

    • Updated clipboard manager keyboard shortcut.
  • Refactor

    • Improved configuration file management and permissions handling.

Walkthrough

Three configuration files are updated: a Hyprland clipboard keybinding is modified to avoid xremap conflicts, Serena's configuration file deployment switches from direct home.file writing to an activation-based copying approach, and tmux gains Wayland environment variable propagation with enhanced timestamp precision.

Changes

Cohort / File(s) Summary
Hyprland Keybinding
config/hyprland/hyprland.conf
Replaced CTRL ALT SHIFT SUPER+V binding with mod+CTRL+V for clipboard manager to avoid xremap conflict; added explanatory comment.
Serena Configuration Deployment
config/serena/default.nix
Migrated file deployment from direct home.file approach to activation-based script that creates directory, copies serena_config.yml, and sets write permissions post-writeBoundary.
Tmux Environment & Display
home-manager/programs/tmux/tmux.conf
Added WAYLAND_DISPLAY and SWAYSOCK to environment propagation list; extended status-right timestamp format to include seconds.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

bug

Poem

🐰 A key here, a path there,
Config tweaks with utmost care,
Xremap conflicts now at bay,
Wayland whispers light the way,
Time marches on, second by second—
The dotfiles realm has reckoned!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately summarizes the main changes: fixing Wayland clipboard support in tmux and making serena config writable, which are the primary objectives of the changeset.
Description check ✅ Passed The description provides clear context for the changes, including specific technical details about WAYLAND_DISPLAY/SWAYSOCK variables, the activation script approach, and a concrete test plan aligned with the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/tmux-wayland-serena-config

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
home-manager/programs/tmux/tmux.conf (1)

28-28: Pre-existing: copy-mode bindings still reference macOS-only tools.

Lines 28 and 62 use pbcopy and reattach-to-user-namespace pbcopy, which won't work on Wayland. Since this PR is specifically improving Wayland clipboard support, consider updating these to use wl-copy (or a wrapper that detects the platform).

Also applies to: 62-62

config/serena/default.nix (1)

8-8: Nit: dirname call is unnecessary given the static path.

Since serenaConfigDest always resolves to ~/.serena/serena_config.yml, you could simplify to:

Suggested simplification
-    mkdir -p "$(dirname "${serenaConfigDest}")"
+    mkdir -p "${config.home.homeDirectory}/.serena"

That said, the current form is more resilient to path changes, so this is purely stylistic.


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 @shunkakinoki, 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 enhances user experience by enabling Wayland clipboard operations within tmux sessions and improving the flexibility of the Serena application's configuration. The changes ensure that Wayland-specific environment variables are propagated to tmux, allowing clipboard tools to function correctly, and refactor the Serena configuration to be directly editable by the user.

Highlights

  • tmux Wayland Clipboard: Enabled wl-copy and wl-paste functionality within tmux sessions by adding WAYLAND_DISPLAY and SWAYSOCK to the update-environment setting.
  • Serena Mutable Config: Modified the Serena configuration management to use an activation script instead of home.file, allowing serena_config.yml to be a writable file rather than a read-only symlink.
Changelog
  • config/serena/default.nix
    • Replaced home.file with a home.activation script to manage serena_config.yml.
    • Ensured serena_config.yml is copied and made writable if it doesn't exist or is a symlink.
  • home-manager/programs/tmux/tmux.conf
    • Added WAYLAND_DISPLAY and SWAYSOCK to the update-environment option.
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

@mesa-dot-dev

mesa-dot-dev Bot commented Feb 11, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Fixes Wayland clipboard in tmux sessions by adding WAYLAND_DISPLAY and SWAYSOCK to update-environment, and makes the Serena configuration mutable by replacing a read-only symlink with an activation script. Also updates the tmux status bar clock to show seconds.

What changed?

  • config/serena/default.nix: Updated serena_config.yml management to use a home.activation script, ensuring the config file is copied (if it doesn't exist or is a symlink) and is writable, rather than being a read-only Nix store symlink.
  • home-manager/programs/tmux/tmux.conf: Modified tmux configuration to include WAYLAND_DISPLAY and SWAYSOCK in update-environment for Wayland clipboard support within tmux sessions. Also, updated the status bar time format to display seconds.

Description generated by Mesa. Update settings

@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 introduces two fixes. The update to the tmux configuration correctly adds WAYLAND_DISPLAY and SWAYSOCK to update-environment, enabling Wayland clipboard utilities within tmux sessions. The change for the Serena configuration switches from a Nix-managed symlink to a user-writable file using a home-manager activation script. While this approach is sound, I've identified a minor issue in the script's logic that could cause problems in an edge case and have suggested a more robust implementation.

Comment thread config/serena/default.nix
};
home.activation.serenaConfig = config.lib.dag.entryAfter [ "writeBoundary" ] ''
mkdir -p "$(dirname "${serenaConfigDest}")"
if [ ! -f "${serenaConfigDest}" ] || [ -L "${serenaConfigDest}" ]; then

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 current condition [ ! -f "${serenaConfigDest}" ] || [ -L "${serenaConfigDest}" ] can lead to unexpected behavior. If ${serenaConfigDest} points to a directory, [ ! -f ... ] evaluates to true, causing the script to attempt rm -f on a directory. This will fail and is likely not the intended behavior.

Using [ ! -e "${serenaConfigDest}" ] || [ -L "${serenaConfigDest}" ] is more robust. It correctly triggers the copy only if the destination doesn't exist or is a symlink, and it correctly does nothing if it's an existing file or directory.

    if [ ! -e "${serenaConfigDest}" ] || [ -L "${serenaConfigDest}" ]; then

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 2 files

Copilot AI 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.

Pull request overview

Updates Home Manager configuration to improve Wayland clipboard behavior inside tmux and to make Serena’s config file writable (not a Nix store symlink), aligning runtime behavior with tool expectations.

Changes:

  • Extend tmux update-environment to carry Wayland/Sway session variables into tmux sessions.
  • Replace Serena home.file (store symlink) with an activation-time copy into ~/.serena/ to keep the config writable/persistent.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
home-manager/programs/tmux/tmux.conf Adds WAYLAND_DISPLAY and SWAYSOCK to tmux’s environment update list to support Wayland clipboard tooling inside tmux.
config/serena/default.nix Switches Serena config provisioning from a Nix symlink to an activation script that materializes a writable file under ~/.serena/.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread config/serena/default.nix
Comment on lines +8 to +12
mkdir -p "$(dirname "${serenaConfigDest}")"
if [ ! -f "${serenaConfigDest}" ] || [ -L "${serenaConfigDest}" ]; then
rm -f "${serenaConfigDest}"
cp "${serenaConfigSrc}" "${serenaConfigDest}"
chmod u+w "${serenaConfigDest}"

Copilot AI Feb 11, 2026

Copy link

Choose a reason for hiding this comment

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

Activation snippet performs filesystem mutations (mkdir/rm/cp/chmod) without using Home Manager’s $DRY_RUN_CMD, so home-manager switch --dry-run (and similar tooling) will still modify the real filesystem. Please prefix these commands with $DRY_RUN_CMD (consistent with other activation entries in this repo) so dry-runs remain side-effect free.

Suggested change
mkdir -p "$(dirname "${serenaConfigDest}")"
if [ ! -f "${serenaConfigDest}" ] || [ -L "${serenaConfigDest}" ]; then
rm -f "${serenaConfigDest}"
cp "${serenaConfigSrc}" "${serenaConfigDest}"
chmod u+w "${serenaConfigDest}"
$DRY_RUN_CMD mkdir -p "$(dirname "${serenaConfigDest}")"
if [ ! -f "${serenaConfigDest}" ] || [ -L "${serenaConfigDest}" ]; then
$DRY_RUN_CMD rm -f "${serenaConfigDest}"
$DRY_RUN_CMD cp "${serenaConfigSrc}" "${serenaConfigDest}"
$DRY_RUN_CMD chmod u+w "${serenaConfigDest}"

Copilot uses AI. Check for mistakes.
The Hyper+V (CTRL ALT SHIFT SUPER V) binding for clipse TUI was being
intercepted by xremap and remapped to Ctrl+V (paste), preventing the
clipboard manager from opening. Change to $mod+Ctrl+V which bypasses
xremap.
@shunkakinoki
shunkakinoki merged commit a1131ea into main Feb 12, 2026
33 checks passed
@shunkakinoki
shunkakinoki deleted the fix/tmux-wayland-serena-config branch February 12, 2026 11:16
@coderabbitai coderabbitai Bot mentioned this pull request Apr 20, 2026
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.

2 participants