36

I'm using Emacs GUI in Gnome. After pressing Ctrl+z, the Emacs window is minimized. However, if I bring the window to the front, it doesn't respond to any key press or mouse event. I searched the web and only found how to bring it back from the command line.

How do I reactivate Emacs when using it in GUI mode?

zx485
  • 2,170
  • 11
  • 17
  • 24
Ning Sun
  • 627
  • 1
  • 6
  • 11

6 Answers6

31

If you press C-z by mistake then you can add this to your .emacs to make C-z do nothing:

(global-unset-key (kbd "C-z"))

I did that after pressing C-z many times by accident.

Tom
  • 2,057
  • 8
  • 26
  • 33
  • resize the window (as posted below) to fix now! And then do this to make it permanent. Thanks from someone who has to constantly switch German and US keyboard layout. – david Mar 31 '17 at 09:44
  • 2
    Both C-z and C-x C-z are typically bound to `(suspend-frame)`. If you unset C-z, you can still suspend with a C-x before C-z. (I consider this to be a feature but some may take that as inspiration to `(global-unset-key (kbd "C-x C-z"))`.) – ericP Jul 10 '19 at 13:51
20

Type

fg 

or

fg %emacs

to get Emacs back.

slhck
  • 223,558
  • 70
  • 607
  • 592
sRack
  • 309
  • 2
  • 3
8

You may have to send the process a SIGCONT signal. You normally do this in the console by running kill -CONT $emacs_pid or killall -CONT emacs. If you insist on a GUI solution, you can try the task manager shipped with your distro.

billc.cn
  • 7,099
  • 20
  • 36
6

Send it a CONT signal:

killall -CONT emacs

A WINCH signal also seems to work, so you can just resize the Emacs window.

Clicking on any menu items seems to work as well.

If you were running Emacs from a terminal, fg ("foreground") or %emacs would work.

Zaz
  • 2,405
  • 2
  • 26
  • 38
1

C-s resumes a GUI Emacs after C-z

imix
  • 131
  • 3
0

Try using a window resize command. I was using X11 forwarding to forward the Emacs GUI from a Linux server to my computer (Windows). Hitting C-z minimized the window, and when I brought it back up Emacs had frozen, but resizing it using the Windows key (e.g., Win + Left arrow) unfroze it and it started responding again.