zsh-users
 help / color / mirror / code / Atom feed
* How does shell decide between gui vim & terminal vim?
@ 2022-08-30 13:19 zzapper
  2022-08-30 19:37 ` Lawrence Velázquez
  2022-08-30 19:38 ` Felipe Contreras
  0 siblings, 2 replies; 5+ messages in thread
From: zzapper @ 2022-08-30 13:19 UTC (permalink / raw)
  To: Zsh-Users List

Hi

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?


zzapper




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How does shell decide between gui vim & terminal vim?
  2022-08-30 13:19 How does shell decide between gui vim & terminal vim? zzapper
@ 2022-08-30 19:37 ` Lawrence Velázquez
  2022-08-30 19:38 ` Felipe Contreras
  1 sibling, 0 replies; 5+ messages in thread
From: Lawrence Velázquez @ 2022-08-30 19:37 UTC (permalink / raw)
  To: zzapper; +Cc: zsh-users

On Tue, Aug 30, 2022, at 9:19 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?

The vim documentation might know.

https://vimhelp.org/gui.txt.html
https://vimhelp.org/gui_x11.txt.html

-- 
vq


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How does shell decide between gui vim & terminal vim?
  2022-08-30 13:19 How does shell decide between gui vim & terminal vim? zzapper
  2022-08-30 19:37 ` Lawrence Velázquez
@ 2022-08-30 19:38 ` Felipe Contreras
  2022-08-30 20:58   ` david rayner
  1 sibling, 1 reply; 5+ messages in thread
From: Felipe Contreras @ 2022-08-30 19:38 UTC (permalink / raw)
  To: zzapper; +Cc: Zsh-Users List

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.

-- 
Felipe Contreras


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How does shell decide between gui vim & terminal vim?
  2022-08-30 19:38 ` Felipe Contreras
@ 2022-08-30 20:58   ` david rayner
  2022-08-30 21:37     ` Felipe Contreras
  0 siblings, 1 reply; 5+ messages in thread
From: david rayner @ 2022-08-30 20:58 UTC (permalink / raw)
  To: zsh-users


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


echo 'Red Face'

zzapper



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How does shell decide between gui vim & terminal vim?
  2022-08-30 20:58   ` david rayner
@ 2022-08-30 21:37     ` Felipe Contreras
  0 siblings, 0 replies; 5+ messages in thread
From: Felipe Contreras @ 2022-08-30 21:37 UTC (permalink / raw)
  To: david rayner; +Cc: zsh-users

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-30 21:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-30 13:19 How does shell decide between gui vim & terminal vim? 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

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).