I found when I want to change input method, I should restart X. But I don't want to close all applications. How to do that?

2 Answers 2


You can't.

What you can do is start a new X-session on a different tty (screen) which should leave the apps running in the first session untouched. (This is how some display managers [e.g., KDM] allow multiple log-ins of different users using the the same physical display/keyboard.)

Source: http://www.linuxquestions.org/questions/linux-desktop-74/how-to-restart-x-without-having-to-close-connected-applications-689430/

  • 1
    Could you give the command to do that in this answer? Would be nice not to have to google :)
    – Aditya M P
    Oct 4, 2014 at 3:16

The apps started over X will be killed if you restart X. You cannot avoid that.

  • Does anyone know what signal these apps receive when X is terminated? And does it depend on what signal terminates X? I can imagine reasons for the system to be designed so they receive SIGHUP, SIGINT, SIGTERM, or SIGKILL (or some combination of these, separated by a time interval during which the app can do its own cleanup). Jun 15, 2012 at 2:39
  • Eliah: it's not a really a signal: the socket that the X clients (your apps) are communicating with Xorg over is closed. This may cause the client to receive a SIGPIPE on the next write to the socket, or that the write fails. It's certainly possible that applications can perform cleanup here. Jun 15, 2012 at 8:51
  • Would it be possible to run some kind of proxy in front of Xorg socket to allow redirecting socket traffic to newly restarted X? Mar 6, 2017 at 17:32
  • 3
    @MikkoRantalainen if you manage to get it to work, xmove does exactly this. The problem is, it hasn't been maintained for 14 years. This could probably also be done with Xpra, which is still maintained, but its main purpose is quite different, so it would require fiddling.
    – franga2000
    Aug 29, 2018 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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