I installed Nedit on my iMac this weekend. I used it several times and it worked fine. For some reason last night it quit working. When I type Nedit in the terminal window I just get the message

NEdit: Can't open display.

Using Homebrew again, I reinstalled Nedit using

brew reinstall nedit

Nedit still refuses to work. I am totally confused since it worked fine for a day and a half. Any clue why it stopped working? Was the fact that it worked the most confusing issue or the fact that it stopped. Its version 5.7 of Nedit and claims that its for High Sierra.

  • What is the value of $DISPLAY? Seems like you don’t have XQuartz running or your env var was lost
    – Josh
    May 15 '18 at 7:25
  • I started XQuartz before trying Nedit. When I type 'echo $DISPLAY', I get a blank return.
    – Natsfan
    May 15 '18 at 12:49
  • Ah, that is the issue then
    – Josh
    May 15 '18 at 16:07

Looks from your comment that your display variable is not set. Ensure you have an X-Server running (I. E. XQuartz) and then set your display environment variable first with:

export DISPLAY=:0

Launching applications from within the XQuartz terminal will have the $DISPLAY env var set automatically. You can make this change persist by adding that line to your ~/.profile or ~/.bash_profile file:

echo 'export DISPLAY=:0' >> ~/.profile

Note that in my setup, XQuartz automatically sets $DISPLAY for me without my needing to do this, so you may want to re-install XQuartz.(Or ask a follow-up question about why that behavior isn't working)

  • Sure. Note that you'll need to do this for every terminal session. You may want to add that to a .profile file, or launch from within the terminal in XQuartz
    – Josh
    May 15 '18 at 19:12
  • Josh, I added "export DISPLAY=:0 to my .bash_profile. This seems to work. Thanks again.
    – Natsfan
    May 15 '18 at 20:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .