diff options
| -rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 5956ab177c..3784c93ad8 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
| @@ -577,6 +577,8 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
| 577 | else: | 577 | else: |
| 578 | log_exec_tty = False | 578 | log_exec_tty = False |
| 579 | 579 | ||
| 580 | should_print_hyperlinks = sys.stdout.isatty() and os.environ.get('NO_COLOR', '') == '' | ||
| 581 | |||
| 580 | helper = uihelper.BBUIHelper() | 582 | helper = uihelper.BBUIHelper() |
| 581 | 583 | ||
| 582 | # Look for the specially designated handlers which need to be passed to the | 584 | # Look for the specially designated handlers which need to be passed to the |
| @@ -944,10 +946,12 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
| 944 | try: | 946 | try: |
| 945 | termfilter.clearFooter() | 947 | termfilter.clearFooter() |
| 946 | summary = "" | 948 | summary = "" |
| 947 | def print_hyperlink(url, link_text): | 949 | def format_hyperlink(url, link_text): |
| 948 | start = f'\033]8;;{url}\033\\' | 950 | if should_print_hyperlinks: |
| 949 | end = '\033]8;;\033\\' | 951 | start = f'\033]8;;{url}\033\\' |
| 950 | return f'{start}{link_text}{end}' | 952 | end = '\033]8;;\033\\' |
| 953 | return f'{start}{link_text}{end}' | ||
| 954 | return link_text | ||
| 951 | 955 | ||
| 952 | if taskfailures: | 956 | if taskfailures: |
| 953 | summary += pluralise("\nSummary: %s task failed:", | 957 | summary += pluralise("\nSummary: %s task failed:", |
| @@ -955,7 +959,7 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
| 955 | for (failure, log_file) in taskfailures.items(): | 959 | for (failure, log_file) in taskfailures.items(): |
| 956 | summary += "\n %s" % failure | 960 | summary += "\n %s" % failure |
| 957 | if log_file: | 961 | if log_file: |
| 958 | hyperlink = print_hyperlink(f"file://{log_file}", log_file) | 962 | hyperlink = format_hyperlink(f"file://{log_file}", log_file) |
| 959 | summary += "\n log: {}".format(hyperlink) | 963 | summary += "\n log: {}".format(hyperlink) |
| 960 | if warnings: | 964 | if warnings: |
| 961 | summary += pluralise("\nSummary: There was %s WARNING message.", | 965 | summary += pluralise("\nSummary: There was %s WARNING message.", |
