Whenever I launch a GUI session as $ emacsclient -c all the emacsclient sessions I've created with $ emacsclient -nw -c lose several settings. The problem only occurs right after launching a GUI session, so everything is fine when working soley from the terminal or when avoiding the use of emacsclient.

Now, I've already found out that you can fix some of these issues by adding to the after-make-frame-functions hook. However, one issue persist because it seems to be out of emacs control. Namely, whenever a terminal frame is resized (this happens frequently due to me using a tiling wm) it's doesn't properly refresh it's contents. This can be partly fixed by adding a call to redraw-display (or possibly redraw-frame) to the after-make-frame-functions hook, as this will tell all the existing emacs frames to update whenever a new one is made.

There is a catch to this unfortunately: redraw-display obviously won't get called when opening up a new window that is not emacs, say a browser window. Therefore, all my emacs sessions will eventually become all garbled up until I refresh them all manually. Does anyone know how you can tell GUI sessions not to change any/my terminal sessions, or leave alone the frame refreshing? Or should I maybe change something else, like the way emacslient spawns instances? Can I seperate my GUI and terminal sessions completely maybe?

I'm running macOS 10.3.3 and emacsclient/emacs version 25.3.1. I manage my emacs daemon with brew services, if that is of relevance. My GUI emacs is plain Cocoa emacs installed from brew.

  • Can you reproduce this without your init file? If not, you need to post your init file, preferably shrunk to the smallest part that still has the problem. Mar 20, 2018 at 23:11
  • Unfortunately yes, if I launch the daemon like $ emacs --no-init-file --daemon=\0123,4\012 the resizing is just as bad as with my config file.
    – rien333
    Mar 21, 2018 at 13:38
  • Years later, I stumble upon my own thread with a similar problem on linux. Why does emacs suck so much at resizing whenever a tiling wm asks it to? Or rather, why does resizing work only 60% of the time?
    – rien333
    Oct 30, 2021 at 11:09


Your Answer

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