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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13551 invoked from network); 4 Aug 2021 01:13:10 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 4 Aug 2021 01:13:10 -0000 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-Type:Subject:Cc:To:From:Date: References:In-Reply-To:Message-Id:Mime-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=WCDo9cYja7amTxW36YFI3NXbIqlOwU/XJSi5YTO0iP8=; b=PSulELV4nUVzqh/2u55pWCSchU gpNzpsmZSuCqTR/Rw/RQK/uJILkLkW3K6XP+8VxHCx6HZ0m80Q4iQVogMqlaGt5IlQVOV84nvuDa3 uQ4al8WGwPoMevm/Q3f7qHwf9QOGPpP5+ZfqUuwVJe0ycGIE+4baPk7N+gICRRp2iNEWhEjep05iL fD7PLjKqIh4/l5mP7+tl7dvTQHRqc+nt3mZ2rD4lZKA6ynGNi78Os6p6n/jj5NNlKCBELSTdJG/p1 8eaJqlGhCxdXooyrh7Y4/TB3LrSfkxjdsCBE3zITpLJIti+dHdXnflEnb5SjYs/Idb+VqXs4miVHG feiYO5ZA==; Received: from authenticated user by zero.zsh.org with local id 1mB5T4-0008pE-76; Wed, 04 Aug 2021 01:13:10 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mB5Sm-0008Wh-Aj; Wed, 04 Aug 2021 01:12:52 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id 412A727C0054; Tue, 3 Aug 2021 21:12:50 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute3.internal (MEProxy); Tue, 03 Aug 2021 21:12:50 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrieehgdeflecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderreejnecuhfhrohhmpefnrgifrhgv nhgtvggpgggvlhojiihquhgviicuoehlrghrrhihvhesiihshhdrohhrgheqnecuggftrf grthhtvghrnhepieekjeevledugeefiefgueelgffgtddtgeehvedvhedviefghedvffeu vddvueehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eplhgrrhhrhihvodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdduudehudek jeejtdegqdduudelvdejfeekhedqlhgrrhhrhihvpeepiihshhdrohhrghesfhgrshhtmh grihhlrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id A13EFA03DA9; Tue, 3 Aug 2021 21:12:49 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-548-g3a0b1fef7b-fm-20210802.001-g3a0b1fef Mime-Version: 1.0 Message-Id: <549459d9-eee8-43b2-b8c6-71c11291f012@www.fastmail.com> In-Reply-To: References: Date: Tue, 03 Aug 2021 21:12:25 -0400 From: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= To: "Marlon Richert" , "Bart Schaefer" Cc: zsh-workers@zsh.org Subject: Re: [PATCH] Increase $COLUMNS when generating long option completions Content-Type: text/plain X-Seq: 49235 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 10:05 AM, Marlon Richert wrote: > On Mon, Aug 2, 2021 at 2:07 AM Bart Schaefer wrote: > > > > I'm puzzled, doesn't this imply that the value of $COLUMNS is > > incorrect on entry to the function? > > No, the problem results from _call_program being connected to a pipe: > > _call_program $lflag options ${~words[1]} --help 2>&1 | > while IFS= read -r opt; do > > 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. The pipe is a red herring. > For example, compare the output of the following: > > % pip3 --help > % _call_program tst pip3 --help > % _call_program tst pip3 --help | cat > % print -r -- "$( pip3 --help )" Seems like pip is behaving differently depending on whether it's outputting to a tty or not. -- vq