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

@shenhao-stu
Copy link
Copy Markdown
Contributor

这个问题已经被 #418 修过了,commit 54f40d9 fix(tui): use pbcopy on macOS for clipboard (OSC 52 broken on Terminal.app)

当前实现:frontends/tuiapp_v2.pycopy_to_clipboard() —— macOS 走 pbcopy,其他平台 OSC52 fallback,与你提的方向一致。先关掉,感谢~

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