Skip to content
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

Colorize terminal buffer preview #714

Closed
Matts966 opened this issue Apr 3, 2021 · 10 comments · Fixed by #1120
Closed

Colorize terminal buffer preview #714

Matts966 opened this issue Apr 3, 2021 · 10 comments · Fixed by #1120
Labels
enhancement Enhancement to performance, inner workings or existent features

Comments

@Matts966
Copy link

Matts966 commented Apr 3, 2021

Describe the solution you'd like

It would be awesome to colorize terminal buffer preview for more visibility.

Current previewer does not invoke buffer related autocommands maybe for performance perspective. Could we invoke some color related autocommands only when the buffer is terminal?

@Matts966 Matts966 added the enhancement Enhancement to performance, inner workings or existent features label Apr 3, 2021
@Conni2461
Copy link
Member

I would need to restructure some things to make this possible. I talked about it somewhere. Its on my todo list.

But thanks to open a issue to make it trackable :)

@fdschmidt93
Copy link
Member

#1120 would fix it if it gets merged (I'm not crazy about it myself). If not, I'm happy to guide anyone who wants authentic terminal buffers in the buffer previewer enough to work on it him/herself to a more principled solution.

@fdschmidt93
Copy link
Member

Considering how involved the solution is for such a supposedly innocent issue, I'd kindly ask users who want to see this fix get merged to please test drive #1120

Thank you in advance :)

@tjdevries
Copy link
Member

Is the problem that we don't highlight terminal buffers? I'm not sure what's happening here.

Maybe instead we can use the builtin: nvim_open_term to get terminal highlighting?

Sorry, I'm confused about this issue.

@Matts966
Copy link
Author

Sorry @tjdevries, I should show some screenshots.

With denite, the preview is simply the terminal buffer itself and colorized.

スクリーンショット 2021-08-21 11 18 19

Telescope buffers is performant, but it shows monochrome terminal preview

スクリーンショット 2021-08-21 11 18 53

This sometimes leads to difficulty in finding terminal buffers with many open buffers.

@fdschmidt93
Copy link
Member

@tjdevries Conni and I've got this :) It's quite convoluted.. if you want me to give you the full rundown, happy to elaborate.

@Matts966
Copy link
Author

@fdschmidt93
Using latest Telescope buffers perfectly visualize my terminal buffers 🚀
Thank you!!

@fdschmidt93
Copy link
Member

PSA: #1120 will essentially be reverted #1400. The original PR introduced a lot of additional maintenance burden and unexpected behavior/side effects we can hardly, if at all, recover from. Therefore, we decided to revert the previewer to how it was before.

@kuator
Copy link

kuator commented May 25, 2022

PSA: #1120 will essentially be reverted #1400. The original PR introduced a lot of additional maintenance burden and unexpected behavior/side effects we can hardly, if at all, recover from. Therefore, we decided to revert the previewer to how it was before.

😢

@fdschmidt93
Copy link
Member

If anyone comes up with a way to extract the lines from a terminal buffer including the ANSI color codes, it would be relatively straightforward. I've spent some time on this and maybe I'm missing something, but I unfortunately haven't yet found a way to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to performance, inner workings or existent features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants