bashrc: how to know X window is available or not?
Fresh3 days ago
Mar 15, 20266285 viewsConfidence Score0%
0%
Problem
There is a part in my , which sets $EDITOR to be gvim. It works fine when I am in X window. However, if I ssh to my workstation (from another workstation) gvim starts to complain "cannot open display". Therefore I wish to put an statement in bashrc, that if X window is available then use gvim, othe…
Error Output
~/.bashrc
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Canonical Fix
Unverified Fix
New Fix – Awaiting Verification
Fix for: bashrc: how to know X window is available or not?
Low Risk
One way to do this tests the existence of the DISPLAY environment variable: In some cases, DISPLAY will be set even though your gvim won't be able to contact the X server. In those cases, use the RunningX program:
Awaiting Verification
Be the first to verify this fix
Sign in to verify this fix