helix icon indicating copy to clipboard operation
helix copied to clipboard

Failure to Copy to System Clipboard in tmux in Specific Directory

Open tqwewe opened this issue 2 years ago • 4 comments

Summary

While operating in the $HOME/dev directory (including its subdirectories) and using the yank command Space + y to copy text to the system clipboard, the operation fails to execute as expected. However, when I navigate up to the $HOME directory, the same operation functions as expected.

This issue seems to be specifically tied to operating in an SSH session from a Mac into a PC. Using a terminal directly from the PC does not reproduce the issue; all clipboard functions work correctly in that scenario.

Reproduction Steps

Steps to Reproduce:

  1. SSH into the PC from a Mac.
  2. Launch tmux and navigate to $HOME/dev directory (or any subdirectory).
  3. Attempt to yank text to system clipboard using Space + y.

Expected Behavior:

The yanked text should be copied to the system clipboard, regardless of the current directory.

Actual Behavior:

No visible error upon pressing the keyboard shortcut, but an error message appears when running the :clipboard-yank command:

Couldn't set the system clipboard content: clipboard provider tmux failed

Helix log

~/.cache/helix/helix.log
2023-06-04T13:01:47.888 helix_view::editor [ERROR] editor error: Couldn't set system clipboard content: clipboard provider tmux failed

Platform

Linux & macOS

Terminal Emulator

Alacritty on Mac

Helix Version

helix 22.12

tqwewe avatar Jun 04 '23 03:06 tqwewe

Same issue for me however seems to be present in any directory. My setup looks like WSL2 -> SSH -> Tmux -> Helix. Clipboard works fine from Tmux but not within Helix.

Jackojc avatar Jul 31 '23 17:07 Jackojc

same issue, helix system clipboard(Space + y) is not working inside tmux.

Platform macOS

Terminal Emulator iterm2

Helix Version 23.05(built from master branch)

logan272 avatar Oct 23 '23 03:10 logan272

Having this issue, but it's very erratic, sometimes it works, sometimes it doesn't.

adriangalilea avatar Apr 14 '24 21:04 adriangalilea

Similar issue, Space + p does not work.

To fix Space + y not working, I did the following: In iterm2, enabling Applications in terminal may access clipboard in General > Selection source

As a crude fix for the clipboard paste I set the following keymaps:

[keys.normal.space]
P = ":insert-output tmux send-keys i; pbpaste; tmux send-keys Escape"
p = ":insert-output tmux send-keys a; pbpaste; tmux send-keys Escape"

JosiahBLB avatar Jun 19 '24 06:06 JosiahBLB