Skip to content

feat: add tmux clipboard yank bindings and LSP packages - #795

Merged
shunkakinoki merged 2 commits into
mainfrom
feat/tmux-clipboard-and-lsp-packages
Feb 13, 2026
Merged

feat: add tmux clipboard yank bindings and LSP packages#795
shunkakinoki merged 2 commits into
mainfrom
feat/tmux-clipboard-and-lsp-packages

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Feb 13, 2026

Copy link
Copy Markdown
Owner

Changes

  • Replace tmux Ctrl+B P file-save capture with clipboard-based yank bindings
  • Add Ctrl+B y to copy full pane history to clipboard
  • Add Ctrl+B v to copy visible pane to clipboard
  • Add isLSP flag in lib/host.nix for conditional LSP package installation
  • Add LSP packages: gopls, lua-language-server, nil, typescript-language-server, pyright

Technical Details

  • Uses run-shell with capture-pane -p | pbcopy to avoid the "Can't write to client" error from chained tmux commands
  • isLSP follows the same pattern as isDesktop — defaults to true, can be overridden per-host
  • Excluded rust-analyzer since rustup already provides it

Testing

  • Built and switched successfully on macOS (galactica)
  • Verified capture-pane -p | pbcopy pipeline works end-to-end
  • Confirmed no conflicts with existing tmux bindings

Generated with Claude Code


Summary by cubic

Switch tmux from saving pane output to a file to copying to the clipboard, and add a per-host isDev toggle for installing LSP packages. This makes copying output easier and lets hosts opt into language servers.

  • New Features
    • Tmux: Ctrl+B y copies full pane history; Ctrl+B v copies visible pane; replaces the old Ctrl+B P file-save.
    • Host config: isDev flag (default true) to conditionally install LSPs: gopls, lua-language-server, nil, typescript-language-server, pyright (rust-analyzer excluded via rustup).

Written for commit 78836f2. Summary will update on new commits.

- Replace capture-pane file save with clipboard copy via pbcopy
- Add Ctrl+B y for full pane history and Ctrl+B v for visible pane
- Add isLSP flag to lib/host.nix for conditional LSP installation
- Add gopls, lua-language-server, nil, typescript-language-server, pyright

Entire-Checkpoint: e6097874141f
Copilot AI review requested due to automatic review settings February 13, 2026 13:58
@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 the development environment by improving tmux's clipboard integration and introducing a flexible mechanism for installing Language Server Protocol tools. These changes allow for more efficient text manipulation within tmux and provide a configurable way to manage development tooling based on host-specific needs.

Highlights

  • Tmux Clipboard Bindings: Replaced the file-save capture for tmux Ctrl+B P with new clipboard-based yank bindings.
  • Tmux Clipboard Bindings: Introduced Ctrl+B y to copy the full pane history to the system clipboard.
  • Tmux Clipboard Bindings: Added Ctrl+B v to copy only the visible content of a pane to the system clipboard.
  • LSP Configuration: Implemented an isLSP flag in lib/host.nix to enable conditional installation of Language Server Protocol (LSP) packages.
  • LSP Packages: Included several LSP packages: gopls, lua-language-server, nil, typescript-language-server, and pyright, which are installed when isLSP is active.
Changelog
  • home-manager/packages/default.nix
    • Imported the new isLSP flag from inputs.host.
    • Conditionally added a list of LSP packages (gopls, lua-language-server, nil, typescript-language-server, pyright) based on the isLSP flag.
  • home-manager/programs/tmux/tmux.conf
    • Removed the bind P command that saved pane history to a file.
    • Added bind y to capture full pane history and pipe it to pbcopy.
    • Added bind v to capture the visible pane content and pipe it to pbcopy.
  • lib/host.nix
    • Defined a new isLSP attribute, defaulting to true, to control LSP package installation.
Activity
  • Built and switched successfully on macOS (galactica).
  • Verified the capture-pane -p | pbcopy pipeline works end-to-end.
  • Confirmed no conflicts with existing tmux bindings.
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.

@coderabbitai

coderabbitai Bot commented Feb 13, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • New Features
    • Development tooling now conditionally available, including language servers for Go, Lua, TypeScript, and Python
    • Linux-specific tools and desktop applications available based on environment detection
    • Tmux pane history can now be copied to clipboard via new key bindings for full and visible pane content

Walkthrough

The PR introduces a new isDev configuration flag and expands package management in home-manager. It adds conditional language server packages (gopls, pyright, nil, etc.) when isDev is enabled, introduces Linux-specific development tools, adds desktop environment application groups, and updates tmux keybindings from file-based history capture to clipboard-based operations.

Changes

Cohort / File(s) Summary
Development Flag & Package Configuration
lib/host.nix, home-manager/packages/default.nix
Introduces isDev boolean attribute in host configuration and uses it to conditionally include language servers and development tools (gopls, pyright, lua-language-server, etc.). Also adds Linux-specific development tooling and desktop environment applications with system-conditional guards.
Tmux Keybinding Updates
home-manager/programs/tmux/tmux.conf
Replaces previous pane history file-save binding with two new clipboard-based keybindings: y for full pane history and v for visible pane content, both using pbcopy for clipboard integration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • #790: Directly modifies the same tmux.conf keybindings being replaced in this PR (adds the "P" binding that this PR removes).
  • #301: Modifies home-manager/packages/default.nix to add/remove CLI tools and adjusts conditional package groupings similarly.
  • #345: Updates conditional package groups in home-manager/packages/default.nix for Linux/desktop environments with similar structural patterns.

Poem

🐰 With isDev flags now set and true,
Language servers arrive right on cue,
Tmux gets clipboards instead of files to keep,
The config grows deeper, but changes stay neat!

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/tmux-clipboard-and-lsp-packages

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.

@mesa-dot-dev

mesa-dot-dev Bot commented Feb 13, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Replaced tmux file-save capture with clipboard yank bindings and introduced a configurable isLSP flag for conditional Language Server Protocol (LSP) package installation.

What changed?

  • home-manager/packages/default.nix: Conditionally includes LSP packages (gopls, lua-language-server, nil, nodePackages.typescript-language-server, pyright) based on the new isLSP variable.
  • home-manager/programs/tmux/tmux.conf: Removed bind P for saving pane history to a file. Added bind y to copy full pane history to clipboard and bind v to copy visible pane content to clipboard.
  • lib/host.nix: Introduced a new isLSP configuration option, defaulting to true, to control the installation of language server packages.

Description generated by Mesa. Update settings

@mesa-dot-dev

mesa-dot-dev Bot commented Feb 13, 2026

Copy link
Copy Markdown

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

Entire-Checkpoint: 3a40568b76ee
@shunkakinoki
shunkakinoki merged commit b6df879 into main Feb 13, 2026
7 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 introduces new tmux bindings for copying pane content to the clipboard and adds conditional installation of LSP packages. The changes are well-structured. I've suggested an improvement to the tmux configuration to make the new clipboard bindings cross-platform, working on both macOS and Linux, which aligns with the apparent goal of portability in your dotfiles.

Comment on lines +93 to +94
bind y run-shell 'tmux capture-pane -pS - | pbcopy && tmux display-message "Full pane history copied to clipboard"'
bind v run-shell 'tmux capture-pane -p | pbcopy && tmux display-message "Visible pane copied to clipboard"'

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 use of pbcopy makes these bindings specific to macOS. To make your configuration more portable and work on Linux systems (both X11 and Wayland), you could use a shell fallback mechanism. Your Nix configuration already installs xclip and wl-clipboard for Linux. This change will attempt to use pbcopy first (for macOS), then wl-copy (for Wayland), and finally xclip (for X11).

bind y run-shell 'tmux capture-pane -pS - | (pbcopy || wl-copy || xclip -in -selection clipboard) && tmux display-message "Full pane history copied to clipboard"'
bind v run-shell 'tmux capture-pane -p | (pbcopy || wl-copy || xclip -in -selection clipboard) && tmux display-message "Visible pane copied to clipboard"'

@shunkakinoki
shunkakinoki deleted the feat/tmux-clipboard-and-lsp-packages branch February 13, 2026 14:00

@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 3 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

This PR adds tmux clipboard yank bindings and introduces conditional LSP package installation. It replaces the previous file-save capture binding with clipboard-based commands and adds a feature flag system for managing LSP package installation across different hosts.

Changes:

  • Added isLSP flag to enable/disable LSP package installation per-host
  • Replaced tmux file-save pane capture with clipboard yank bindings for full and visible pane content
  • Added 5 LSP packages (gopls, lua-language-server, nil, typescript-language-server, pyright) with conditional installation

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
lib/host.nix Adds isLSP boolean flag (defaults to true) for controlling LSP package installation
home-manager/programs/tmux/tmux.conf Replaces Ctrl+B P file-save binding with Ctrl+B y (full pane) and Ctrl+B v (visible pane) clipboard yank bindings using pbcopy
home-manager/packages/default.nix Imports isLSP flag and adds conditional LSP package list using lib.optionals

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

Comment on lines +93 to +94
bind y run-shell 'tmux capture-pane -pS - | pbcopy && tmux display-message "Full pane history copied to clipboard"'
bind v run-shell 'tmux capture-pane -p | pbcopy && tmux display-message "Visible pane copied to clipboard"'

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

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

The pbcopy command is macOS-specific and will fail on Linux systems. The codebase already has xclip installed on Linux (see home-manager/packages/default.nix line 126), and the tmux yank plugin is already configured. Consider using platform-conditional logic or relying on the tmux yank plugin which handles cross-platform clipboard operations automatically. Alternatively, use a shell conditional like command -v pbcopy >/dev/null && pbcopy || xclip -selection clipboard to handle both platforms.

Suggested change
bind y run-shell 'tmux capture-pane -pS - | pbcopy && tmux display-message "Full pane history copied to clipboard"'
bind v run-shell 'tmux capture-pane -p | pbcopy && tmux display-message "Visible pane copied to clipboard"'
bind y run-shell 'tmux capture-pane -pS - | sh -c "command -v pbcopy >/dev/null 2>&1 && pbcopy || xclip -selection clipboard" && tmux display-message "Full pane history copied to clipboard"'
bind v run-shell 'tmux capture-pane -p | sh -c "command -v pbcopy >/dev/null 2>&1 && pbcopy || xclip -selection clipboard" && tmux display-message "Visible pane copied to clipboard"'

Copilot uses AI. Check for mistakes.
Comment thread lib/host.nix
isDesktop = false;

# Install language server packages
isDev = true;

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

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

The new isLSP flag in lib/host.nix lacks test coverage. Following the established pattern seen with isDesktop and other host flags in tests/lib.nix (lines 54-58), a test should be added to validate that isLSP exists and is a boolean. This ensures consistency with the testing conventions used for other configuration flags in lib/host.nix.

Suggested change
isDev = true;
isLSP = true;
isDev = isLSP;

Copilot uses AI. Check for mistakes.
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