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

Drone CI web terminal incorrectly interpret tput output to *(B characters #1491

Closed
ghost opened this issue Feb 16, 2016 · 3 comments
Closed

Comments

@ghost
Copy link

ghost commented Feb 16, 2016

Hi folks,

I have installed tput in my Drone CI build image, with configure like:

https://github.com/Alexpux/MSYS2-pacman/blob/master/scripts/libmakepkg/util/message.sh#L28

colorize() {
    # prefer terminal safe colored and bold text when tput is supported
    if tput setaf 0 &>/dev/null; then
        ALL_OFF="$(tput sgr0)"
        BOLD="$(tput bold)"
        BLUE="${BOLD}$(tput setaf 4)"
        GREEN="${BOLD}$(tput setaf 2)"
        RED="${BOLD}$(tput setaf 1)"
        YELLOW="${BOLD}$(tput setaf 3)"
    else
        ALL_OFF="\e[0m"
        BOLD="\e[1m"
        BLUE="${BOLD}\e[34m"
        GREEN="${BOLD}\e[32m"
        RED="${BOLD}\e[31m"
        YELLOW="${BOLD}\e[33m"
    fi
    readonly ALL_OFF BOLD BLUE GREEN RED YELLOW
}

Drone CI web UI does not interpret tput sgr0 correctly, as a result there are some *(B characters in the output.

Note that for some reason I have to use my custom terminal (mintty.exe) and redirect the output to Drone terminal. Mintty does render tput sgr0 correctly, but Drone CI web UI does not.

Is there any chance to support tput sgr0 or at least avoid those *(B ?

Thanks!

@ghost
Copy link
Author

ghost commented Feb 16, 2016

Here is an example output:
http://wine-ci.org/fracting/MSYS2-packages/61

\r
==>(B Making package: xz 5.2.1-2 (Tue, Feb 16, 2016  5:24:53 PM)(B\r
==>(B Checking runtime dependencies...(B\r
==>(B Checking buildtime dependencies...(B\r
==>(B Installing missing dependencies...(B\r

@ghost
Copy link
Author

ghost commented Feb 16, 2016

BTW, there is also some unexpected \r in the end of lines during building, however, once the build is complete, those \r will be disappear. Could that be improved as well? Thanks very much!

@bradrydzewski
Copy link

drone does not have a fully compliant ansi terminal parser. We have a parent issue for this. If anyone is will to re-write a fast, compliant parser I am very interested in the help

for updates let's use https://github.com/drone/drone/issues/939

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant