Skip to content

Make query paste use reachable system clipboards#193

Open
Maxteabag wants to merge 1 commit intomainfrom
worktree-issue-188-clipboard
Open

Make query paste use reachable system clipboards#193
Maxteabag wants to merge 1 commit intomainfrom
worktree-issue-188-clipboard

Conversation

@Maxteabag
Copy link
Copy Markdown
Owner

@Maxteabag Maxteabag commented May 6, 2026

Fixes #188

Clipboard access varies across terminal, OS, and display-server combinations, so query paste now reads from native OS commands before falling back to pyperclip and sqlit's internal buffer. Copy writes to native clipboard helpers and still attempts Textual OSC52 so local and remote terminal paths both get a chance to work.

Constraint: Terminal apps cannot force clipboard access when the OS session or terminal blocks every exposed backend
Rejected: Depend only on pyperclip | misses Linux installs without xclip/xsel/wl-clipboard and some terminal-delivered paste flows
Confidence: medium
Scope-risk: moderate
Directive: Keep internal clipboard as a fallback; it is what makes vim y/p reliable when the system clipboard is unavailable
Tested: uv run pytest tests/unit/test_clipboard.py tests/ui/keybindings/test_visual_mode.py -q
Tested: uv run pytest tests/ui/keybindings -q
Tested: uv run ruff check changed clipboard/query/keybinding files
Tested: uv run mypy sqlit/shared/ui/clipboard.py sqlit/shared/ui/widgets_text_area.py sqlit/domains/query/ui/mixins/query_editing_clipboard.py sqlit/shared/ui/protocols/query.py
Not-tested: Manual paste behavior on macOS, Windows, Wayland, X11, SSH, and terminals that block OSC52
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.

The p (paste) does not work well.

1 participant