Hacker News new | ask | show | jobs
by ivolimmen 756 days ago
Me too. Nothing beats the "CTRL + SHIFT + G" option (open last output in less); no other terminal has it.
3 comments

iTerm2: cmd+shift+a = select output of last command. I can then cmd+c, open whatever editor I want (or `pbpaste | less` if I want `less`).
It always appears greyed out for me, Hotkey Window and default profile as well. Any idea why might it be? Thanks!
You haven't installed the shell integration, likely. https://iterm2.com/documentation-shell-integration.html
TIL, thanks.
I didn't even know about that and I've been using kitty for years
try kitty-scrollback as well https://github.com/mikesmithgh/kitty-scrollback.nvim for scrolling back via neovim...
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.