Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 188961 - app-shells/zsh-completion for gcc-config handles colors incorrectly
Summary: app-shells/zsh-completion for gcc-config handles colors incorrectly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: Normal minor (vote)
Assignee: Dawid Węgliński (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-15 08:58 UTC by Elias Pipping (RETIRED)
Modified: 2008-01-15 12:16 UTC (History)
1 user (show)

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


Attachments
patch against gcc-config (gcc-config.diff,985 bytes, patch)
2007-08-15 08:58 UTC, Elias Pipping (RETIRED)
Details | Diff
patch against zsh-completion (gcc-config_completion.diff,442 bytes, patch)
2007-08-15 08:58 UTC, Elias Pipping (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Elias Pipping (RETIRED) gentoo-dev 2007-08-15 08:58:19 UTC
I have app-shells/zsh-completion-20060618 and gcc-config-1.3.16 installed.

The problem is this:

% gcc-config <press tab>
^[\[32\;01m^[\[0m         i686-apple-darwin8-4.0.1

The first completion is obviously invalid.

As for why this happens:

% grep profile= ~/Gentoo/usr/share/zsh/site-functions/_gcc-config 
    profile=(${(f)"$(_call_program gcc-installed gcc-config --list-profiles)"})
    profile=${${profile/\[([^]]*)\]/}/\*}

so first the leading [...] is stripped and then the trailing asterisk. However, these lines in gcc-config:

% grep -b1 GOOD ~/Gentoo/usr/bin/gcc-config
13353-                  if [[ ${x} == ${CURRENT_NATIVE} ]] ; then
13398:                          x="${x} ${GOOD}*${NORMAL}"
13429-                  elif [[ -e ${GCC_ENV_D}/config-${target} ]] ; then

cause the output of gcc-config to be colorized (the asterisk becomes green), and the escape sequence is not stripped.

So either gcc-config should provide an option --no-color that zsh-completion could use or zsh-completion needs to filter non-whitespace next to the asterisk, too.


PS: I run Gentoo/Alt (prefix) on macosx, but I assume this not a prefix-specific issue.
Comment 1 Elias Pipping (RETIRED) gentoo-dev 2007-08-15 08:58:40 UTC
Created attachment 128149 [details, diff]
patch against gcc-config
Comment 2 Elias Pipping (RETIRED) gentoo-dev 2007-08-15 08:58:55 UTC
Created attachment 128150 [details, diff]
patch against zsh-completion
Comment 3 Bapt 2008-01-03 11:51:03 UTC
I open a specific bug for the gcc-config
Comment 4 Bapt 2008-01-12 16:32:36 UTC
This bug should be closed by #204185 
Comment 5 Dawid Węgliński (RETIRED) gentoo-dev 2008-01-15 12:16:40 UTC
Closing it then :)