-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for rendering ANSI-colored text from piped stdin (and use Helix as $PAGER
)
#1074
Comments
This seems a bit orthogonal to a text editor to me. Why not just use a proper pager? |
It's the same reason why many seaking for way to use Kakoune and Vim as pager: Btw, Helix has allowed piping from stdin into a buffer, so Helix have somewhat already be usable as pager: export PAGER="hx"
export MANPAGER="$PAGER" Although Helix currently wasn't able to handle terminal ansi code which lead to open a buffer with a bunch of ansi-characters-escape (this image from Kakoune is for illustration purpose): We could add a option in the ansi = true # Default When Helix being piped:
Here are some more demonstrate (achieved using Kakoune with kak-ansi): Kakpipe is also be written in rust, we could took/investegate some of its code.
If the dev thinks this feature shouldn't be built in to Helix, please label this issue as plugin idea and the |
I am also a kitty user. It, cleverly, provides scrollback search by piping scrollback to a pager. With its new shell integration, you can also do things like pipe the last command's output to a pager. The usual I currently use this monstrosity with neovim in my kitty config:
There's a long issues thread for kitty with different people offering up their recipes for how to do this. It is very powerful to pipe your scrollback into your full editor, have all the incremental search/highlight comforts of your normal editor, be able to copy text out of it from the keyboard, and so on. I think it's within the realm of what a terminal-based text editor can/should do. I'd happily replace the above long nvim command with any other editor's "pager mode" that provides the equivalent. |
On the topic of pager, neovim proposes this in its documentation: |
I'd also love to use Helix as my |
I'm not interested in using it as a pager. But I would like to output some content of a man page and then edit it (with helix). |
Another use case for this: code reviews in the terminal. delta generates syntax highlighted diffs (I believe using the same underlying tooling as bat), which look great/substantially like the ones in GitHub, ex: PRR is a tool for doing GH code reviews in a text file (and I've hacked together a tree-sitter grammar/Helix integration for that). Setting up |
We want to build a diffmode into helix which could be used for code review in the future which makes much more sense IMO since it also allow editing. |
A diffmode sounds great, though the reason I call out Are you imagining the diff mode will have it's own system for highlighting diff chunks such that existing tree-sitter grammars work, ala the algorithm described here in delta? |
We have pur own virtual text Infrastrukturen. It's already perfectly possible to rendern multiple documents with different syntax hoghloghting interleaved. The text rendering in helix is an order of magnitude more complex compared to a simple tool like delta. |
How orthogonal is it to use helix to view "rolling" log files, just like |
personally , i care less about rolling a log... im more into searching, selecting and yanking from it ... which is why id like to see such support |
closing in favor of #2313 |
@pascalkuthe i just read through #2313 trying to understand how it relates to this but couldn't? |
|
Same as the author, I would like to use hx as a pager for kitty, and thus don't need an integrated terminal (since kitty already has window splitting etc). While parsing ANSI codes needs to be done for an integrated terminal, surely its easier than implementing everything in regards to that? I haven't read the whole thread there, but to me it makes sense that one would want ANSI code processing built in to helix, while an integrated terminal can be a plugin. ( i tried to open the matrix channel but my client (element) doesn't let me (: ) |
I also do not understand how #2313 is relevant to this issue. The use case that led me to this issue: Workarounds:
As for a more general use case, I also use From |
Although #996 have been merged, support for rendering ANSI-colored text from piped stdin inside fifo buffers is very useful to used as Kitty terminal's
scrollback_pager
and will enable Helix to be used as$PAGER
,$MANPAGER
and$GIT_PAGER
without the need of a plugin.Some Kakoune plugins supporting this feature:
Also for using the main editor as
less
orbat
replacement, Kakoune currently need a dedicated plugin pager.kak. Hope that Helix can somehow implement this be defaults.The text was updated successfully, but these errors were encountered: