Skip to content

feat: add sesh window command for tmux window management#345

Open
fenngwd wants to merge 5 commits intojoshmedeski:mainfrom
fenngwd:feat/sesh-window-command
Open

feat: add sesh window command for tmux window management#345
fenngwd wants to merge 5 commits intojoshmedeski:mainfrom
fenngwd:feat/sesh-window-command

Conversation

@fenngwd
Copy link

@fenngwd fenngwd commented Mar 6, 2026

Summary

Closes #282

Adds a new sesh window (alias w) subcommand for listing and managing tmux windows within a session, mirroring the UX of sesh list and sesh connect.

Features

  • sesh window — list all windows in the current tmux session (one per line)
  • sesh window <name> — switch to an existing window by name
  • sesh window <path> — create a new window at the given directory (name = basename)
  • --session / -s flag to target a session other than the current one
  • --json / -j flag reserved for JSON output in list mode

Implementation

  • model/tmux_window.go — new TmuxWindow data type (Name, Path, Index, Active)
  • tmux/list_tmux_win.go + tests — ListWindows(targetSession string) using tmux list-windows
  • tmux/select_win.go + tests — SelectWindow(name string) using tmux select-window
  • seshcli/window.go — cobra command wired to the above
  • seshcli/root_command.go — registered in root command

Note: files are named list_tmux_win.go / select_win.go (not list_windows.go / select_window.go) to avoid Go's platform-specific build constraint, which treats files ending in _windows.go as Windows-only.

Testing

Unit tests follow the same mock-based pattern as the existing tmux package tests. All 14 packages pass.

Weidong Feng (AI) and others added 5 commits March 6, 2026 15:52
提交内容由AI生成

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add ListWindows(targetSession string) to the Tmux interface and RealTmux
implementation. Reuse existing separator variable from list.go to avoid
naming conflict. Note: implementation file named list_tmux_win.go because
Go treats filenames ending in _windows.go as Windows-only build constraints.

Commit content generated by AI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Commit content generated by AI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
提交内容由AI生成

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
提交内容由AI生成

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

Add commands for window management

1 participant