-
-
Notifications
You must be signed in to change notification settings - Fork 836
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
how to set a environment variable for bat #228
Comments
I tried setting the local term_opts = {
cwd = opts.cwd or vim.fn.getcwd(),
env = {
COLORTERM = 'truecolor'
}
}
with_preview_window(status, bufnr, function()
set_term_id(
self,
vim.fn.termopen(opts.get_command(entry, status), term_opts)
)
end) |
Hmmm, Make sure you completely reload the plugin in between to ensure that env is getting passed. |
I restarted neovim several times, so telescope is definitely reloaded. And here is what it's like in telescope's bat preview, the color is obviously wrong: And if I run bat in terminal, the color is correct. |
I can confirm having the same issue with bat, perhaps it is something todo with bat, please check sharkdp/bat#979 |
bat needs external help to decide whether to use truecolor or not. |
Why is Neovim removing Should I open a PR for that patch? |
Ohhh thats why, sure @ThomasFeher |
I don't know what the neovim core guys want so i don't know if you should open a PR. |
@Conni2461 coming to the rescue 😆 appreciate you bro |
- Set env vars for previewer with set_env({ key = value } nvim-telescope#228) - Set pager for git previewes (default is GIT_PAGER=less so users can scroll see nvim-telescope#253) - Use less for people who don't have bat but less installed
Please checkout #260 and report back if it is working for you. Thanks :) |
I tested bat preview with builtin |
@tami5 can we keep issues around until the pr is merged? Maybe someone will have the same issue in the future and only does an open issue search, this way he can't find that this issue is already been worked on and has a working solution :) |
@Conni2461 ohhh sorry I thought its merged. I can create FAQ entry |
I was waiting for #260 to be merged, suddenly the issue gets closed.... :) |
@smartding ohhh sorry for shocking you 🤣 . if you want to test it now and assure us it is working okay you can do |
already tested the PR 21 hours ago and it worked, as I mentioned above. |
Oh so thats why I closed it. :D I was like hmm this issue if fixed for me and for smartding, let me close it, silly me :P |
- Set env vars for previewer with set_env({ key = value } fix nvim-telescope#228) - Set pager for git previewes (default is GIT_PAGER=less so users can scroll see nvim-telescope#253) - Use less for people who don't have bat but less installed - Reset less env to only '-RS' because '-X' will break scrolling(fix nvim-telescope#253, thanks @eth3lbert) - Scrolling for buffer previewer(thanks @tami5 for helping) - Also new function to create buffer previewers (which has scrolling by default). Used for tags and help_tags previewer. - Add new setting set_env to readme
- Set env vars for previewer with set_env({ key = value } fix nvim-telescope#228) - Set pager for git previewes (default is GIT_PAGER=less so users can scroll see nvim-telescope#253) - Use less for people who don't have bat but less installed - Reset less env to only '-RS' because '-X' will break scrolling(fix nvim-telescope#253, thanks @eth3lbert) - Scrolling for buffer previewer(thanks @tami5 for helping) - Also new function to create buffer previewers (which has scrolling by default). Used for tags and help_tags previewer. - Add new setting set_env to readme
- Set env vars for previewer with set_env({ key = value } fix nvim-telescope#228) - Set pager for git previewes (default is GIT_PAGER=less so users can scroll see nvim-telescope#253) - Use less for people who don't have bat but less installed - Reset less env to only '-RS' because '-X' will break scrolling(fix nvim-telescope#253, thanks @eth3lbert) - Scrolling for buffer previewer(thanks @tami5 for helping) - Also new function to create buffer previewers (which has scrolling by default). Used for tags and help_tags previewer. - Add new setting set_env to readme
- Set env vars for previewer with set_env({ key = value } fix nvim-telescope#228) - Set pager for git previewes (default is GIT_PAGER=less so users can scroll see nvim-telescope#253) - Use less for people who don't have bat but less installed - Reset less env to only '-RS' because '-X' will break scrolling(fix nvim-telescope#253, thanks @eth3lbert) - Scrolling for buffer previewer(thanks @tami5 for helping) - Also new function to create buffer previewers (which has scrolling by default). Used for tags and help_tags previewer. - Add new setting set_env to readme
- Set env vars for previewer with set_env({ key = value } fix nvim-telescope#228) - Set pager for git previewes (default is GIT_PAGER=less so users can scroll see nvim-telescope#253) - Use less for people who don't have bat but less installed - Reset less env to only '-RS' because '-X' will break scrolling(fix nvim-telescope#253, thanks @eth3lbert) - Scrolling for buffer previewer(thanks @tami5 for helping) - Also new function to create buffer previewers (which has scrolling by default). Used for tags and help_tags previewer. - Add new setting set_env to readme
- Set env vars for previewer with set_env({ key = value } fix nvim-telescope#228) - Set pager for git previewes (default is GIT_PAGER=less so users can scroll see nvim-telescope#253) - Use less for people who don't have bat but less installed - Reset less env to only '-RS' because '-X' will break scrolling(fix nvim-telescope#253, thanks @eth3lbert) - Scrolling for buffer previewer(thanks @tami5 for helping) - Also new function to create buffer previewers (which has scrolling by default). Used for tags and help_tags previewer. - Add new setting set_env to readme
- Set env vars for previewer with set_env({ key = value } fix nvim-telescope#228) - Set pager for git previewes (default is GIT_PAGER=less so users can scroll see nvim-telescope#253) - Use less for people who don't have bat but less installed - Reset less env to only '-RS' because '-X' will break scrolling(fix nvim-telescope#253, thanks @eth3lbert) - Scrolling for buffer previewer(thanks @tami5 for helping) - Also new function to create buffer previewers (which has scrolling by default). Used for tags and help_tags previewer. - Add new setting set_env to readme
- Set env vars for previewer with set_env({ key = value } fix nvim-telescope#228) - Set pager for git previewes (default is GIT_PAGER=less so users can scroll see nvim-telescope#253) - Use less for people who don't have bat but less installed - Reset less env to only '-RS' because '-X' will break scrolling(fix nvim-telescope#253, thanks @eth3lbert) - Scrolling for buffer previewer(thanks @tami5 for helping) - Also new function to create buffer previewers (which has scrolling by default). Used for tags and help_tags previewer. - Add new setting set_env to readme
- Set env vars for previewer with set_env({ key = value } fix nvim-telescope#228) - Set pager for git previewes (default is GIT_PAGER=less so users can scroll see nvim-telescope#253) - Use less for people who don't have bat but less installed - Reset less env to only '-RS' because '-X' will break scrolling(fix nvim-telescope#253, thanks @eth3lbert) - Scrolling for buffer previewer(thanks @tami5 for helping) - Also new function to create buffer previewers (which has scrolling by default). Used for tags and help_tags previewer. - Add new setting set_env to readme
- Set env vars for previewer with set_env({ key = value } fix #228) - Set pager for git previewes (default is GIT_PAGER=less so users can scroll see #253) - Use less for people who don't have bat but less installed - Reset less env to only '-RS' because '-X' will break scrolling(fix #253, thanks @eth3lbert) - Scrolling for buffer previewer(thanks @tami5 for helping) - Also new function to create buffer previewers (which has scrolling by default). Used for tags and help_tags previewer. - Add new setting set_env to readme
neovim is no longer resetting COLORTERM, thanks to the change made by @ThomasFeher. |
telescope and fzf.vim have the same problem when using bat for previewing: the color in preview looks more saturated than running bat directly in command line. See this issue in fzf.vim repo for screenshots from many users.
The short term solution (as discussed here ) is to set the environment variable
COLORTERM=truecolor
each time we run bat. How can we do this in telescope?The text was updated successfully, but these errors were encountered: