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, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 32265 invoked from network); 30 Aug 2022 21:38:46 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 30 Aug 2022 21:38:46 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1661895526; b=HNCv7XWzX/VoqlIXmBrtcQ5UYZO5BGVJxThMNkqv4AGyQdST9kQm8IVRRbfgrOl4i8djQd9kb+ WK3E1Z0Hcz96JbI25ScMMiF6ghZI6sjvilVDLnqTDftFoCWR90BlBmC9YK7Hxq+08FvLZEWOU5 rI0Gsg6ZK3Xd5Y1mLLgMLlgIXo0RSfp2xOx59mfI0q2Mwf6A6deCgcXrlRg9LDpi40f+Ygnjoz TToWVZPNYw4kxp07CMAq1QBybo1i0mdSVd/Nq21ZIK8JgUxIPLI+DdxCFUh2dnGq/vWI7SI1Wb UrDj0oU1667WdB0MVHVlBryvknV5sWHZ9CUKsHwyePgQFw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f48.google.com) smtp.remote-ip=209.85.208.48; 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=1661895526; bh=Zs9bDjVuhvm3jEfQ0b/FkIa9qhqhlx5vckASRQ60PMI=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=TpgcheGLt/uBjedNPNRCBP67B/MUTtR+YwSWy+B1SO5DT2KHjQj6mpciuSlRcEDTtWzTwipw97 FOTAhQ+YR1N+oZMGnO7yO/usXnQUrEib1ifyPvW9td28FrJKNwPu7ZXNpWcy1c3n8PHiyIcLjI IEEyc7NDp3Q6JFfOO2hnD1/kO2+9mYG/f5xPquweGhbn+AghAzL2SA4895acgyaN8u5X/FMyGo thbNzinlxhQdmCPi51tgRakwjQD4LQvqIIH4WVprTqTf9/yWxx5rWGwyiErgEha+B7V9CqwUxd u4vUowZgjPqVxSCq2OyIEE0DiTeFwfskTJPFhmG4Rm5Vdw==; 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:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References: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=NmnFzZoNPBh8KgurqiDKtE2Elx99kWR7zhU8Gbx/TdI=; b=UQGvtcI96DCOJYadaYjZPwBg84 kQ9kJ78xBK935N+ejVTDAX4fWEqexVMUso68LZ8Aj4SvBztIIEj8vVM1nucXEx5X0A89arSm4bk8f NceBn3GlcAfeeYSa44OopP56NAu1yKz6R8OUT28eDRnqOxdAypG5PYnwfvvVCyk+nsX9WK1tYNyRT 1tjq2ZNJPaWLq63TMdPLVI1lQA11ZUQxiLzWIwup3mteHHYnJJmSKhYhcgFM7SigFaufNv6fiyXYY 1kEabG/SJVngfeToRjdwQaxIHQA/xHAFlWqTaUOxahp8yQaE4P+/OEr6/37rGUzwFQy+g05c3lufv 9KsYeswg==; Received: from authenticated user by zero.zsh.org with local id 1oT8wY-000Jgb-0G; Tue, 30 Aug 2022 21:38:46 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f48.google.com) smtp.remote-ip=209.85.208.48; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ed1-f48.google.com ([209.85.208.48]:33673) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oT8vU-000IiD-Ky; Tue, 30 Aug 2022 21:37:41 +0000 Received: by mail-ed1-f48.google.com with SMTP id w2so439888edc.0 for ; Tue, 30 Aug 2022 14:37:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=NmnFzZoNPBh8KgurqiDKtE2Elx99kWR7zhU8Gbx/TdI=; b=hqTgoHu+wEtJm8hseK7spt+UVeStibaxq8+FnBLLxlr2ZmKrq9QZ1Ui6Cg42+L5PQc cYmJCgRXSxhjNtvmRgJwTx/Zcb4oCviAi+HftglQ6k9WbN/FgYYBHXAYbnZQ+V+X8xMD CrbRgcWl3hBigH7YuRWZX5MQlK0nyJnFGuXRyvnMgJALlMfAUi9mrRvkbqFEB0jftD8h M25uGqu60dPy0xO8I3C+9H4odyRH9ZwucYr6ENn2YE0XMX4GwJsxV75onV2N87z5qVZ9 SOYGpwGahzZWN4R4GBP4jQ5n1ZiQQUlDOrqVnZlYsM9LtQzixrnxaTCWcdmDTXbZS2C2 +weg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=NmnFzZoNPBh8KgurqiDKtE2Elx99kWR7zhU8Gbx/TdI=; b=r9WJSdN4Ej+b9UMz02j8cg9QKQ90ylDcl3AlXdrTzjL1J/lgRPTYT2pTeVOEdk9GzE 0HXhsnlSm4D+oYGXTPCSNcLSGN3dzN8LH9IGDVemfyrrldZM+YD7IQa+eaDg9Nen8po7 4EKFoUBqbIZbgLJ4OVzdNM+yrUimBEMf84jEoEZkzUGkr9pPgvBHDlidkvK2brFYk7TG b4tx/2W9L4C8ZAGBdDa2cRHO+Nkcfuu0dSy5LPlUxXznSLQt2bIRRjSvTg3TzOrsgy2r rzpfsJrDaf4Z5fCFs6WdcjFcMwHgd/NMOVPJNHAlryBA1EfYS0M1bO4KYJphUrBrBc14 4PQQ== X-Gm-Message-State: ACgBeo2A8XmD1HHFppCJGAAVuuqIR4b+MnS+xywxWcLePVLtP7NmuaFk FBdeCD9ndt8z6CFlL8Xs8GkzSJMxSHgu4hFKzowGZrqt X-Google-Smtp-Source: AA6agR7Nro5cyfYH6qaK4bID9PWpg2SGgKrlKyZBt6p79XvxA5cb9n5rRzDxBvAUOggbtqDr/th0Yb6WksROG1yCtHs= X-Received: by 2002:a05:6402:354d:b0:448:1f80:e737 with SMTP id f13-20020a056402354d00b004481f80e737mr14410821edd.69.1661895459990; Tue, 30 Aug 2022 14:37:39 -0700 (PDT) MIME-Version: 1.0 References: <07075c9b-1d3e-e06c-c839-df64c73def01@rayninfo.co.uk> In-Reply-To: <07075c9b-1d3e-e06c-c839-df64c73def01@rayninfo.co.uk> From: Felipe Contreras Date: Tue, 30 Aug 2022 16:37:29 -0500 Message-ID: Subject: Re: How does shell decide between gui vim & terminal vim? To: david rayner Cc: zsh-users@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 28017 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Hi, On Tue, Aug 30, 2022 at 4:13 PM david rayner wrote: > On 30/08/2022 20:38, Felipe Contreras wrote: > > On Tue, Aug 30, 2022 at 11:39 AM zzapper wrote: > > > >> I am using a shell (/bin/sh) script which stubbornly calls the terminal > >> version of gvim instead of the desired GUI version (gtk). > >> > >> I suspect the script doesn't know there is a GUI but what decides that? > > How is it being called? Some programs use the $VISUAL or $EDITOR > > environment variables to decide which editor to open. > > > PEBCAK: embarrassing mistake! > > Of course I'd set EDITOR=/bin/gvim but in .zshrc > > but the sh script obviously wasn't using .zshrc I've thought a lot about how to set the editor properly, and my conclusion is that it doesn't belong in .zshrc, but .zprofile. In fact, it's better to set the editor to "vim" in .profile, and to "gvim" in .xprofile. Of course, this depends on how your session is being started. But anyway, the point is that it should be in the environment, *before* starting the script. -- Felipe Contreras