Skip to content

feat: tmux ポップアップで現在セッションのペインを一覧・ジャンプ#19

Merged
stlwolf merged 2 commits into
masterfrom
feature/#18_tmux_claude_picker
Jun 3, 2026
Merged

feat: tmux ポップアップで現在セッションのペインを一覧・ジャンプ#19
stlwolf merged 2 commits into
masterfrom
feature/#18_tmux_claude_picker

Conversation

@stlwolf
Copy link
Copy Markdown
Owner

@stlwolf stlwolf commented Jun 3, 2026

Summary

  • prefix + g で fzf ポップアップを開き、現在セッションのウィンドウ/ペイン一覧から Claude/Codex を識別してジャンプできる bin/tmux-claude-picker を追加
  • pane_title の稼働グリフ(✳/braille)を主・semver/codex* cmd を従に CC/CX タグ付け
  • 右側に対象ペインのスクロールバック(-S -200)をプレビュー、ウィンドウ番号先頭・昇順・分割ウィンドウは でぶら下げ表示
  • スコープを現在セッションに限定(他セッションはオーケストレーション産物のアイドルシェルが大半でノイズになるため)
  • セカンドオピニオン(Codex / Claude)を2回取得:設計レビュー(実装前)+脆弱性/バグレビュー(コミット後)。RCE なし、指摘(中1+低4)を全修正済み(pid 検証で改行インジェクション遮断、C0制御文字除去、$SELF 引用、レースガード)

Test plan

  • prefix + g(C-Space → g)でポップアップが開く
  • 現在セッションのウィンドウ/ペインのみ表示される(他セッションのアイドルシェルが出ない)
  • Claude ペインに CC タグ・稼働グリフが付く
  • 右ペインに対象ペインのスクロールバックがプレビューされる
  • Enter で該当ペインへフォーカス移動
  • ctrl-r で一覧を更新
  • make lint(shellcheck -x)が my 2 files に指摘なし
  • make validate が OK

Refs #18

🤖 Generated with Claude Code

stlwolf and others added 2 commits June 3, 2026 22:27
Stage: implementation — new bin/tmux-claude-picker + prefix+g binding

複数の Claude Code / Codex セッションを並行運用すると「どのペインがどの作業か」
を見失うため、prefix+g で fzf ポップアップを開き現在セッションのウィンドウ/ペインを
一覧してジャンプできるようにする。pane_title の稼働グリフ(✳/braille)を主・semver
/codex* cmd を従に AI ペインを CC/CX タグ付けし、右にスクロールバックをプレビュー。

スコープは現在セッションのみ(他セッションはオーケストレーションが立てるアイドル
シェルが大半でノイズになるため)。ウィンドウ番号を先頭に昇順表示し、分割ウィンドウの
2ペイン目以降は連結子でぶら下げる。AI 判定は .tmux.conf の automatic-rename-format
と同じヒューリスティックで、クロス参照コメントを両方に記載。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Stage: hardening — applied after a security/bug second-opinion review (Codex + Claude)

セカンドオピニオン(Codex/Claude)のレビュー指摘に対応。RCE は無かったが中リスク1件+
低リスク数件を修正:

- pane_title / pane_current_path は OSC タイトルやディレクトリ名経由で任意値になり得る。
  改行を含むと `tmux -F` 出力が複数行に割れ、fzf に偽候補行を注入できた(fold が read の
  後にあり \n 除去は死コードだった)。read 後に pane_id(%N) を検証して分割フラグメント行を
  破棄。複数行タイトルで一覧が壊れる潜在バグも同時に解消。
- 表示文字列から C0 制御文字(ESC/CR/tab 等)を除去し、ANSI/カーソル制御による表示
  スプーフィングを防止。
- fzf reload バインド内で $SELF を引用(空白/メタ文字を含むパスでの破綻防止)。
- 選択〜ジャンプ間でペインが閉じた場合に select-window/select-pane を握り、set -e に
  よる粗い異常終了を回避。

なお tmux 側 `#{s/...}` での正規化案は 3.5a で制御文字に非対応(\t 非エスケープ /
[[:cntrl:]] が空)を実機確認したため不採用、シェル側で対応した。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@stlwolf stlwolf self-assigned this Jun 3, 2026
@stlwolf stlwolf requested a review from Copilot June 3, 2026 14:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a tmux+fzf popup picker to list panes in the current tmux session, tag likely Claude/Codex panes (CC/CX), preview scrollback, and jump focus to the selected pane via a new prefix + g binding in this dotfiles repo.

Changes:

  • Add bin/tmux-claude-picker: lists panes for the current session, runs fzf with scrollback preview, and jumps to the chosen pane.
  • Add .tmux.conf keybind: prefix + g opens the picker via display-popup using an absolute script path.

Reviewed changes

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

File Description
bin/tmux-claude-picker New bash utility to list/preview panes in the current session and jump to a selected pane via fzf.
.tmux.conf Adds prefix + g popup binding that launches the new picker script.

@stlwolf stlwolf merged commit 54dfc51 into master Jun 3, 2026
1 check passed
@stlwolf stlwolf deleted the feature/#18_tmux_claude_picker branch June 3, 2026 14:47
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