|
|
|
|
|
by klibertp
754 days ago
|
|
I wrote something similar on top of TMUX and zsh. I use zsh hooks to dump the current TMUX pane to a file (/tmp/lastcmd) just before a new prompt is displayed; I also set variables $O1, $O2, ... to respective output lines. It never occurred to me to bind `less /tmp/lastcmd` to a key, though - good idea :) (BTW: the problematic part was to make it fast enough not to be noticeable. The code that dumps the pane contents and searches for the start of the last output is written in Nim, in effect.) It was possible in TMUX because it gives you programmatic access to the pane's content. It's probably possible to do the same with some terminals - urxvt uses Perl as an extension language, for example - but TMUX provides a compatibility layer, which means I don't need to rewrite the whole setup if I change the terminal emulator. |
|