Clipboard & OSC 52
PhanTerm ships with a production-grade ANSI terminal emulator that natively handles OSC 52 clipboard control sequences. This means that when you copy text using remote tools that support this protocol (like tmux, Neovim, Helix, etc.), it can be securely synchronized directly to your local operating system’s clipboard.
Explicit Approval Flow
Section titled “Explicit Approval Flow”While clipboard synchronization is incredibly convenient, it carries the security risk of malicious scripts silently reading or writing to your clipboard. Therefore, PhanTerm adopts a “block-by-default, explicit approval” security model:
- Session-Level Isolation: Clipboard authorization status is completely isolated per SSH session (each tab).
- First-Write Prompt: The first time a remote session attempts to write content to your local clipboard using an OSC 52 sequence, PhanTerm intercepts the request.
- Explicit Confirmation: A security confirmation dialog pops up on screen. You must explicitly press
yto allow ornto deny the request. - State Persistence: Once authorized in the current tab, subsequent copy operations will sync seamlessly and automatically. The authorization state is immediately destroyed when you close the tab and disconnect.
This design lets you enjoy the convenience of seamless integration with modern terminal tools while architecturally eliminating the threat of malicious scripts.