From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31273 invoked from network); 4 Aug 2021 03:49:12 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 4 Aug 2021 03:49:12 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1628048952; b=sVkbyU+7L8fGOTqVMsQwg5M09ZNvyKqFwY7FeAW1ODvSoCHLaXV+0R6peRsQvtgkzRpppZ+Qzm FPXQ5tyXFcHHP8ZazpxH909KZVXY99jE4dLnJLnDC/289dXIpTQ2gfH9Q/XEEsNdYXScPxSQ3W ipFPLjmunD8x3g3vWvykHll5dstp8JfpY+RnDYCjfVeORbLvVipBzFmnQ2v5maFs5QTm5IvLLl 4VGQ1dCOK4Y7Lv7QiS6bYXl2E5hHIZi3LbRtdi4F2wIqzDA0NXToUYUeX5JbTb135hTamqtH8x gmWiCDScnc9NCbEQdKFEJ8cxtT1mK+3+TinFPI/vQ4rb8w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f181.google.com) smtp.remote-ip=209.85.219.181; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1628048952; bh=89/85/LSY5dpiwwUTYbZIh+gvxIIBQF/7oLMV45UWZ4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature:DKIM-Signature; b=j7uUxZMiqPYjYu0UqKO6M9bFZuN4gw4600gd4Cvm99t2Gh17wqJFMuGO/G1nmRagCvV2nPCD+r SDAOoeSaMeaayiFEZXMlqj0QxzgTFhNDP23WdaSSe2GB1oUiXwuc0ENo/ySaHNDcGghtHFE9C7 vgJrD3gbjL4LK4kyiL3IuUZYmqnkuK7Hoq9YU/mNPQGL9zUQIW/cGpQ9cCXlVyw504attefDCI MOv1iQWz4AjggXzr0ONmQ5lOpKIUJpxVIs6lYnRDx43NAUmsNdI4wQkI69Sbqyt5He98Y+F4nj +dnf9I3KLecHRqL7tcb3aVQU4t5dSGYwWR77KKRPoANZ4w==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=BkPvt+tU4nMMmTKU6+oHSx/DlDiPXmAtnFVqq/kzbfI=; b=mzBuNY7p+Vp+RxXrhh3NpiwJEA K4S2HN5iM1bo2jFn9xJ3tBek3Arcm29a+kjtlSP6F9+69APwSxjFHp0NqAEJRRaMd9x8b61hGFA61 zw1aLDwdBIz445RaYCU5l+BGiPgz8rH9Mbik4korzMMrhb+fuDg9IJTFTlRP638ByeQeuJu8nS+8u PXjrogGf+A9LyK1rPel4sFcs3ccngRl8hjbU5B3rK2u/t/fzpLd3lc8G2aIoARqI7tfwsFHKQWOWP Spss5PA1cjk4dmcXmUTzl5Em1AuJQazsDsA4xUjI/aPswy3pbMZNEcwBlJ2hPMC+VhzRhAgQyer2W J9TETijw==; Received: from authenticated user by zero.zsh.org with local id 1mB7u2-000GEe-W5; Wed, 04 Aug 2021 03:49:11 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f181.google.com) smtp.remote-ip=209.85.219.181; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-yb1-f181.google.com ([209.85.219.181]:39718) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mB7tU-000Fwh-64; Wed, 04 Aug 2021 03:48:37 +0000 Received: by mail-yb1-f181.google.com with SMTP id p145so2022464ybg.6 for ; Tue, 03 Aug 2021 20:48:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=BkPvt+tU4nMMmTKU6+oHSx/DlDiPXmAtnFVqq/kzbfI=; b=0TlpPaciUBP5MZkMtFSqAxbbjvYoUNZUudznnCd2h5SA9mEsXIagONmyh6h0e1q45i oiXAelSztYD+M+k8p6vbY+e+Mb0IJKKyINbYpc7bLcQemOcAVdg4kki/NRKWJqH5uS5M lzuvkLbWwr/MSPHQpyqq4pB2HYo4J/yh56XY9SVJaxGAVzvT3AEj3nF83vxjlu1Lur6r WZkw8kyup579BVFqXABohAnDZahmSb9jbh62LgOxCtiTzauH9g51CmE+5Uj4fQSw8SxB F8MeayGxw6DEN6SPwvsTSAwrmmmKIjJ/uuJJkmbUvH4bykBVlyTZsuVFzkM8X4UjNegU xDMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=BkPvt+tU4nMMmTKU6+oHSx/DlDiPXmAtnFVqq/kzbfI=; b=QdIkLuzfSnYydo6QH2eHOGa4coKn1eq5PnNJ31bYNO8RlaBuKVe1PMvSs5BSaosnNz Nbg5JoFfrvmcxq7irIAkDRj8v4iruyZSV7zg/PbOxP3YaknZccRSF34cvT7BUVK5hgy/ UDceGvRdXk4s8cQ+k9ey8IuUdP9/kKKahzoYyBlaDc/KpaWmAdhDsZQ3PQ4nwaNoaUp7 kPHhDir3hRDtaA3wje737wyWJ/c4VDoyNf+JFGNHkER5IVfabIHtFp9ooWvJXX2FPiI0 oM6vSQtp6Xkbe4nhPibf5i6pZTEznE9SlYWaIeto4JbYMVQ3mPTubRuRuo5aXgXeDXvw EqAg== X-Gm-Message-State: AOAM530QdZpRr8BPW89XRpUqVXSrWCecuD8oBlCMxMX06Pjz1fYlrLsU bI/KczhFJd8MD6KIdeKJYF17uuz5ZnR7jIhuzFD2bfvmsB6/7g== X-Google-Smtp-Source: ABdhPJy46KOgKU7VJlFStv8xOxkwFLvXP8HzHYeJka2mXx64+1fYTrLGtAwDB3ndyZp5u7H5eoYcQlm5bm8QuHlNKK8= X-Received: by 2002:a25:dc12:: with SMTP id y18mr32018383ybe.69.1628048914596; Tue, 03 Aug 2021 20:48:34 -0700 (PDT) MIME-Version: 1.0 References: <549459d9-eee8-43b2-b8c6-71c11291f012@www.fastmail.com> In-Reply-To: <549459d9-eee8-43b2-b8c6-71c11291f012@www.fastmail.com> From: Bart Schaefer Date: Tue, 3 Aug 2021 20:48:23 -0700 Message-ID: Subject: Re: [PATCH] Increase $COLUMNS when generating long option completions To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 49236 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Tue, Aug 3, 2021 at 6:12 PM Lawrence Vel=C3=A1zquez wro= te: > > On Tue, Aug 3, 2021, at 10:05 AM, Marlon Richert wrote: > > > > No, the problem results from _call_program being connected to a pipe: > > > > When ${~words[1]} is an external command, it will then not see > > $COLUMNS, unless $COLUMNS has been exported. > > Isn't that the case in general? External commands *never* see > COLUMNS if it isn't in the environment. I was thinking the same thing. > The pipe is a red herring. Well, not exactly. As you said: > Seems like pip is behaving differently depending on whether it's > outputting to a tty or not. Probably, if the output is a tty then when it finds no $COLUMNS, it reads the width from the tty, and when it has neither it falls back to 80. Still that would argue for using ... COLUMNS=3D$COLUMNS ${~words[1]} ... That is, export an accurate value rather than an arbitrarily large one. The next question would be, is _arguments the only place this is useful? Or would it be better if _call_program always did so? E.g. local -x COLUMNS