Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search: duplicate package name with NO_COLOR #995

Closed
cyrinux opened this issue May 22, 2022 · 5 comments
Closed

search: duplicate package name with NO_COLOR #995

cyrinux opened this issue May 22, 2022 · 5 comments

Comments

@cyrinux
Copy link

cyrinux commented May 22, 2022

Hi,

with aurutils-git, NO_COLOR=true is broken.

the package name is duplicate.

$ NO_COLOR=true aur search -n -k NumVotes arch-secure-boot
aur/arch-secure-bootaur/arch-secure-boot 1.3.2-1 (+2 0.00%)
    UEFI Secure Boot for Arch Linux + btrfs snapshot recovery

$ aur search -n -k NumVotes arch-secure-boot
aur/arch-secure-boot 1.3.2-1 (+2 0.00%)
    UEFI Secure Boot for Arch Linux + btrfs snapshot recovery

Regards

@Earnestly
Copy link
Contributor

Earnestly commented May 22, 2022

Does your terminal emulator support OSC8 hyperlinks? At any rate, it seems like the repeated print is from that, especially as it's specifically that part of the output.

@cyrinux
Copy link
Author

cyrinux commented May 22, 2022

Hmm, i'm using kitty and it get the support here kovidgoyal/kitty#68, with color enable I got the link when mouse over aur/arch-secure-boot and with NO_COLOR=true i can get the link on the second duplicate aur/arch-secure-boot.
I feel like we should disable the link when NO_COLOR enable ?

@Earnestly
Copy link
Contributor

Yes, you should it's always used. Not quite sure why it's only doubling the name, as it's not missing elements that would otherwise interfere with printf(1)'s implicit looping feature.

@AladW
Copy link
Member

AladW commented May 24, 2022

The issue appears to be that the package name is printed a second time when ALL_OFF is undefined i.e. if colorize() was not run. The function should return in that case:

if [[ ! -v ALL_OFF ]]; then
    printf "%s" "$mesg"
    return  # <---
fi

That said, I'm not sure NO_COLOR should disable the link since it's only about "color" escapes (which are e.g. annoying when debugging with set -x).

@AladW AladW changed the title buggy NO_COLOR=true search: duplicate package name with NO_COLOR May 24, 2022
@AladW AladW added this to the 10 milestone May 24, 2022
@AladW
Copy link
Member

AladW commented Jun 11, 2022

Fixed with #996

@AladW AladW closed this as completed Jun 11, 2022
cyrinux added a commit to cyrinux/dotfiles that referenced this issue Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants