Skip to content

fix(tmux): run set-option as separate commands on Windows for psmux compatibility#2

Merged
john-mutuma merged 1 commit intomainfrom
fix/windows-tmux-set-option
Mar 3, 2026
Merged

fix(tmux): run set-option as separate commands on Windows for psmux compatibility#2
john-mutuma merged 1 commit intomainfrom
fix/windows-tmux-set-option

Conversation

@john-mutuma
Copy link
Copy Markdown
Owner

Summary

On Windows with psmux, the start() method has two issues:

  1. ; command chaining fails — PowerShell interprets ; as a statement separator and tries to run set-option as a standalone cmdlet.
  2. Session names with spaces failself.id can contain spaces (e.g., "opencode 013d496a"), and psmux cannot handle spaces in -t arguments.

Fix

  • Sanitizes session names — replaces spaces with hyphens for psmux compatibility, and syncs self.mux_session so other methods resolve correctly.
  • Defers set-option calls — runs them as separate vim.fn.system() calls after a 1-second delay via vim.defer_fn, giving the session time to initialize.

The Linux/macOS code path is unchanged.

Mirrors upstream PR: folke#261

@john-mutuma john-mutuma merged commit 7c20424 into main Mar 3, 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.

1 participant