Skip to content

Fix remote Neovim yanks without blocking paste - #413

Open
dhh wants to merge 4 commits into
masterfrom
fix-remote-neovim-yanks
Open

dhh wants to merge 4 commits into
masterfrom
fix-remote-neovim-yanks

Conversation

@dhh

@dhh dhh commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

LazyVim clears clipboard over SSH, so ordinary yanks never invoke Omarchy's remote provider. Restore automatic clipboard yanks and remove synchronous OSC 52 reads, which can block paste for ten seconds when the terminal refuses clipboard queries.

Copies reach Wayland and the terminal. Inside tmux, large copies use load-buffer -w only when set-clipboard allows export; with export disabled, the internal tmux buffer still supports yank/paste. Policy is checked on each copy. tmux selects one attached client for export; unrelated sessions are not targeted.

Paste prefers the existing tmux buffer over SSH, then Wayland where applicable, then this Neovim's last copy. tmux silently ignores empty loads, so an empty write records the current buffer identity in a server option. Other Neovim instances using this provider read empty until a new buffer arrives. This preserves tmux history; it does not erase older buffers or clear the terminal host's separate clipboard. Reads select a specific buffer after checking its identity.

Without Wayland or tmux, paste uses this Neovim's last copy. Use terminal paste to insert newly copied host text in that case. Register types, empty vs failed reads, existing clipboard flags, and the omarchy_remote_clipboard_sync / omarchy_remote_clipboard_osc52 opt-outs are preserved.

This supersedes #125. Existing installs are handled by omacom/omarchy#11486. Publish omarchy-nvim 2026.8.13-2 in the relevant channel before releasing that migration.

Validation:

  • Provider regression suite passes: actual yy/p, environment detection, register types, read/write failures, empty reads, opt-outs and large copies; OSC 52 reads are forbidden by the test.
  • New real tmux suite passes with isolated servers and synthetic PTY clients: empty writes between separate Neovim instances, preserved history, subsequent external copies, linewise/multiline/large/control-character payloads, export off/on/external, live policy changes and client isolation.
  • Both suites run in the Arch CI job, which now installs tmux and Python alongside Neovim.
  • Local validation used Neovim 0.12.5 and tmux 3.7c. No live desktop clipboard or build server was touched. No full package rebuild performed.

@dhh dhh changed the title Fix automatic Neovim clipboard yanks over SSH Fix remote Neovim yanks without blocking paste Sep 13, 2026
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