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,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31360 invoked from network); 6 Mar 2023 14:31:43 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Mar 2023 14:31:43 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1678113103; b=DiGfvst5KmTUipZXl64wVpl87c7jv1QSMUvj1fdTytaeLe5drleCEMguEgxKaHLMaGroca3Rys ieHD06YCwjbfaM2H7xalXkZH29q3SkkvH++MMKVokXcjgJ9cSpfVLSdPV832F46T6r8zqHJBRC Z+jErrqGzGeeKOESEabpRQwVjKsAdxae5hLCHJKyYfGgDfFlhAV5sInvvV5asF0eE2OGkaYmHX MQTmWVNk9ijb+GO1ZSOLTeJSROnBry8DCXyVwIz93f3T6w5GgRQhyhc2YSbWFLi5vWymjdlXCE kIMEjFLEF8GmgF/zpru387WvS8FqqRPbch6o6jBIYaF14g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f173.google.com) smtp.remote-ip=209.85.219.173; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1678113103; bh=2M1bbWKxO6qyGPd8YoEec/LxT6w9g/phbl5vkH8AwQM=; 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=SVfO//MTqqzhknrJt9th60534o4qEFxRBnEs7cVVLzeS2vc27hQ+W1Roedo+k40pup1Mi8iIGY BE5/0e+l3r4qdQghR2xVKyxuWS520+xc1YFjcKc0cxZj2qOwl1AMQB8FZIfwgHxRII78YJ+mJS fSJwnKZGIymg6X1YI2EcwYoLB8bPx+bsc1HNx2Uu2sXFqLGTNOgDUWtNZ0G3uHvL81YwIyrdro 5L51h6EYVcR7p03jP5e0Bd9Ej9JF1MXZyegmYr5C+7Z/fk1i54vSjleH4Q/vNLN1pkSOpN01Wq ozFoYINRCGfGFuW5apQ62RMQZd8ZD6zoU0t/9lgX/0MPUA==; 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=4hnnAzThpGoeRMz/z0qBmQuyHZ6dFlqweggFf9nwzEw=; b=IG70saHA6qhc+AZlLXmn0IW7Uu og4kA4RzIIP4b3Sd4JKIdjZvPJ/Hg6tMcyospK4aUV5qMvbqWWBhriNfY6RO04hFFQchxX6VVlY7F CI2YYa6rSV8XORXdsi59+TNsOLWBzf2M/7/xBagr/g/x2vqKuDxY7c3NQGY0BrDz9HeQ6FReKB6pu /pSc3L4qXRc29//ISoNYM3DnZFJxmKQ/u8PZFSD/8UaMO75nSLU2HCcHNc3uxP6QaAlFcg90ZC4Ad YjXL361p4Q7RU0IDvmnWhV1B0ok1JFJmLdWfchDfEegnv941rbzWqxhfev+kRxQn6bt2vry59MVn9 Ey/pIsgQ==; Received: by zero.zsh.org with local id 1pZBsN-000CuW-1M; Mon, 06 Mar 2023 14:31:43 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f173.google.com) smtp.remote-ip=209.85.219.173; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-yb1-f173.google.com ([209.85.219.173]:45764) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pZBs6-000Cbc-Qx; Mon, 06 Mar 2023 14:31:27 +0000 Received: by mail-yb1-f173.google.com with SMTP id y144so8243982yby.12 for ; Mon, 06 Mar 2023 06:31:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678113085; 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=4hnnAzThpGoeRMz/z0qBmQuyHZ6dFlqweggFf9nwzEw=; b=Z35WdCosWROcOFiSgYvwLRtQuXABIXTlWnZHBF22cZmj7KdwaMqZ4bV2XfIYIo2Sg3 V1cXuQL77xmH2N8wE0AvKfer2roZ+/MC7ppbR4j5MqJ/+ItPFt5pmUqQDBrYJPI1daJy 4ufxU9Sgiyy+5JkUgv/q93eFlFSgYcWV8xB6wKQpb4efMISwrhMxVLsjiQHZYKqEVuPD QEN3lQmqe/w7ZUZNGpwQWkL0om/CVcC974K6arnr/X41wgNHu67sRog0kwj0ufhASiXL 2JkfJVECVkWazXkd8okq+4qjlOOrbsGgtQD1A5K/Jevb8T4gTE9JI5JNQk/j486fG83I WrxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678113085; 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=4hnnAzThpGoeRMz/z0qBmQuyHZ6dFlqweggFf9nwzEw=; b=HhkWf88T3oTd29uEX3RdUQdixLgSAm86frF/+Wd0JbjUvKxHgsEarStOjOBkBoYSr3 mm+7wOVF6vCG6+LnuXjn7zoQvocdgKDD+2EWUgkZUZuAOIjaVcJ17jJEFPKfk/gxkCPC 2PpjzBHnk2VVAeZC+Wnh1c145h/r56Mx2RUYQFzZFZueqcCXNNwQ1763eAK1Ud8pFuJA 4aQ4TEwEuCRVyS0I0Y++8r1GZhRbc/l38qKLLUBhvM0e98LC/QgmZNE2N+UKrWulq0vb fTf9yE/s62kJg0nysz8xYWHbcbiAXCVN5FgpjRKGF9v+u9QOObtQP7E8UC0arQYDYGEO MOcw== X-Gm-Message-State: AO0yUKXybqrzk3LSfAS43ysnudi1zFL4FgWmpA+QrpR4aW4IwCYXiGYJ ttI1F8gWud+cDEYXEGdy90/qBHAQo+880aJVjXM= X-Google-Smtp-Source: AK7set/OV5aqLlzYMuibGrbbSEj9vOQAdIOn8F6R5R7MqugqSixdWlhZL9boXP45aaDWE/MiELs6kROly6p9QdM8tME= X-Received: by 2002:a5b:5d0:0:b0:a48:6236:1be4 with SMTP id w16-20020a5b05d0000000b00a4862361be4mr6549943ybp.2.1678113085529; Mon, 06 Mar 2023 06:31:25 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Felipe Contreras Date: Mon, 6 Mar 2023 08:31:14 -0600 Message-ID: Subject: Re: Weird bug / missing feature with gvim interaction To: Bart Schaefer Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 51517 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 Sun, Mar 5, 2023 at 10:28=E2=80=AFPM Bart Schaefer wrote: > > On Sun, Mar 5, 2023 at 5:34=E2=80=AFPM Felipe Contreras > wrote: > > > > I've been investigating for a while a weird interaction with vim and > > zsh, and this is the closest I've gotten to narrowing down the > > problem. > > Seems to be a race condition or similar, related to the fact that zsh > does an "exec" (without forking) of the very last external command > that it's asked to run, whereas bash and most shells always fork and > wait. They wait when they started the child job, when xdg-open spawns a fork there's nothing to wait for. > > 2. fork with setsid (the grandchilds are sent SIGHUP) > > I believe there is no grandchild, because zsh has replaced itself with > xdg-open. If I either run xdg-open under strace -f, or wrap it in > another script that runs > /bin/xdg-open "$@"; sleep 1 > then it all works. Yes, but *only* if you sleep. > What's not clear is where the HUP is coming from, if you're right > about that signal. If this were a tty ownership issue, I'd expect a > TTIN or TTOU. > > Puzzlingly, using "nohup xdg-open ..." doesn't help. That doesn't help, but "setsid nohup xdg-open ..." does help, both in bash and zsh. But I believe that's what the vim code essentially tried to do. --=20 Felipe Contreras