The --list-available-vms parameter for the java-config tool produces a list of all the installed Java virtual machines in the current Gentoo installation. The current default VM in the list is highlighted in yellow. The other defaults VMs in the list are highlighted in white. However many people use consoles in a desktop which have a black foreground and a white background. As a result, these users don't see all the VMs listed and can spend hours trying to work out why the new jdk/jre they installed is not showing. Because they can't see the VM listed they assume that they won't be able to use things like '--set-system-vm' or '--set-user-vm' because they think that java-config cannot see the vm they installed. KDE users with the default Keramik style, often use the Konsole application to run a shell. By default Konsole has a black foreground and white background as default - so anyone using the java-config tool in these environments just assumes that the java-config tool is broken. This is the same situation for the default XTerm application in some none-KDE environments. This is similar to bug number 20436 but that bug relates to restoring the system terminal colour after use, not during the running java-config. Fixing 20436 will not fix this bug. java-config should not use a foreground text colour which matches the user's current terminal background colour. Failing that, at the very least 'white' should not be used as this is a very common background colour. Reproducible: Always Steps to Reproduce: 1. emerge at least 2 different jdks 2. emerge java-config 3. run 'java-config --list-available-vms' in a terminal with a white background, eg. Konsole Actual Results: Only the current system default vm is listed - all others are invisible. Expected Results: All vms should be listed and visibile in the console. Initially setting as major bug because a large subset of Gentoo users trying to use java-config will hit this problem and assume java-config is not working.
Currently in the process of writing a python java-config that will completely solve this issue.
Sounds good - let me know if you need a tester for it! :) For the existing script, even in a shell with ok background, when piping the java-config to something like 'more' or 'less', the special colour characters are actually being shown in the output text. As a very quick fix I think you should just turn off colour coding completely as (*) already marks the default vm. This would also solve the other bug referenced in this bug report too.
Java-config has been broken (for white-background users) for over a month now. A python rewrite sounds great, but Paul's suggestion to switch off the colour coding in the current implementation would make it usable and thus help our users today. Personally I consider colour coding command output a pointles annoyance, so I'd like a future python version not to do that by default anyway.
Browsing through the forums, it looks like a lot of people have problems with this. Some people report that it has taken them days to figure out that the text is actually white on white background... I suggest that a quick fix is made to this (as Martijn Koster also proposed). My suggestion is the following: Normal VM: default terminal foreground (black or whatever) Selected VM: blue (medium intensity makes it visible on both black and white backgrounds) I've applied these changes to java-config to implement this: line 351: echo -e "\033[01;34m [`vm_shortname $i`] `vm_version $i` (*)\033[00m" line 353: echo -e " [`vm_shortname $i`] `vm_version $i` ()" Alternatively one can choose a bold typeface instead of color: line 351: echo -e "\033[01;30m [`vm_shortname $i`] `vm_version $i` (*)\033[00m"
Can You Per Cederberg attach a patch here. I will try to check on this as soon as i come back.
Created attachment 16476 [details, diff] Displays chosen vm in blue, removes other colors A patch for java-config-0.2.8-r1 that sets the chosen vm color to blue, removes colors for non-chosen vm:s.
Created attachment 16477 [details, diff] Displays chosen vm in boldface, removes other colors Same as previous patch, except that it displays the selected vm in boldface instead. Note that these patches are mutually exclusive, so you must pick your favorite... ;)
*** Bug 22939 has been marked as a duplicate of this bug. ***
Fixed, commitd to portage tree as java-config-0.2.8-r2