From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 2177720CAD for ; Sat, 20 Jan 2024 22:14:45 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1705785285; b=L7guL9EQfV9qky33WTBRRP+fC2HabWvmzmWICM0yN07m6CWRi/gTHz2NUtjlWsXzNkn8Ndwxm1 ZjI3gCJb2MBJm71DsdoJT7f//wm4xng4DYK9EUEKUydRQ6sAWG+Ntcj7NLKJ4lBTygUteeyPXm khuuOfD5nf1blF2E3kgxE+XU8lXNskqkVxpajIc2QegNPLcPUsaAfMuySTONcAzpSa5xML3PhJ ZueqpfQm2yixV4jm9wCxGG0AR+E4MDt4zEp5NoZsCKsPvXutIUQp0INPx2UFv1dMKR1N54MMr8 bIrMKyoHfW4fckg1IU8NTP/6UADHQdpeKCj62MDoerC7dQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f41.google.com) smtp.remote-ip=209.85.208.41; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 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=1705785285; bh=bcHglYzYZRzuQQyXhpmz5LSwGARpZ7G1D9/q24suO18=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=G++E6qk6HVMBREqVukb6vtebantuj9NTm9dHrnA79FM/aDm+XKJ27oAF8fMIQEzJh8YPaz5HdC MLpRCEPQre9IYk0dYVB5W5SmA7sz7GHD84KbqkiANEavY8W9ZBd1tLoWx2ahkxKfK2yY3JcUyH zU7u1PsGf3B1XHrcGEM+JU40h93z5TqPZEZi3frM4KJ8h2aeBveDcJu8LRGIwQpsOw++raf94O 32vv/e4qMPUnsbdWMjkKda6BmFkvy/rfrlYyviZJepS/CzFUd3GjzOiM+FqNZUXwkTn4KtVsOm gZJDRB6lpbGStc7K5rvK2N3y+Q5o5p/UfSdPpy0Wpu4LYQ==; 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:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=jAKIlM9yHE39lf1aoa9Qo9jPrJZYYjtErMmgYyjwIp4=; b=Jebq1YTmmjl21RJgl0J6Wvbpjs wtq1t4bSBWBZ9CDkcx7peMxnfc5VWMYAHgkWLq8hBMZrT5c608+KGCYazM9kREz/36zi9eJkIO1yc nQaMlNl+kU/LeMnioRrq87FbLTAsd+IyfvGyV/hPtbdV6Rj5G2Yx1bDd/TmyaMINMiZiCtjpJUK2c RA8il0EYaGi2Xrt6lmAtzGbdoazWUBcxLWsq2fcrCmXkBfoMojwoPOoWCx0hVNKoyDxMuR9nT1gKK DF93dw56GhzaE1oGDOr+hdaapIHca7RG8CkJPtIJJ7miMS3v5vrWbcnAg7jii7OjgxDOmy/+Ojccz ahDq661A==; Received: by zero.zsh.org with local id 1rRIfr-000MDx-Nk; Sat, 20 Jan 2024 21:14:43 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f41.google.com) smtp.remote-ip=209.85.208.41; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f41.google.com ([209.85.208.41]:43213) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rRIfV-000Luw-0D; Sat, 20 Jan 2024 21:14:21 +0000 Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-559cef15db5so5502848a12.0 for ; Sat, 20 Jan 2024 13:14:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1705785260; x=1706390060; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=jAKIlM9yHE39lf1aoa9Qo9jPrJZYYjtErMmgYyjwIp4=; b=uThx5EDQgJdfpsGFliWZCcYfdS5wmNb/u69KaQwSKjMLkugPt+1SEGGnvGnsfu6GSr T8x2idoNTOThGB/xWnFM9nViCw/Htl314vch7/5X9Z8lTfMCnVZpiZTbploZvWJc7lbr N0Ol9WTw8SzBrPknMnE13GEoGQ4/+OrrVJ8uI8LUMDE8T+hIfFbq9tbW5j2RxeawzRXv 0AOSgNhmZFI/5GYEiYRKMoSGDPdUKrMMob9g0h+5xPjgM2GcM9EzJT3zBzNi/spApB0Q 2w8j94iHhfpeoOrZPG8PxbuvggEF0o1E/QKxgnNa2bbFwWtGgAjYMcGok8FtrYi8AF8z 1WWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705785260; x=1706390060; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jAKIlM9yHE39lf1aoa9Qo9jPrJZYYjtErMmgYyjwIp4=; b=gUfFbBMM0bLjOlrhyWVKTlCCtIs+KhMXJGAdiBfBzSu77oQcq4uRPmKUyrRTfmypzI VSuy5RsYqGD/WT6rcdB9lrQsC+kmsbCFmu6zYjeBrm3j/EddChnrojcycavgIvE6xOA4 pX0GX1UfArQn7LGfWFMDYNCT8w3FUCScIRSkUJ7sg78QVIlb3AXcg/EZ/42u3WAQkrsn iaJU+f+PNh6jUCOJHCLruYEp44wRVJ1C6hcwP4ke76UKftCdQbyMb/BM+sPs3YXXx0lK bZxFb+eop9UImIwb3lQmIqd88Jcvdoz3o0UYY1LW5EjJTvyKfFbRXEFExw9lEhF5AtOD jUWw== X-Gm-Message-State: AOJu0YwUEWEWWQAQgTrfH8aFGiLb7HhjZVmVssnogV9BPpyJae6DukRr vvNPga5TVjskIc5FWjKUfuOB3RSXyk3jcleXaME7jmx59VKHL5eg6MMawlBOLJvNFZf20toT6n0 8BajhiPWNJIY0wcN3zXebbVYNmGSS6AM7iXRw X-Google-Smtp-Source: AGHT+IF7v+A07FL1AoB0oRHBeJBMPRkNBqIgvl7kPpjveKngvpVpQVSwx4S33C+AsoLOEYkZWu859lhzx98ehWFnANk= X-Received: by 2002:a17:906:31ce:b0:a2f:6a3d:e39c with SMTP id f14-20020a17090631ce00b00a2f6a3de39cmr3113238ejf.18.1705785260088; Sat, 20 Jan 2024 13:14:20 -0800 (PST) MIME-Version: 1.0 References: <20240119232229.177255-1-wesleys@opperschaap.net> <20240120123054.290214-1-wesleys@opperschaap.net> In-Reply-To: <20240120123054.290214-1-wesleys@opperschaap.net> From: Bart Schaefer Date: Sat, 20 Jan 2024 13:14:08 -0800 Message-ID: Subject: Re: [PATCH v2] Fix jobs -p to be POSIX compliant To: Wesley Schwengle Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52494 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 Sat, Jan 20, 2024 at 4:31=E2=80=AFAM Wesley Schwengle wrote: > > POSIX says that with "jobs -p", only the PID is output, whereas zsh > outputs full information. > > There is discussion in the bug regarding POSIX_BUILTINS and refers to > workers/21366. The latter is interesting because it refers to setopt > long_list_jobs. I would want to argue that jobs -p should only show the > PID regardless of that setting and POSIX_BUILTINS. jobs has the -l > option, where the full line is displayed. From that point it doesn't > make a whole lot of sense to have jobs -p do the same thing. This is not correct. As you noted later, "jobs -p" lists information about process group leaders only, whereas "jobs -l" lists all jobs. This differs mainly when there's a pipeline: % sleep 30 | sleep 20 | sleep 10 & [1] 67157 67158 67159 % jobs -p [1] + 67157 running sleep 30 | running sleep 20 | sleep 10 % jobs -l [1] + 67157 running sleep 30 | 67158 running sleep 20 | 67159 running sleep 10 % > Than there is the issue where its argued that zsh shows the group pid > and not the actual pid of the process that is running. I looked at the > output of bash and with this patch zsh and bash act similar. More relevant is how they compare without the patch. If we really wanted to make this POSIX compliant, we should arrange that "jobs -lp" shows "more information" only about process group leaders (currently -l simply overrides -p) and add "jobs -n" to produce the notifications that are suppressed by "setopt no_notify" (setopt long_list_jobs would apply here). However, I'm generally not in favor of changing longstanding zsh behavior for POSIX compliance without some kind of additional conditions, such as [[ -o POSIX_JOBS ]] in this case.