You can install and use xsel instead of pbcopy on Linux. Or set up tmux to use OSC 52 if your terminal supports it, see https://github.com/tmux/tmux/wiki/Clipboard.
I don't know what it means to behave like a normal terminal, which terminal? You can make mouse selection stay around until you copy and bind C-c or M-c in tmux to copy by changing the key bindings. Alternatively, most terminals let you hold down Shift to override tmux mouse and handle the mouse themselves, but that will only work for visible text, not the scrollback. On Tue, 26 Jan 2021 at 16:51, Peng Yu <pengyu...@gmail.com> wrote: > I have the following tmux installed on Mac OS X and Linux. > > $ tmux -V > tmux 3.1c > > I have the following .tmux.conf, which allows automatic copy of > highlighted text in a terminal. But it doesn't copy anything in a terminal > on Linux. I know that the problem is probably due to pbcopy. > > I want to have an identical configure file so that it can allow use > highlight text and type command-C (Mac) or ctrl-shift-C (Linux) for > copying. Basically, I just want the normal behavior of a terminal. Could > anybody let me know the tmux code to figure this? > > $ cat ~/.tmux.conf > # Send prefix > set-option -g prefix C-a > set-option -g repeat-time 2000 > bind-key c-R source-file ~/.tmux.conf \; display-message "~/.tmux.conf > sourced" > > bind-key v split-window -h -c "#{pane_current_path}" #\; switch-client -T > prefix > bind-key s split-window -v -c "#{pane_current_path}" #\; switch-client -T > prefix > > bind-key -r h select-pane -L > bind-key -r j select-pane -D > bind-key -r k select-pane -U > bind-key -r l select-pane -R > > bind-key -r - resize-pane -D > bind-key -r + resize-pane -U > bind-key -r < resize-pane -L > bind-key -r > resize-pane -R > > bind-key c new-window -c "#{pane_current_path}" > > bind-key -r n next-window > bind-key -r p previous-window > > set-option -g mode-keys vi > bind-key -T copy-mode-vi v send-keys -X begin-selection > bind-key -T copy-mode-vi y send-keys -X copy-pipe pbcopy > > bind-key -T prefix P paste-buffer > > set-option -g history-limit 10000 > set-option -g mouse on > > bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe pbcopy > > > -- > You received this message because you are subscribed to the Google Groups > "tmux-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to tmux-users+unsubscr...@googlegroups.com. > To view this discussion on the web, visit > https://groups.google.com/d/msgid/tmux-users/6f6f9895-0478-4c3a-b21c-574cde0c1cd4n%40googlegroups.com > <https://groups.google.com/d/msgid/tmux-users/6f6f9895-0478-4c3a-b21c-574cde0c1cd4n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "tmux-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+unsubscr...@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/CAEdLfcHreh_R7t0KDY6Gu35_FOdqTCa7hA%3DyMzcbKp6UPdWY4w%40mail.gmail.com.