Skip to main content
deleted 13 characters in body
Source Link

Enter copy mode and start searching in one go

bind-key / copy-mode \; send-key ?

allows you to do just:

 Ctrl + B /

and start typing the search term, which will search up (latest lines first).

Dump to a file and use vim

When things get more involved, I just want to use a proper editor: https://unix.stackexchange.com/questions/26548/write-all-tmux-scrollback-to-a-file

bind-key P 'capture-pane' \; capture-pane -S - \; save-buffer /tmp/tmux \; delete-buffer

Now P dumps the buffer to a file, and then I just:

vim /tmp/tmux

We can automate things even further as suggested by automatically opening vim as well as suggested by pkfm:

bind-key v 'capture-pane' \; \
  capture-pane -S - \; \
  save-buffer /tmp/tmux \; \
  delete-buffer \; \
  send-keys Escape 'ddivim /tmp/tmux' Enter

This supposes that your shell is in vi mode, so that:

  • Escape goes into normal mode
  • dd clears any existing command
  • i goes into insert mode
  • then we run vim /tmp/tmux

Tested in tmux 3.0.

Enter copy mode and start searching in one go

bind-key / copy-mode \; send-key ?

allows you to do just:

 Ctrl + B /

and start typing the search term, which will search up (latest lines first).

Dump to a file and use vim

When things get more involved, I just want to use a proper editor: https://unix.stackexchange.com/questions/26548/write-all-tmux-scrollback-to-a-file

bind-key P 'capture-pane' \; capture-pane -S - \; save-buffer /tmp/tmux \; delete-buffer

Now P dumps the buffer to a file, and then I just:

vim /tmp/tmux

We can automate things even further as suggested by automatically opening vim as well as suggested by pkfm:

bind-key v 'capture-pane' \; \
  capture-pane -S - \; \
  save-buffer /tmp/tmux \; \
  delete-buffer \; \
  send-keys Escape 'ddivim /tmp/tmux' Enter

This supposes that your shell is in vi mode, so that:

  • Escape goes into normal mode
  • dd clears any existing command
  • i goes into insert mode
  • then we run vim /tmp/tmux

Tested in tmux 3.0.

Enter copy mode and start searching in one go

bind-key / copy-mode \; send-key ?

allows you to do just:

 Ctrl + B /

and start typing the search term, which will search up (latest lines first).

Dump to a file and use vim

When things get more involved, I just want to use a proper editor: https://unix.stackexchange.com/questions/26548/write-all-tmux-scrollback-to-a-file

bind-key P 'capture-pane' \; capture-pane -S - \; save-buffer /tmp/tmux \; delete-buffer

Now P dumps the buffer to a file, and then I just:

vim /tmp/tmux

We can automate things even further by automatically opening vim as well as suggested by pkfm:

bind-key v 'capture-pane' \; \
  capture-pane -S - \; \
  save-buffer /tmp/tmux \; \
  delete-buffer \; \
  send-keys Escape 'ddivim /tmp/tmux' Enter

This supposes that your shell is in vi mode, so that:

  • Escape goes into normal mode
  • dd clears any existing command
  • i goes into insert mode
  • then we run vim /tmp/tmux

Tested in tmux 3.0.

added 716 characters in body
Source Link

Enter copy mode and start searching in one go

bind-key / copy-mode \; send-key ?

allows you to do just:

 Ctrl + B /

and start typing the search term, which will search up (latest lines first).

Dump to a file and use vim

When things get more involved, I just want to use a proper editor: https://unix.stackexchange.com/questions/26548/write-all-tmux-scrollback-to-a-file

bind-key P 'capture-pane' \; capture-pane -S - \; save-buffer /tmp/tmux \; delete-buffer

Now P dumps the buffer to a file, and then I just:

vim /tmp/tmux

We can automate things even further as suggested by automatically opening vim as well as suggested by pkfm:

bind-key v 'capture-pane' \; \
  capture-pane -S - \; \
  save-buffer /tmp/tmux \; \
  delete-buffer \; \
  send-keys Escape 'ddivim /tmp/tmux' Enter

This supposes that your shell is in vi mode, so that:

  • Escape goes into normal mode
  • dd clears any existing command
  • i goes into insert mode
  • then we run vim /tmp/tmux

Tested in tmux 23.60.

Enter copy mode and start searching in one go

bind-key / copy-mode \; send-key ?

allows you to do just:

 Ctrl + B /

and start typing the search term, which will search up (latest lines first).

Dump to a file and use vim

When things get more involved, I just want to use a proper editor: https://unix.stackexchange.com/questions/26548/write-all-tmux-scrollback-to-a-file

bind-key P 'capture-pane' \; capture-pane -S - \; save-buffer /tmp/tmux \; delete-buffer

Now P dumps the buffer to a file, and then I just:

vim /tmp/tmux

Tested in tmux 2.6.

Enter copy mode and start searching in one go

bind-key / copy-mode \; send-key ?

allows you to do just:

 Ctrl + B /

and start typing the search term, which will search up (latest lines first).

Dump to a file and use vim

When things get more involved, I just want to use a proper editor: https://unix.stackexchange.com/questions/26548/write-all-tmux-scrollback-to-a-file

bind-key P 'capture-pane' \; capture-pane -S - \; save-buffer /tmp/tmux \; delete-buffer

Now P dumps the buffer to a file, and then I just:

vim /tmp/tmux

We can automate things even further as suggested by automatically opening vim as well as suggested by pkfm:

bind-key v 'capture-pane' \; \
  capture-pane -S - \; \
  save-buffer /tmp/tmux \; \
  delete-buffer \; \
  send-keys Escape 'ddivim /tmp/tmux' Enter

This supposes that your shell is in vi mode, so that:

  • Escape goes into normal mode
  • dd clears any existing command
  • i goes into insert mode
  • then we run vim /tmp/tmux

Tested in tmux 3.0.

added 43 characters in body
Source Link

Enter copy mode and start searching in one go

bind-key / copy-mode \; send-key ?

allows you to do just:

 Ctrl + B /

and start typing the search term, which will search up (latest lines first).

Dump to a file and use vim

When things get more involved, I just want to use a proper editor: https://unix.stackexchange.com/questions/26548/write-all-tmux-scrollback-to-a-file

bind-key P 'capture-pane' \; capture-pane -S - \; save-buffer /tmp/tmux \; delete-buffer

Now P dumps the buffer to a file, and then I just:

vim /tmp/tmux

Tested in tmux 2.6.

Enter copy mode and start searching in one go

bind-key / copy-mode \; send-key ?

allows you to do just:

 Ctrl + B /

and start typing the search term.

Dump to a file and use vim

When things get more involved, I just want to use a proper editor: https://unix.stackexchange.com/questions/26548/write-all-tmux-scrollback-to-a-file

bind-key P 'capture-pane' \; capture-pane -S - \; save-buffer /tmp/tmux \; delete-buffer

Now P dumps the buffer to a file, and then I just:

vim /tmp/tmux

Tested in tmux 2.6.

Enter copy mode and start searching in one go

bind-key / copy-mode \; send-key ?

allows you to do just:

 Ctrl + B /

and start typing the search term, which will search up (latest lines first).

Dump to a file and use vim

When things get more involved, I just want to use a proper editor: https://unix.stackexchange.com/questions/26548/write-all-tmux-scrollback-to-a-file

bind-key P 'capture-pane' \; capture-pane -S - \; save-buffer /tmp/tmux \; delete-buffer

Now P dumps the buffer to a file, and then I just:

vim /tmp/tmux

Tested in tmux 2.6.

added 360 characters in body
Source Link
Loading
Source Link
Loading