Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to restart the WindowServer (OS X's GUI); I know this can be achieved using the command sudo killall -HUP WindowServer but this closes all your open applications. Is there a way to restart the WindowsServer without it quitting all your open applications?

share|improve this question
What OS version are you running? – Daniel Sep 12 '11 at 12:30
I need it to work on 10.5, 10.6 & 10.7 – Samantha Catania Sep 12 '11 at 12:40
Why do you want to kill the Window Server that couldn't be sufficed with a logout/login (or for that matter restart)? – Jason Salaz Sep 12 '11 at 17:07
I'm writing a program and you can't rely on the user to logout/in – Samantha Catania Sep 12 '11 at 18:05
Then force the logout - that you can do - or look at kiosk mode – Mark Sep 12 '11 at 22:46
up vote 5 down vote accepted

There is no way to restart window server without closing all apps; logging out & then back in is the best option

share|improve this answer

The WindowServer is responsible for drawing all Windows and Windows Content for all Programs (incl. Finder), so it would not be possible to kill the Process without killing all Applications.

You can read about the Window Server in the Apple Technical Note TN2083 for OSX 10.5.

Even though it is announced in that Document that Apple plans to change the Behaviour in future Systemversions, it's in your list of required OS's.

share|improve this answer
I think the note about removing it is referring to the fact that the window server is available from the global bootstrap namespace, not removing the entire window server. – ughoavgfhw Sep 12 '11 at 22:34

You can also try:

killall -KILL Dock
share|improve this answer
Does killing the Dock restart the WindowServer? – patrix Sep 30 '15 at 8:35
@patrix It restarts some parts of the UI interface (not sure which). In my case, the top bar was not displaying (time, clock, sound and wifi were invisible...). Restarting the dock fixed the problem. – pinouchon Sep 30 '15 at 8:37
Fair point, but how does this relate to the problem described in the question? – patrix Sep 30 '15 at 8:38
@patrix It's a way to restart parts of the UI without quitting all your open applications. That might help the OP. – pinouchon Sep 30 '15 at 8:39
killall Finder         # what should work
killall SystemUIServer # what to run in addition if it does not

If any of the three do not restart (finder sometimes does not automatically reboot in my experience), then run these commands after the initial set:

open -a Finder
open -a SystemUIServer

This set of commands (specifically killall Finder) is almost exactly like taskkill /IM explorer.exe within the MS-DOS command line.

share|improve this answer
Do applications remain open if one does this? – patrix May 1 at 7:55
Yes, they absolutely do. – Lithtex Printing Solutions May 1 at 8:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.