TIL that you can search/find text in your whooooole #tmux pane buffer using the simple spell: Ctrl-b [ /the text you search<Enter>. Now I can copy/paste the console output I had before the U-Boot update and put it in the blog post πŸ«₯

https://superuser.com/a/231159

How can I search within the output buffer of a tmux shell?

I can't get this to work. How can I search the buffer of a tmux shell?

Super User

@joel

If you've identified the text in scroll-back mode (Β«prefixΒ»[) and selected it, copying it to the tmux buffer, you can then extract it directly to the clipboard or a file for your convenience with

$ tmux showb | xsel -ib

(or `xclip` or `pbcopy` depending on your platform) or

$ tmux showb > my_captured_data.txt

@gumnos I generally use the internal tmux commands as I do console or ssh to vi copy/pasting :) But your trick seems nice if I switch to using Mousepad someday :D

@joel the nice thing is that it's all text. So if you have a tmux session running on a remote machine, locally you can run

$ ssh me@remote 'tmux showb' | xsel -ib

or

$ ssh me@remote 'tmux showb' > local_copy_of_remote_tmux_buffer.txt

to copy that buffer locally 😁

@gumnos oh, yeah.  Neat! I didn’t thought about remote tmux. I don’t really have this use case.