KristofferC / OhMyREPL.jl

Syntax highlighting and other enhancements for the Julia REPL
https://kristofferc.github.io/OhMyREPL.jl/latest/
Other
768 stars 60 forks source link

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

Closed chriselrod closed 11 months ago

chriselrod commented 11 months ago

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 11 months ago

idk why I am seeing color image

KristofferC commented 11 months ago

So this only happens with OhMyREPL loaded? Could maybe be related to https://github.com/JuliaLang/julia/pull/50797?

chriselrod commented 11 months ago

So this only happens with OhMyREPL loaded? Could maybe be related to https://github.com/JuliaLang/julia/pull/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 11 months ago

image

still seems fine on master

chriselrod commented 11 months ago

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.