From 6e666cc2b53c2c0d4071720df16d18240144a845 Mon Sep 17 00:00:00 2001 From: Alvin Novian Date: Sat, 27 Apr 2024 13:55:19 +0700 Subject: [PATCH] use tmux provider if tmux is used inside wezterm --- helix-view/src/clipboard.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/helix-view/src/clipboard.rs b/helix-view/src/clipboard.rs index 12c604884..75291a215 100644 --- a/helix-view/src/clipboard.rs +++ b/helix-view/src/clipboard.rs @@ -104,7 +104,14 @@ pub fn get_clipboard_provider() -> Box { // variable? if env_var_is_set("WEZTERM_UNIX_SOCKET") && binary_exists("wezterm") { - Box::new(provider::FallbackProvider::new()) + if env_var_is_set("TMUX") && binary_exists("tmux") { + command_provider! { + paste => "tmux", "save-buffer", "-"; + copy => "tmux", "load-buffer", "-w", "-"; + } + } else { + Box::new(provider::FallbackProvider::new()) + } } else if env_var_is_set("WAYLAND_DISPLAY") && binary_exists("wl-copy") && binary_exists("wl-paste")