-
Notifications
You must be signed in to change notification settings - Fork 0
feat(clipboard): add Zellij support to OSC 52 fallback #1737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -120,6 +120,46 @@ The output should start with $'\033]52;c;' | |
| End | ||
| End | ||
|
|
||
| Describe 'when no clipboard backend but ZELLIJ is set' | ||
| setup() { | ||
| MOCK_BIN="$(mktemp -d)" | ||
| MOCK_ORIGINAL_PATH="${PATH:-}" | ||
| MOCK_ORIGINAL_WAYLAND="${WAYLAND_DISPLAY:-}" | ||
| MOCK_ORIGINAL_ZELLIJ="${ZELLIJ:-}" | ||
| # Symlink only the commands the script needs into MOCK_BIN to avoid | ||
| # leaking pbcopy/xclip/etc. from shared directories like /usr/bin | ||
| local cmd | ||
| for cmd in bash base64 tr printf; do | ||
| ln -sf "$(command -v "$cmd")" "$MOCK_BIN/$cmd" | ||
| done | ||
| export PATH="$MOCK_BIN" | ||
| unset WAYLAND_DISPLAY | ||
| export ZELLIJ=0 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This setup sets The "no backend" cleanup already does MOCK_ORIGINAL_TMUX="${TMUX:-}"
MOCK_ORIGINAL_SSH_TTY="${SSH_TTY:-}"
…
unset WAYLAND_DISPLAY TMUX SSH_TTY
export ZELLIJ=0and restore both in |
||
| export MOCK_BIN MOCK_ORIGINAL_PATH MOCK_ORIGINAL_WAYLAND MOCK_ORIGINAL_ZELLIJ | ||
| } | ||
| cleanup() { | ||
| export PATH="$MOCK_ORIGINAL_PATH" | ||
| if [ -n "$MOCK_ORIGINAL_WAYLAND" ]; then | ||
| export WAYLAND_DISPLAY="$MOCK_ORIGINAL_WAYLAND" | ||
| fi | ||
| if [ -n "$MOCK_ORIGINAL_ZELLIJ" ]; then | ||
| export ZELLIJ="$MOCK_ORIGINAL_ZELLIJ" | ||
| else | ||
| unset ZELLIJ | ||
| fi | ||
| rm -rf "$MOCK_BIN" | ||
| unset MOCK_BIN MOCK_ORIGINAL_PATH MOCK_ORIGINAL_WAYLAND MOCK_ORIGINAL_ZELLIJ | ||
| } | ||
| Before 'setup' | ||
| After 'cleanup' | ||
|
|
||
| It 'uses OSC 52 escape sequence' | ||
| When run bash "$SCRIPT" <<<"hello" | ||
| The status should be success | ||
| The output should start with $'\033]52;c;' | ||
| End | ||
| End | ||
|
|
||
| Describe 'when no clipboard backend is available' | ||
| setup() { | ||
| MOCK_BIN="$(mktemp -d)" | ||
|
|
@@ -128,7 +168,7 @@ setup() { | |
| MOCK_ORIGINAL_SSH_TTY="${SSH_TTY:-}" | ||
| ln -sf "$(command -v bash)" "$MOCK_BIN/bash" | ||
| export PATH="$MOCK_BIN" | ||
| unset WAYLAND_DISPLAY SSH_TTY TMUX | ||
| unset WAYLAND_DISPLAY SSH_TTY TMUX ZELLIJ | ||
| export MOCK_BIN MOCK_ORIGINAL_PATH MOCK_ORIGINAL_WAYLAND MOCK_ORIGINAL_SSH_TTY | ||
| } | ||
| cleanup() { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: The new Zellij test is not isolated:
SSH_TTY/TMUXare left untouched, so it can false-pass via another OSC 52 trigger instead of validating Zellij detection.Prompt for AI agents