Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
5 Markup
source | link

Thanks to @Ignacio Vazquez-Abrams and @Jeff Schaller (and other commenters below), I realized that $DISPLAY was the enviormental variable I needed. If you are in a display server the value held by $DISPLAY will be 0 will be returned (as something). Hence, the following code (should?) works--

if [[ -n $DISPLAY ]];
then
    PROMPT = (etc)
else 
    PROMPT = (etc2)
fi

Thanks to all.

Thanks to @Ignacio Vazquez-Abrams and @Jeff Schaller (and other commenters below), I realized that $DISPLAY was the enviormental variable I needed. If you are in a display server the value held by $DISPLAY will be 0 will be returned (as something). Hence, the following code (should?) works--

if [[ -n $DISPLAY ]];
then
    PROMPT = (etc)
else 
    PROMPT = (etc2)
fi

Thanks to all.

Thanks to @Ignacio Vazquez-Abrams and @Jeff Schaller (and other commenters below), I realized that $DISPLAY was the enviormental variable I needed. If you are in a display server the value held by $DISPLAY will be 0 will be returned (as something). Hence, the following code (should?) works--

if [[ -n $DISPLAY ]];
then
    PROMPT = (etc)
else 
    PROMPT = (etc2)
fi

Thanks to all.

4 [Edit removed during grace period]; added 7 characters in body
source | link

Thanks to @Ignacio Vazquez-Abrams and @Jeff Schaller (and other commenters below), I realized that $DISPLAY was the enviormental variable I needed. If you are in a display server the value held by $DISPLAY will be 0 will be returned (as something). Hence, the following code (should?) works--

if [[ -n $DISPLAY ]]]];
then
    PROMPT = (etc)
else 
    PROMPT = (etc2)
fi

Thanks to all.

Thanks to @Ignacio Vazquez-Abrams and @Jeff Schaller (and other commenters below), I realized that $DISPLAY was the enviormental variable I needed. If you are in a display server the value held by $DISPLAY will be 0 will be returned (as something). Hence, the following code (should?) works--

if [[ -n $DISPLAY ]]
    PROMPT = (etc)
else 
    PROMPT = (etc2)
fi

Thanks to all.

Thanks to @Ignacio Vazquez-Abrams and @Jeff Schaller (and other commenters below), I realized that $DISPLAY was the enviormental variable I needed. If you are in a display server the value held by $DISPLAY will be 0 will be returned (as something). Hence, the following code (should?) works--

if [[ -n $DISPLAY ]];
then
    PROMPT = (etc)
else 
    PROMPT = (etc2)
fi

Thanks to all.

3 added 30 characters in body
source | link

Thanks to @Ignacio Vazquez-Abrams and @Jeff Schaller (and other commenters below), I realized that $DISPLAY was the enviormental variable I needed. If you are in a display server the value held by $DISPLAY will be 0 will be 0returned (as something). Hence, the following code (should?) works--

if [[ $DISPLAY-n ==':0'$DISPLAY ]]
    PROMPT = (etc)
else 
    PROMPT = (etc2)
fi

Thanks to all.

Thanks to @Ignacio Vazquez-Abrams and @Jeff Schaller, I realized that $DISPLAY was the enviormental variable I needed. If you are in a display server the value held by $DISPLAY will be 0. Hence, the following code works--

if [[ $DISPLAY ==':0' ]]
    PROMPT = (etc)
else 
    PROMPT = (etc2)
fi

Thanks to all.

Thanks to @Ignacio Vazquez-Abrams and @Jeff Schaller (and other commenters below), I realized that $DISPLAY was the enviormental variable I needed. If you are in a display server the value held by $DISPLAY will be 0 will be returned (as something). Hence, the following code (should?) works--

if [[ -n $DISPLAY ]]
    PROMPT = (etc)
else 
    PROMPT = (etc2)
fi

Thanks to all.

2 ':0' instead of '0'
source | link
    Post Undeleted by user279540
    Post Deleted by user279540
1
source | link