MacOS – Nedit stopped working on the iMac running High Sierra 10.13.4

macosterminaltext-editor

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.

Best Answer

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)