Does not produce colors when invoked from within the curses enviornment
Hi
We've been trying to debug some weird behaviour when using vimcat inside of ranger. ranger uses highlight 1 2 to highlight the source code and we wanted to also use vimcatas a replacement for that.
If vimcat is invoked on my system, then
- If I invoke it from my terminal, I see colors
- If I redirect output to a file and cat that file, I see colors
- If I cat the file from within
ranger(by replacinghighlightwithcat) then I see colors
If vimcat is invoked from within ranger (in ncurses enviornment), then
- We don't see colors
- If I redirect the output to a file and cat that file outside ranger, I don't see colors
I think what's happening is that there's something about the enviornment from which vimcat is invoked which causes it not to produce any colors.
The original issue is at https://github.com/ranger/ranger/issues/657
Hi,
Do you have any way to test within a similar ncurse environment interactively, so we can run vim and inspect for differences? vim plays well within tmux or screen so I don't quite know what to do.
I've compared the environments and only found that these variables are added :
ESCDELAY=25
PAGER=less
RANGER_LEVEL=1
and SHLVL is raised to 2 instead of 1.
But by testing manually with these environment variables, vim isn't affected.
tput colors returns 8 like in my terminal.
But I think that ncurse as set by ranger is affecting vim set termcap output and the options it lists.
This might have to do with pycurses which ranger uses. I'll try to get you a minimal reproducible environment and post it here.
Alternately, is there a easier way than digging through source through which I could get all variable settings of the curses environment for ranger?