Skip to content

fix(tmux): restore scrollback — history-limit 0 means zero lines not unlimited - #937

Merged
shunkakinoki merged 3 commits into
mainfrom
fix/tsh-string-replace-pattern
Feb 26, 2026
Merged

fix(tmux): restore scrollback — history-limit 0 means zero lines not unlimited#937
shunkakinoki merged 3 commits into
mainfrom
fix/tsh-string-replace-pattern

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Feb 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • history-limit 0 in tmux means zero lines of scrollback (not unlimited), which completely breaks pane scrolling
  • This was introduced in fix(tmux): use run-shell guard to prevent duplicate session loggers #934 (c7ae4d77) which mistakenly assumed 0 = unlimited
  • Fix: use 2147483647 (max int32), the largest value tmux accepts, giving effectively unlimited scrollable history

Test plan

  • Reload tmux config: prefix + t
  • Verify scrollback works: produce output, then scroll up with prefix + [

Fixes regression from #934.


Summary by cubic

Restore tmux scrollback by setting history-limit to 2147483647 (max int) instead of 0, which disabled history. Also fix the fish _tsh_function by adding -- to string replace -r so the '--YYYYMMDD-HHMMSS.txt' regex is parsed correctly.

Written for commit 725ed92. Summary will update on new commits.

history-limit 0 means zero scrollback lines in tmux (not unlimited),
which breaks pane scrolling. Use 2000000 for effectively unlimited history.

Fixes regression introduced in #934.

Entire-Checkpoint: bc5f589eaa45
@mesa-dot-dev

mesa-dot-dev Bot commented Feb 26, 2026

Copy link
Copy Markdown

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

@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 resolves a critical regression in tmux configurations that resulted in broken pane scrolling. It rectifies an incorrect interpretation of the history-limit setting, ensuring that tmux sessions now provide a substantial scrollback history as intended, thereby restoring expected user functionality.

Highlights

  • Tmux Scrollback Fix: Corrected the history-limit setting in tmux from 0 (which means zero scrollback) to 2000000, effectively restoring a large, scrollable history.
  • Regression Addressed: Fixed a regression introduced in a previous pull request (fix(tmux): use run-shell guard to prevent duplicate session loggers #934) where history-limit 0 was mistakenly assumed to provide unlimited scrollback, leading to broken pane scrolling.
Changelog
  • home-manager/programs/fish/functions/_tsh_function.fish
    • Updated the string replace command to correctly handle file name parsing by adding a -- argument.
  • home-manager/programs/tmux/tmux.conf
    • Modified the history-limit setting from 0 to 2000000 to restore proper scrollback functionality.
Activity
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 26, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Two minor configuration and syntax adjustments across home-manager programs: a fish shell function receives a syntax fix for argument parsing with the -- separator in string replacement, and tmux configuration increases per-session history retention from 0 to 2,000,000 lines.

Changes

Cohort / File(s) Summary
Fish Function Syntax Fix
home-manager/programs/fish/functions/_tsh_function.fish
Added -- separator after -r flag in string replacement invocation to ensure regex pattern is treated as a literal argument rather than a potential option.
Tmux History Configuration
home-manager/programs/tmux/tmux.conf
Increased history-limit from 0 to 2,000,000 to expand per-session history capacity.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰✨ Two tiny fixes, so neat and so fine,
A dash here, a number, the config's divine!
Fish parses correctly, tmux remembers it all,
Small changes that make a big difference, once and for all! 📜

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main fix: restoring tmux scrollback by clarifying that history-limit 0 means zero lines, not unlimited.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The description clearly relates to the changeset, explaining the tmux history-limit fix and the fish function syntax correction with supporting context.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/tsh-string-replace-pattern

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 26, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Restored tmux scrollback by setting history-limit to the maximum integer value, and fixed the _tsh_function in fish by adding a -- argument to string replace to correctly parse regex patterns.

What changed?

  • home-manager/programs/fish/functions/_tsh_function.fish: Modified the string replace command to include a -- argument for correct parsing of regular expressions used to remove timestamp suffixes from filenames.
  • home-manager/programs/tmux/tmux.conf: Updated the history-limit to 2147483647 (max int32) to provide effectively unlimited scrollback history in tmux sessions, resolving an issue where 0 mistakenly disabled history.

Description generated by Mesa. Update settings

@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

@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 addresses a regression in the tmux configuration by correcting the history-limit setting. The previous value of 0 disabled scrollback, and this change sets it to a large number to restore it. I have one suggestion regarding the specific value used to ensure it aligns with the intention described in the pull request. A small, unrelated fix in a fish script is also included and appears correct.

Comment thread home-manager/programs/tmux/tmux.conf Outdated
set -g @extrakto_key 'tab'

set -g history-limit 0
set -g history-limit 2000000

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

There's a discrepancy between the value for history-limit mentioned in the pull request description (2147483647) and the one implemented in the code (2000000). To align with the stated goal of using the maximum possible scrollback history that tmux supports, I recommend using the value from the description.

set -g history-limit 2147483647

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@home-manager/programs/tmux/tmux.conf`:
- Line 157: The tmux config currently sets "history-limit" to 2000000 but the PR
states the intended effectively-unlimited value is 2147483647; update the
tmux.conf setting for history-limit (the "set -g history-limit" line) to
2147483647 so the implementation matches the PR intent, or alternatively update
the PR description to state 2000000 if you prefer to keep the current value—make
the change to one of those two places to keep intent and code consistent.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 24914ff and 0dd93f1.

📒 Files selected for processing (2)
  • home-manager/programs/fish/functions/_tsh_function.fish
  • home-manager/programs/tmux/tmux.conf

Comment thread home-manager/programs/tmux/tmux.conf Outdated
Use max allowed value instead of 2000000 for effectively unlimited
scrollback. tmux has no true "unlimited" option; 0 means zero lines.

Entire-Checkpoint: c0a025d46363
@shunkakinoki
shunkakinoki merged commit fcc4896 into main Feb 26, 2026
6 checks passed
@shunkakinoki
shunkakinoki deleted the fix/tsh-string-replace-pattern branch February 26, 2026 04:20
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