halcyon / asdf-java

A Java plugin for asdf-vm.
MIT License
455 stars 86 forks source link

strange ansi characters when i try to install a Java version #111

Open zfogg opened 3 years ago

zfogg commented 3 years ago

Any guidance here? I can't find anything about this error when I search google or GitHub issues.

I'll attach some screenshots of my config.

image image
delgurth commented 3 years ago

I'm not seeing this behaviour.

The code on line 100 and 101 is (on november 1 2020):

    read -r -a dirs <<<"$(ls -d ./*/)"
    cd "${dirs[0]}" || return 1

My guess is that your ls output also contains other things, like coloring, which is picked up by the following up cd command. Perhaps it's saver to change this part to something like find . -type d -maxdepth 1 -not -name "."

-- Edit

Now I'm really confused why I'm not seeing this behaviour. The color I get when I use it (the $'\E[1m\E[36m') in an echo is exactly the same color I'm getting from my ls -d output.

afbeelding
delgurth commented 3 years ago

@zfogg can you check if you have the CLICOLOR_FORCE variable set?

 CLICOLOR_FORCE  Color sequences are normally disabled if the output isn't directed to a
                 terminal.  This can be overridden by setting this flag.  The TERM vari-
                 able still needs to reference a color capable terminal however otherwise
                 it is not possible to determine which color sequences to use.

Only when I set that variable I'm able to reproduce your situation.

zfogg commented 3 years ago

@zfogg can you check if you have the CLICOLOR_FORCE variable set?

 CLICOLOR_FORCE  Color sequences are normally disabled if the output isn't directed to a

                 terminal.  This can be overridden by setting this flag.  The TERM vari-

                 able still needs to reference a color capable terminal however otherwise

                 it is not possible to determine which color sequences to use.

Only when I set that variable I'm able to reproduce your situation.

interesting! i'll check shortly. i usually do have this variable set