From 14f5a0a0c2e122a30f82c796e1e93517d37fface Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Mon, 28 Apr 2025 12:57:11 +0100 Subject: [PATCH] tmux: continue tweaking --- tmux.conf | 18 +++++++++++++----- tmux.linux.conf | 12 ++++++------ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/tmux.conf b/tmux.conf index afc326d..c3d782e 100644 --- a/tmux.conf +++ b/tmux.conf @@ -55,19 +55,27 @@ set -w -g mode-keys vi bind -T copy-mode-vi v send -X begin-selection bind -T copy-mode-vi y send -X copy-selection -# I'm not a keyboard fanatic; enable the mouse. -set -g mouse on +# I'm not a keyboard fanatic; however, if the mouse is enabled it stops "click to highlight" (for example, in PuTTY/MobaXterm etc) +set -g mouse off # Enable the pretty colours... # If there are problems with outdated ncurses's's's, we can use "screen-256color" instead. -set -g default-terminal "tmux-256color" +# set -g default-terminal "tmux-256color" + +# Try and make clipboard work? +# Allow things inside tmux to set system clipboard. That's what I expect anyway so let's try it. +# set -gs set-clipboard on + +# set -as terminal-features ',rxvt-unicode-256color:clipboard' +# set -as terminal-features ',tmux-256color:clipboard' +# set -as terminal-features ',xterm-256color:clipboard' # Override terminal for 32-bit RGB colour. (Disabled for now, need to test with MobaXterm.) # set -a terminal-overrides ",*256col*:RGB" # Make it obvious which pane we're in. -set -w -g pane-active-border-style fg=black,bg=color140 -set -g pane-border-indicators arrows +# set -w -g pane-active-border-style fg=black,bg=color140 +# set -g pane-border-indicators arrows # Give the panes their own status indicator. set -g pane-border-status top diff --git a/tmux.linux.conf b/tmux.linux.conf index 8d3c5c7..490fc0a 100644 --- a/tmux.linux.conf +++ b/tmux.linux.conf @@ -1,14 +1,14 @@ # Detect the display server protocol and set clipboard commands​ -if-shell '[ "$XDG_SESSION_TYPE" = "wayland" ]' \ - 'set -g copy-command "wl-copy"; set -g paste-command "wl-paste -n"' \ - 'set -g copy-command "xclip -sel clip -i"; set -g paste-command "xclip -sel clip -o"' +# if-shell '[ "$XDG_SESSION_TYPE" = "wayland" ]' \ + # 'set -g copy-command "wl-copy"; set -g paste-command "wl-paste -n"' \ + # 'set -g copy-command "xclip -sel clip -i"; set -g paste-command "xclip -sel clip -o"' # Take the buffer and send it to the system clipboard -bind C-c run "tmux save-buffer - | $copy_command" +bind C-c run 'tmux save-buffer - | pbcopy_l' # y in copy mode takes selection and sends it to system clipboard -bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "$copy_command" +bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy_l" # And the reverse - Prefix Ctrl-v fills tmux buffer from system clipboard, then # pastes from buffer into tmux window -bind C-v run-shell '$paste_command | tmux load-buffer - \; paste-buffer' \ No newline at end of file +bind C-v run-shell 'pbpaste_l | tmux load-buffer - \; paste-buffer'