searching the scrollback buffer of mrxvt

As mrxvt tips page says, there is a way to search the scrollback buffer. The uses of this are infinite…

The code on the page though was a bit problematic (at least for me), so I slightly modified it to work:

Mrxvt.macro.Primary+Ctrl+Shift+question: PrintScreen -ps perl -e '$_=join("",<STDIN>); s/\n+$/\n/g; print' > /tmp/scrollback
Mrxvt.macro.Primary+Add+Ctrl+Shift+question: NewTab "(Search)" !less -ifLR +G /tmp/scrollback; rm -f /tmp/scrollback
Mrxvt.macro.Primary+Ctrl+slash: PrintScreen -s perl -e '$_=join("",<STDIN>); s/\n+$/\n/g; print' > /tmp/scrollback
Mrxvt.macro.Primary+Add+Ctrl+slash: NewTab "(Search)" !view +"syn off|set nospell notitle |normal G" /tmp/scrollback; rm -f /tmp/scrollback

What I’ve changed is that I replaced the old “/bin/sh -c” with a simple “!”. The manpage of mrxvt has more info about “!” (line 434). I’ve also added a “-f” flag to the rm command at the end.

No comments yet. Be the first.

Leave a reply