Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 22862 - java-config --list-available-vms produces invisible vm lines on common shell terminals / consoles
Summary: java-config --list-available-vms produces invisible vm lines on common shell ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
: 22939 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-06-15 06:11 UTC by Paul Done
Modified: 2003-08-23 18:52 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Displays chosen vm in blue, removes other colors (java-config-0.2.8-r1.blue.patch,648 bytes, patch)
2003-08-22 15:16 UTC, Per Cederberg
Details | Diff
Displays chosen vm in boldface, removes other colors (java-config-0.2.8-r1.bold.patch,648 bytes, patch)
2003-08-22 15:19 UTC, Per Cederberg
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Done 2003-06-15 06:11:16 UTC
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.
Comment 1 Todd Berman (RETIRED) gentoo-dev 2003-06-15 06:23:45 UTC
Currently in the process of writing a python java-config that will completely solve this issue.
Comment 2 Paul Done 2003-06-15 08:20:16 UTC
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.
Comment 3 Martijn Koster 2003-07-21 01:55:19 UTC
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. 
 
Comment 4 Per Cederberg 2003-08-11 23:52:01 UTC
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"
Comment 5 Adrian Almenar 2003-08-22 14:10:50 UTC
Can You Per Cederberg attach a patch here. I will try to check on this as soon as i come  back.
Comment 6 Per Cederberg 2003-08-22 15:16:56 UTC
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.
Comment 7 Per Cederberg 2003-08-22 15:19:36 UTC
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... ;)
Comment 8 Adrian Almenar 2003-08-23 18:40:15 UTC
*** Bug 22939 has been marked as a duplicate of this bug. ***
Comment 9 Adrian Almenar 2003-08-23 18:52:54 UTC
Fixed, commitd to portage tree as java-config-0.2.8-r2