I can do this now by running this command capture-pane -S -3000 and using this keybind:
bind C-y run "tmux save-buffer - | clip" Which requires me remembering to type capture-pane -S -3000 and pressing Ctrl+B, Ctrl+Y.
I would like to do it in one step like:
bind C-y capture-pane -S -3000; run "tmux save-buffer - | clip" But it does not work.
Optimally, it would be nice if tmux asked how many lines I would like to copy from the buffer. For exemple:
bind C-y capture-pane -S -ASK_HOW_MANY_LINE_TO_INPUT; run "tmux save-buffer - | clip" Then, if I press Ctrl+B, Ctrl+Y, I would type 3000 and press enter to get the last 3000 lines.