From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id CJdIO6yKE2RxygAASxT56A (envelope-from ) for ; Thu, 16 Mar 2023 22:31:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id QGUzO6yKE2SizgAA9RJhRA (envelope-from ) for ; Thu, 16 Mar 2023 22:31:24 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 483763CF19 for ; Thu, 16 Mar 2023 22:31:24 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcvBj-00008G-9W; Thu, 16 Mar 2023 17:31:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcvBe-00007L-RY for guix-patches@gnu.org; Thu, 16 Mar 2023 17:31:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pcvBe-0000q4-It for guix-patches@gnu.org; Thu, 16 Mar 2023 17:31:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pcvBe-0007AI-2A for guix-patches@gnu.org; Thu, 16 Mar 2023 17:31:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62056] [PATCH] guix: Only issue erase-current-line sequence for ttys. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Mar 2023 21:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62056 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Bruno Victal Cc: 62056@debbugs.gnu.org Received: via spool by 62056-submit@debbugs.gnu.org id=B62056.167900221927489 (code B ref 62056); Thu, 16 Mar 2023 21:31:02 +0000 Received: (at 62056) by debbugs.gnu.org; 16 Mar 2023 21:30:19 +0000 Received: from localhost ([127.0.0.1]:43220 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pcvAw-00079J-R3 for submit@debbugs.gnu.org; Thu, 16 Mar 2023 17:30:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pcvAv-000794-7U for 62056@debbugs.gnu.org; Thu, 16 Mar 2023 17:30:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcvAp-0000hh-FZ; Thu, 16 Mar 2023 17:30:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=njsiV8XOvVzCfV4gD5oyzlPAERY60yuyAAuQ8ajIPWc=; b=i9toqJQN9Vp+devztrlg PrOOSvePw91S0i54TNY+RZeTpT93hQrhEeciCmjS8PrzCRyybgfBlaP7QHjQOrd0RZax64F2KFux7 nwq42q1dT3URgTHLCIKnQE6ABfNuGdVsu8NqWUmw4oVV1zrEq+v+Dyr3QdMx/pnAvFjyzSOR6sqWc lafcbd5jP11gfQfxizGnVEsFdVCOcq71lBxVN9n8kCq00AqGSnOZAlP1BqceFcA1jGNUxLze1kTYc bA4ameTtP9YVd6sERXGGG4Ng4ie5Ea2arZtN3UNLOvu2h7AblhZy6LuQ3GZcoc2CtsUjbcX3KJ5pC AV9la0qBlj5KCA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcvAo-0001DH-12; Thu, 16 Mar 2023 17:30:10 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <6a78ee837fe579d6b1beaeda54beddba3c05fd2e.1678290800.git.mirai@makinata.eu> Date: Thu, 16 Mar 2023 22:30:06 +0100 In-Reply-To: <6a78ee837fe579d6b1beaeda54beddba3c05fd2e.1678290800.git.mirai@makinata.eu> (Bruno Victal's message of "Wed, 8 Mar 2023 15:55:56 +0000") Message-ID: <874jqkbd0h.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=i9toqJQN; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679002284; a=rsa-sha256; cv=none; b=UiP8bOVJRXHfhgpYzWT/5jGARSU4jXgJb9xe9LglTbgsHryCQzlnFmn32ufZwfvyiWKvfK ba0P6kRnmUp8X+JMG3mlnKhvuQ/LjzkvzDhI6Mhj5XeTQijHDeT5F1ku5lkPMV5+gx5vSf FpsAiZPektG5tFnsdVF+Mv0GciPLJkqBK8903FPp5D1UZMKn0wlfHjp+LrjhwRiQCblx5v 0q8CHm+jxAG2Q9EcWWrry95Enpn5Ix/dM3olqrkw2oebBSQYWWWZ3aHBz8KqC+Owi49lc6 oTTpAJel2w4SQiCw9AZXEHxZBWVaoCz8KvXjhzqqlv1VBTp5VXAAHRqJZMfIeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679002284; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=njsiV8XOvVzCfV4gD5oyzlPAERY60yuyAAuQ8ajIPWc=; b=OJ7yj7UwQ87XWfBcLDu6EWrMjmZksOr6W9rFoyJXfjMtLCJXnWlQtJYREiy3kPQsW2Pibx 5RUjNCGx5cAUNpZXbi4onrbzopTJvSAv76TZ3XwG9MIW/hud4XBL0bB3Wz9OY71320zO8B M2itgb/vZuuD3q+vKmBujOmfghtf6TJr2Lur0YjC/dZFD7TkMzT5cWJJwV8bZkI+eGwAsl wMfEbYi6ikWcma3en3HJv/cNeQkPHOIMxnPb81xyG0Ok9XyI+yvsItqNrSizvNCAP/w2b7 +3VANEw9EK15ZIB1lU5J0Bc+IYJPRNqDqAf5SyR5q2YsXC7hTIpjVtv5QgiPIA== X-Migadu-Spam-Score: -4.14 X-Spam-Score: -4.14 X-Migadu-Queue-Id: 483763CF19 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=i9toqJQN; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org X-TUID: 5O7BF/8uXJVj Hi, Bruno Victal skribis: > * guix/progress.scm (erase-current-line): Only issue erase-current-line s= equence for ttys. > --- > > Avoids cluttering log lines with =EF=BF=BD[K when output is logged to a f= ile. +1! > (define (erase-current-line port) > - "Write an ANSI erase-current-line sequence to PORT to erase the whole = line and > -move the cursor to the beginning of the line." > - (display "\r\x1b[K" port)) > + "When @var{port} is interactive, write an ANSI erase-current-line sequ= ence > +to erase the whole line and move the cursor to the beginning of the line, > +otherwise write a newline." > + (if (isatty? port) > + (display "\r\x1b[K" port) > + (newline port))) We should avoid calling =E2=80=98isatty?=E2=80=99 every time, it=E2=80=99s = too costly, which is why there=E2=80=99s also =E2=80=98isatty?*=E2=80=99 somewhere that memoizes= things. However, it seems up to the caller to check that before calling =E2=80=98erase-current-line=E2=80=99. That seems to be the case within pro= gress.scm and in (guix status). Could you see which use of =E2=80=98erase-current-line=E2=80=99 is causing = problems? TIA, Ludo=E2=80=99.