PDA

View Full Version : HELP! Terminal gedit error




trojanlax04
Jan 31, 2012, 11:08 PM
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.

Thanks.

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.



lee1210
Jan 31, 2012, 11:45 PM
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.

-Lee

mfram
Feb 1, 2012, 12:00 AM
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.

mobilehaathi
Feb 1, 2012, 08:01 AM
Yep, as mentioned above you need X11 forwarding -X or -Y should hopefully work.

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