From patchwork Fri Feb 22 04:06:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivy Foster X-Patchwork-Id: 1013 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id 1E5D3BC992E4 for ; Fri, 22 Feb 2019 04:07:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on apollo X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00=-1,DKIM_INVALID=1, DKIM_SIGNED=0.1,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3, T_DMARC_POLICY_NONE=0.01 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-BL-Results: [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Fri, 22 Feb 2019 04:07:21 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id C852210D33F926; Fri, 22 Feb 2019 04:07:16 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [5.9.250.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS; Fri, 22 Feb 2019 04:07:16 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id A0BB62BF20; Fri, 22 Feb 2019 04:07:16 +0000 (UTC) Authentication-Results: luna.archlinux.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=escondida.tk header.i=@escondida.tk header.b=HxJ7KaTu Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id B99842BF20 for ; Fri, 22 Feb 2019 04:07:13 +0000 (UTC) Received: from mail.escondida.tk (mail.escondida.tk [198.58.102.79]) by luna.archlinux.org (Postfix) with ESMTP for ; Fri, 22 Feb 2019 04:07:13 +0000 (UTC) Received: from localhost (75-130-5-83.dhcp.ftwo.tx.charter.com [75.130.5.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.escondida.tk (Postfix) with ESMTPSA id ED5217F314; Thu, 21 Feb 2019 22:07:11 -0600 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=escondida.tk; s=mail; t=1550808432; bh=yJkxBu7EkqA4OX5eNu/wAHUjMoqEWFb+UHt8Oi3Feug=; h=From:To:Cc:Subject:Date; b=HxJ7KaTu6DzHBsdGNYhVuF7LF53XlEkg0PPfXlHZxpv6k2anNZlYEmFB9qM4JB1Ej GSIMC1WStI26km8cUFvZGqEBi7gzenvHVuSp6pIv/x4aNZR8lCsNjChhxUNb1i1rxt bCMBIODQudmsJA4bagB+dk9kfL99O1JrCZkQRoog= From: iff@escondida.tk To: pacman-contrib@lists.archlinux.org Subject: [PATCH] term_colors.sh: do not use colors on a dumb term Date: Thu, 21 Feb 2019 22:06:52 -0600 Message-Id: <20190222040652.5058-1-iff@escondida.tk> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: pacman-contrib@lists.archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for pacman-contrib development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: pacman-contrib-bounces@lists.archlinux.org Sender: "pacman-contrib" From: Ivy Foster Signed-off-by: Ivy Foster --- Conventionally, any terminal incapable of advanced features, such as ANSI escape code interpretation, sets $TERM to the generic value "dumb" to indicate that no program should expect it to be anything more complex than a teletype. lib/term_colors.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/term_colors.sh b/lib/term_colors.sh index a675247..87e95ee 100644 --- a/lib/term_colors.sh +++ b/lib/term_colors.sh @@ -1,6 +1,6 @@ # check if messages are to be printed using color unset ALL_OFF BOLD BLUE GREEN RED YELLOW -if [[ -t 2 && ! $USE_COLOR = "n" ]]; then +if [[ -t 2 && ! $USE_COLOR = "n" && ! $TERM = "dumb" ]]; then # prefer terminal safe colored and bold text when tput is supported if tput setaf 0 &>/dev/null; then ALL_OFF="$(tput sgr0)"