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 4336 invoked from network); 6 Mar 2023 19:47:37 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Mar 2023 19:47:37 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1678132057; b=LpOIuFR2/P305gnFsz+o2fYQOahTxOeOhDZ12n1tkxd+/68kokgAxjFa/fJFFVscK5D1BhbNlF ivvpSeypiymYn2ZR823cTd8AAQX8jMMVrNFnbDOYhvdbXneGjKimhIf2/LNpUihFdU5S2/RXBe a1ZO6r9wa844SHQx2WbHN0csat7Y2w7rbIrJjr0iWigssPRbK0BWRb5FbMaEb9kfEtExgg3+2d U082nb/dAg7giV7GNac2ZQBk9gMAKLO9RwNcs7P1wf5WxBWm0jfBM0w5PQKt9p7ChTd9jbBygl rgPnn5dQfcxaFUxlEXHwRaKRenBvfK6vcdxDxX7ky5lItg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yw1-f176.google.com) smtp.remote-ip=209.85.128.176; 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=1678132057; bh=C77dWOZ5Mhii0WdvEerVlKVYML2qU48jwyRDX3Fhyi8=; 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=EGL7DdOkY2WYyYiCUkOWRePpZvFCYnsjl07j6z3wJs+eoR2VbUB+3Li7GOEAsaXUiactsktaMr 0fPExVTlLv0pgTc8b33sXbRrjUpwbNXKoFhWB7K6KhKydu6apLVt5j4StFqk8VqPl/vLPuhCQw CSdsaleXgdNutu5hYGDosnENww+z+Wh1olPnEUXg7tXCYI1jAihykl/F9pqFSR2rKno555L6Ad SyGJdgvmvxOXdUcIu821u0gwDZpVm55uYShagjsMNTZ4Zrfo2DsmJhc6qYbnvWv6q2v+BnBXgy GkanOtCIKbue7PweSNnvXUsZOLxzeZXRqTJkitokxK7qUw==; 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=C77dWOZ5Mhii0WdvEerVlKVYML2qU48jwyRDX3Fhyi8=; b=hWFqPghRK62117xjOagF6V+n7U I42yOM8DNG0aq2B81cfL9fQlBgYNnCKdUitn2m0wXjRnxkUJ7bQR26mMNjX8oykLFTIusF0gFyytu y12kDzu/RiH6PLTun5wtNRYdcNSZb/DgHOFpp05RiBpWDy/y3lAYk8PZe6uHAWYdp67Oo9QDI410U SHKIE9Hjf5N8iFjg6yFVIjTsNxjZp6m0gHfDTRe3gcdBr5V87+eDJ4q0tEChz+Cc/gH/h+RRJlbVO GsrmpnARr7Jecj8sXJpV9NJ+tnbXuVKgCYb6TdyTJRzZR5s5PNy48INl634Hk0aXaolb3EKd+M9kF y76kc3rw==; Received: by zero.zsh.org with local id 1pZGo5-000MOM-Bm; Mon, 06 Mar 2023 19:47:37 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yw1-f176.google.com) smtp.remote-ip=209.85.128.176; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-yw1-f176.google.com ([209.85.128.176]:35763) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pZGnr-000M51-Rq; Mon, 06 Mar 2023 19:47:24 +0000 Received: by mail-yw1-f176.google.com with SMTP id 00721157ae682-5384ff97993so204651937b3.2 for ; Mon, 06 Mar 2023 11:47:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678132042; 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=C77dWOZ5Mhii0WdvEerVlKVYML2qU48jwyRDX3Fhyi8=; b=cMTuxO69AGfhTAOsp3uyglhuYklj4Yiq2XsWw+gQSZRaXler79FLu6l5RUTcCGWZfo Ik6Og1rsecRtB2M9xwtHEngAD7HxitFAfCOZ6IA0izbwnmqmzXNIUU3jYZzNkj+Dam4e yKc0ybgtzGKRvySf8sXTZRiiUX21SgF5IUsbmbM6CDolz4ceyKuzvNvU0UmTFPvlwETT IYi8MY5vaSkcX/jb3Ncn5+2warlBpJzpP16pwuj02mwF431KvVEDB9Vfbug2B/t/R2/B EoPJ7DDgX0BHZnw0wMpfby51tiQyyrDzH4a14LHOokfw2YhQTGHDfmNvSF1zbMf93Hfz 0Jmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678132042; 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=C77dWOZ5Mhii0WdvEerVlKVYML2qU48jwyRDX3Fhyi8=; b=rZazVD3rtVc6CVHw5FGNgtZA9g2+3oZRBVJTJcSH+o/laUttBMYzmZhA5Gheaeo/nY Gkzupi9DWCLa3SxYHsCUWplZqrLmwK4Eck7cJwDPyH0CqI7voNxM3VtSYT2FA67BCXmd 0OExpizEZlCVw1YW9g5z9jDLBgewfu9tNBW68qp2R1P8t/hzEFsHBrnHRtepE1WPgaOZ JPwLSQ9rscW8d6M5g01h4TEKgzOmFq2Lfkzy4Q3G6liAs/Cw/SvxM0ceBuoJEH9KbJ+P 2/767Fzvu55n8q1kUB2MUTMhZ2kf1IqmwAW5yOen309/At5Vk6dMRwpr1q2SaRjFoP34 +Otg== X-Gm-Message-State: AO0yUKXkroJh03+4tiOGe1dypdDhn3esBTxKEMxP2N1cX7DZfH53Fcs/ 8lU7mYU3DjSPe+paVB+pM+9XCNS+g92MnoLeWUXpv43R+2g= X-Google-Smtp-Source: AK7set9Ym/FPF8m2m23UgtiuYgvE/P353PB0JoO5JdmxgpOGy9o28HuIs9C3pfVehuv78qSjmP6/VmSK/EEhA7OcLos= X-Received: by 2002:a81:ac63:0:b0:52e:fb7a:94b7 with SMTP id z35-20020a81ac63000000b0052efb7a94b7mr7164920ywj.7.1678132042428; Mon, 06 Mar 2023 11:47:22 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Felipe Contreras Date: Mon, 6 Mar 2023 13:47:11 -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: 51521 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 Mon, Mar 6, 2023 at 1:35=E2=80=AFPM Bart Schaefer wrote: > > On Mon, Mar 6, 2023 at 6:31=E2=80=AFAM Felipe Contreras > wrote: > > > > On Sun, Mar 5, 2023 at 10:28=E2=80=AFPM Bart Schaefer wrote: > > > > > > What's not clear is where the HUP is coming from > > > > > > 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. > > Sure, but vim is doing it before zsh starts up, whereas when you use > the setsid command it creates the new process group after zsh runs it. > E.g., without the setsid command, I believe the thread would be that > zsh execs nohup which execs xdg-open, all with no forking involved, > but if you add setsid in front then zsh execs setsid which forks > before exec of nohup. > > Zsh doesn't use setsid(2) and doesn't mess with the process group by > any other means unless there's a controlling tty to attach to, which > there presumably is not in this case. > > Still doesn't explain the source of the HUP signal, or why nohup fails > to ignore it ... unless xdg-open is deliberately unblocking it again. I believe that's what happens because GLib's g_spawn_async does something like that. When I hunted the code down I believe it does something like this: #include #include extern char **environ; int main(void) { char *const argv[] =3D { "/usr/bin/chromium", "http://google.com", NULL }; posix_spawnattr_t attr; sigset_t mask; posix_spawnattr_init(&attr); sigemptyset(&mask); sigaddset(&mask, SIGHUP); posix_spawnattr_setsigdefault(&attr, &mask); posix_spawnattr_setflags(&attr, POSIX_SPAWN_SETSIGDEF); return posix_spawn(NULL, argv[0], NULL, &attr, argv, environ); } --=20 Felipe Contreras