KristofferC/OhMyREPL.jl

`$TERM` supports 256 colors, but don't have colors

Closed this issue · 5 comments

If I start Julia with

> TERM=xterm-256color julia

I do get colors, but not when using my default $TERM value (foot, for reference).

> infocmp $TERM | grep color
	colors#0x100, cols#80, it#8, lines#24, pairs#0x10000,
> infocmp xterm-256color | grep color
#	Reconstructed via infocmp from file: /usr/share/terminfo/x/xterm-256color
xterm-256color|xterm with 256 colors,
	colors#0x100, cols#80, it#8, lines#24, pairs#0x10000,
> infocmp xterm | grep color
	colors#8, cols#80, it#8, lines#24, pairs#64,

My terminfo does indeed say that I have colors#0x100 (0x100==256), just like it does for xterm-256color.

Moelf commented

idk why I am seeing color
image

So this only happens with OhMyREPL loaded? Could maybe be related to JuliaLang/julia#50797?

So this only happens with OhMyREPL loaded? Could maybe be related to JuliaLang/julia#50797?

Yeah, that seems likely to be the cause.
My problem is unrelated to OhMyREPL.

julia> for i = 0:255; printstyled("$i\t";color=i); i%16==15&&println(); end

No color, not even on Julia, when starting with --startup=no.
Any chance you can try Julia master, @Moelf ? I'm guessing that PR didn't make it into 1.10.

Moelf commented

image

still seems fine on master

Hmm

julia> Base.find_terminfo_file("foot")

julia> Base.find_terminfo_file("xterm")

julia>

because

dir = "/home/chriselrod/.terminfo"

because

    terminfo_dirs = if haskey(ENV, "TERMINFO")
        [ENV["TERMINFO"]]
    elseif isdir(joinpath(homedir(), ".terminfo"))
        [joinpath(homedir(), ".terminfo")]
    elseif haskey(ENV, "TERMINFO_DIRS")
        split(ENV["TERMINFO_DIRS"], ':')
    elseif Sys.isunix()
        ["/usr/share/terminfo"]
    else
        String[]
    end

so rm -r ~/.terminfo fixed it.