zsh-users
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: david rayner <david@rayninfo.co.uk>
Cc: zsh-users@zsh.org
Subject: Re: How does shell decide between gui vim & terminal vim?
Date: Tue, 30 Aug 2022 16:37:29 -0500	[thread overview]
Message-ID: <CAMP44s2kz_yaZy1A3V2n67JfOPPaWHMdsBgs5z36pzrY1qsEFA@mail.gmail.com> (raw)
In-Reply-To: <07075c9b-1d3e-e06c-c839-df64c73def01@rayninfo.co.uk>

Hi,

On Tue, Aug 30, 2022 at 4:13 PM david rayner <david@rayninfo.co.uk> wrote:
> On 30/08/2022 20:38, Felipe Contreras wrote:
> > On Tue, Aug 30, 2022 at 11:39 AM zzapper <zsh@rayninfo.co.uk> 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


      reply	other threads:[~2022-08-30 21:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-30 13:19 zzapper
2022-08-30 19:37 ` Lawrence Velázquez
2022-08-30 19:38 ` Felipe Contreras
2022-08-30 20:58   ` david rayner
2022-08-30 21:37     ` Felipe Contreras [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMP44s2kz_yaZy1A3V2n67JfOPPaWHMdsBgs5z36pzrY1qsEFA@mail.gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=david@rayninfo.co.uk \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).