-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Description
Ability to pipe scrollback buffer to a pager or terminal editor
This is basically what kitty does with ctrl-shift-h. By default it just uses less, but you can use any pager or terminal editor just as long as it understands ANSI escape codes. eg scrollback_pager nvim -c 'set ft=man' -.
I believe this is a more powerful way to mark, select, copy than introducing mark mode (#5804) and selection spec (#2840). Because it leverages all the features a terminal editor has as oppose to have arbitrary bindings that only exist in Microsoft Terminal.
Don't get me wrong, while I know I just said that this is more powerful, I'm not saying this could replace, but rather be a powerful complement to those PRs.
I guess the right approach is just dumping the whole buffer to stdin and piping it to whatever command we set in JSON configuration.
With Microsoft Terminal already supporting splits and tabs, this could totally replace tmux for me. And I do think this is a superior approach since terminal multiplexers tend to just duplicate all the escape sequences you type, which is wasteful. Having the Terminal handle your splits, and scrollback buffer is what most people use terminal multiplexer is for.
Some might say, "but what about sessions?". Tmux is an odd program since it is both a session manager and a terminal multiplexer. This solves the latter by completing the trifecta - splits, tabs, scrollback buffer.
This should complement the history size configuration. Since having a large amount of scrollback buffer could lead to slowdowns. But using vim for years, I never found a file that it couldn't handle, (I'm talking about opening gigabytes worth of log files).
Proposed technical implementation details (optional)
- Default binding:
ctrl-shift-h - Pipes the whole buffer to stdin to a default program like
less
2a. (optional) We could remove all the ANSI Escape codes by default, that way you just pipe it directly to your terminal likevim -M +MANPAGER -, I have to usesedto remove them when using it in kitty. - Ability to change the scrollback pager program via
scrollbackPagerin JSON Config. - closing the scrollback pager would bring you back to where you invoked to command