HELP! Terminal gedit error

Discussion in 'Mac Programming' started by trojanlax04, Jan 31, 2012.

  1. trojanlax04 macrumors newbie

    Jan 30, 2012
    First off, I just want to say that I'm really new to computer programming... having a Mac is making this 10x more difficult because nobody here is familiar with Macs.

    So like 5 days ago, I opened up Terminal and connected to our school's server and I managed to open up gedit and start writing a program. However, yesterday when I tried to open gedit again and any of my .cpp files, I got (and have continued to get) the follow error: "(gedit: #####): Gtk-WARNING ** cannot open display:" The ##### digits are different every time I try. I also tried using X11 and I got the same error.

    Does anyone know how to fix this? Or what's even wrong? All of my classes' TAs are not familiar with Macs and my professor has yet to respond.


    Also, emacs doesn't work either. I can get emacs to work on X11 but I don't like emacs slash I can't figure out how to save on it.
  2. lee1210 macrumors 68040


    Jan 10, 2005
    Dallas, TX
    I assume you're using ssh to get to a remote unix or Linux machine. Just use Pico or nano or get a cheat sheet and learn vi (or emacs, I guess).

    What language are you using? You can probably do it all on your Mac, then copy the file over and test again there before turning it in.

  3. mfram macrumors 65816

    Jan 23, 2010
    San Diego, CA USA
    I assume you already have the X11 app running? From that app, open a Terminal (X11 -> Applications -> Terminal). From that prompt use ssh with the -X parameter. Try something simple like running xclock on the remote system. If that doesn't work, log out and try with the -Y parameter on the ssh command. Again, try xclock and see if it works. If so, you've got X connectivity and you can try other X apps.
  4. mobilehaathi macrumors G3


    Aug 19, 2008
    The Anthropocene
    Yep, as mentioned above you need X11 forwarding -X or -Y should hopefully work.

    Oh and saving on emacs is C-x C-s

Share This Page