Skip to content

fix: use OSC52 clipboard for remote macOS TUI#491

Open
HamsteRider-m wants to merge 1 commit into
lsdefine:mainfrom
HamsteRider-m:fix/tui-ssh-clipboard
Open

fix: use OSC52 clipboard for remote macOS TUI#491
HamsteRider-m wants to merge 1 commit into
lsdefine:mainfrom
HamsteRider-m:fix/tui-ssh-clipboard

Conversation

@HamsteRider-m
Copy link
Copy Markdown

Summary

  • keep the existing macOS pbcopy path for local Terminal.app sessions
  • fall back to Textual/OSC52 when the TUI appears to be running through SSH or tmux
  • add a GA_TUI_CLIPBOARD=osc52 escape hatch for users who need to force terminal clipboard output

Why

frontends/tuiapp_v2.py currently returns immediately after pbcopy succeeds on macOS. When the TUI runs on a remote Mac over SSH/tmux, that copies to the remote Mac clipboard instead of the user's visible terminal clipboard. Allowing OSC52 in remote/tmux sessions lets compatible terminals/tmux propagate the copy to the local clipboard.

Refs #351.

Testing

  • PYTHONPYCACHEPREFIX=/tmp/ga-pr-pycache python -m py_compile frontends/tuiapp_v2.py
  • python frontends/tuiapp_v2.py --help
  • git diff --check
  • monkeypatch smoke test for local macOS, SSH, tmux, and GA_TUI_CLIPBOARD=osc52 paths

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