GithubHelp home page GithubHelp logo

Comments (11)

237dmitry avatar 237dmitry commented on June 18, 2024

Is the environment variable MICRO_TRUECOLOR=1 set?

from micro.

dustdfg avatar dustdfg commented on June 18, 2024

MICRO_TRUECOLOR=1

No. I just tried to enable it and it doesn't have any influence... And it also doesn't affect gnome-terminal that works without this bug

from micro.

niten94 avatar niten94 commented on June 18, 2024

I do not know much about terminals but I think another color was used because 24-bit color was disabled. The 8th color (regular7 in foot) is usually white in terminal themes so it will probably be a color that looks like the default one if not set.

24-bit color was probably disabled because foot is not in the terminfo database in micro, but I think other programs usually use the system database. There is an isuse about the terminfo database being included: #2543

I tried reading "TRUECOLOR" section in the manpage of foot and I do not know if the terminfo entries have to be used, but I think it is related. 24-bit colors is just disabled if MICRO_TRUECOLOR is not 1 so nothing would change when setting it but I think it will probably be enabled when setting TERM environment variable with xterm-truecolor:

// Should we enable true color?
truecolor := os.Getenv("MICRO_TRUECOLOR") == "1"
if !truecolor {
os.Setenv("TCELL_TRUECOLOR", "disable")
}

from micro.

dustdfg avatar dustdfg commented on June 18, 2024

So you mean to try: MICRO_TRUECOLOR=1 with TERM=xterm-truecolor? I just tried it and it didn't help. Tell you more, COLORTERM=truecolor was at the same time

from micro.

dustdfg avatar dustdfg commented on June 18, 2024

But i just found one fun thing. TERM=xterm-truecolor as like TERM=xterm-256color gives bug but TERM=xterm-color works normally.

EDIT: it looked like it is without bug. Just because I opened plain micro and saw white as expected... What is wrong? Idk I can say that colors are loosed but not more before further research

P.S Happy New Year

from micro.

niten94 avatar niten94 commented on June 18, 2024

Sorry, I realized there is probably something wrong with what I thought about MICRO_TRUECOLOR but it is late here so I cannot check again and explain properly at this time. I think it would at least be surprising if 24-bit color is enabled when TERM is xterm-color even though MICRO_TRUECOLOR is not 1, but I still have not checked.
Happy new year also.

from micro.

niten94 avatar niten94 commented on June 18, 2024

No, I was only thinking about trying to run with TERM=xterm-truecolor but I realized MICRO_TRUECOLOR has to be 1. I was also wrong about terminfo.

I did not say that I thought the included terminfo database only is used, but entries in files are also used so the entries of foot are used. I do not think TERM usually has to be changed because COLORTERM (not manually set) only is probably checked when it is being checked if 24-bit color is supported.

MICRO_TRUECOLOR has to be 1 when enabling it but I do not know why it was disabled when you set it and I think it is weird. I tried looking at the manpage of foot and I think TERM can tried being set as foot-direct so that it will be enabled.

I have not used Wayland before so I tried copying the terminfo entry of foot in Debian 12 and using a terminal emulator where 24-bit color is enabled, but it was enabled when MICRO_TRUECOLOR is 1 and TERM is foot. I used another terminal emulator so it was just bugged when TERM is foot-direct.

I think this script can be used when testing and changing TERM. MICRO_TRUECOLOR is set as 1 when arguments are passed.

#!/bin/sh
set -u -e

[ $# -gt 0 ] && export MICRO_TRUECOLOR=1
echo "COLORTERM ${COLORTERM:--} MICRO_TRUECOLOR ${MICRO_TRUECOLOR:--}"

# opening micro takes a while when using other terminal emulators and
# TERM is foot-direct, not tested
for t in xterm xterm-color xterm-256color xterm-truecolor foot; do
    printf %s $t
    read _
    TERM=$t micro -colorscheme monokai
done

This is what it was like when I used the terminal emulator I was using:
https://github.com/zyedidia/micro/assets/127052329/0e285b64-d3cc-45fb-a8d9-4008c3586af3

I apologize that what I have said was confusing and that I was not able to answer properly.

from micro.

niten94 avatar niten94 commented on June 18, 2024

I tried testing using foot and GNOME Terminal in Debian 12 but 24-bit color was only enabled when I set MICRO_TRUECOLOR as 1 and ran micro even if I did not do something else. I do not know how did you set it but I think the variable was not exported when running micro probably because MICRO_TRUECOLOR=1 only was entered in a line when you were setting it in the shell.

The variable can be set like this when running micro:

MICRO_TRUECOLOR=1 micro
micro # running again, variable is not set

The variable can also be set and exported in another line like this so that it will be set when it is not set in a command:

export MICRO_TRUECOLOR=1
micro

from micro.

dustdfg avatar dustdfg commented on June 18, 2024

You are right it wasn't exported. My habit is to put ; between commands usually gives me problems with variable exporting. It usually happens like export ; command. "Hmm it didn't work I should try two lines form (without export). Hmm it also didn't work so the variable doesn't work."

Foot works as expected when the MICRO_TRUECOLOR is 1 but it is still strange that it doesn't work without it because gnome terminal works normally

from micro.

niten94 avatar niten94 commented on June 18, 2024

24-bit color is disabled when MICRO_TRUECOLOR is not 1 even when using GNOME Terminal but the colors in monokai in micro and the default color scheme in GNOME Terminal (Tango) are similar so it can look like it is enabled. I used LMDE 6 when testing but packages are based on the packages in Debian 12 so I think there is at least not much differences.

It can be seen in this video that the colors are different when MICRO_TRUECOLOR is not 1:

simplescreenrecorder-2024-02-04_21.19.45.mp4

from micro.

dustdfg avatar dustdfg commented on June 18, 2024

Yeah. It is correct. I just changed the color in gnome terminal and so that micro uses it as like in foot. Thanks!

from micro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.