How to know if the terminal supports GUI

How to know if the terminal supports GUI

am 03.11.2007 02:19:02 von linq936

Hi,
I am using BASH and I define vi() function to start gvim GUI
program. This works great when I work on my Linux machine, but when I
log in remotely, it errors out saying "can not open display". I have
to un-define vi().

Is there a way I can know that I am working in a text mode in the
vi() to start vim in certain mode?

Thanks.

Re: How to know if the terminal supports GUI

am 03.11.2007 03:14:59 von Barry Margolin

In article <1194052742.504386.210650@v23g2000prn.googlegroups.com>,
linq936 wrote:

> Hi,
> I am using BASH and I define vi() function to start gvim GUI
> program. This works great when I work on my Linux machine, but when I
> log in remotely, it errors out saying "can not open display". I have
> to un-define vi().
>
> Is there a way I can know that I am working in a text mode in the
> vi() to start vim in certain mode?
>
> Thanks.

Check whether the environment variable DISPLAY is defined.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***

Re: How to know if the terminal supports GUI

am 05.11.2007 10:06:05 von ramesh.thangamani

On Nov 3, 7:14 am, Barry Margolin wrote:
> In article <1194052742.504386.210...@v23g2000prn.googlegroups.com>,
>
> linq936 wrote:
> > Hi,
> > I am using BASH and I define vi() function to start gvim GUI
> > program. This works great when I work on my Linux machine, but when I
> > log in remotely, it errors out saying "can not open display". I have
> > to un-define vi().
>
> > Is there a way I can know that I am working in a text mode in the
> > vi() to start vim in certain mode?
>
> > Thanks.
>
> Check whether the environment variable DISPLAY is defined.
>
> --
> Barry Margolin, bar...@alum.mit.edu
> Arlington, MA
> *** PLEASE post questions in newsgroups, not directly to me ***
> *** PLEASE don't copy me on replies, I'll read them in the group ***

I think if you have xterm software then it should be supporting GUI

% which xterm
/usr/bin/xterm

Re: How to know if the terminal supports GUI

am 05.11.2007 11:53:39 von Barry Margolin

In article <1194253565.458090.318920@v29g2000prd.googlegroups.com>,
rthangam wrote:

> On Nov 3, 7:14 am, Barry Margolin wrote:
> > In article <1194052742.504386.210...@v23g2000prn.googlegroups.com>,
> >
> > linq936 wrote:
> > > Hi,
> > > I am using BASH and I define vi() function to start gvim GUI
> > > program. This works great when I work on my Linux machine, but when I
> > > log in remotely, it errors out saying "can not open display". I have
> > > to un-define vi().
> >
> > > Is there a way I can know that I am working in a text mode in the
> > > vi() to start vim in certain mode?
> >
> > > Thanks.
> >
> > Check whether the environment variable DISPLAY is defined.
> >
> > --
> > Barry Margolin, bar...@alum.mit.edu
> > Arlington, MA
> > *** PLEASE post questions in newsgroups, not directly to me ***
> > *** PLEASE don't copy me on replies, I'll read them in the group ***
>
> I think if you have xterm software then it should be supporting GUI
>
> % which xterm
> /usr/bin/xterm

If X you're not logged in through X windows, /usr/bin/xterm will still
be there, but the GUI is not available.

To the OP: how do you login remotely? If you use ssh with X windows
forwarding, vim should still work.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***