logoalt Hacker News

xuhu • today at 11:54 AM • 2 replies • view on HN

I wish this worked without prefixing the commands with "once". Especially if I ran a command with verbose output and afterwards decided I wanted to grep something from it. Terminals have the output in their scrollback buffer and maybe it's just a matter of writing an "output" command that lets me run:

    $ cmake ..
    $ output | grep "libssl version"

Replies

lelanthran • today at 5:21 PM

I run bash from inside vim and nvim. At anytime I can drop into vim and use the entire scrolled history as a buffer.

ctippett • today at 1:31 PM

You could probably achieve something like that using Fish shell and their fish_preexec and fish_postexec event hooks.

Edit: Nope, looks like you can't. You only get the invoked command and no output.

➕ show 1 reply