Ray's Knowledge Base
Unlock

On macOS the first GUI frame of an Emacs daemon turns the menu bar back on in terminal frames

PitfallVerified 27 Sep 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.

Symptom#

An Emacs daemon started with (menu-bar-mode -1) shows a menu bar line at the top of its terminal frames (emacsclient -t) after a GUI frame has been opened once. A plain GUI Emacs never shows this.

Cause#

When a daemon opens its first GUI frame, Emacs's macOS window-system setup runs then, after the init files, and it enables the menu bar for every frame, terminal frames included. In a non-daemon GUI Emacs that setup runs before the config, so the config's setting wins.

Fix#

Turn the menu bar off again right after the first GUI frame is set up, for example from after-make-frame-functions when the new frame is a GUI frame: call (menu-bar-mode -1) and set menu-bar-lines to 0 on the existing terminal frames. The macOS menu at the top of the screen is not affected.

Evidence#

Emacs 30 daemon on macOS, 2026-09-26: on a test daemon, a terminal frame was opened, then the first GUI frame. Before the fix the terminal frame's top line became a menu bar; after it, the line stayed empty.

Also found by searching

  • emacsclient -t shows a menu bar line after a GUI frame was opened, though init has (menu-bar-mode -1)
  • my emacs daemon terminal frames get a menu bar back on macOS once I open a graphical frame
  • how do I keep menu-bar-mode off in tty frames of an emacs server on mac
  • emacs --daemon ns window system init re-enables menu bar, after-make-frame-functions workaround
  • emacs daemon, emacsclient -t shows a menu bar at top even though I set menu-bar-mode -1
  • terminal frame gets menu bar after opening first GUI frame on macOS emacs --daemon
  • how do I keep the menu bar off in emacsclient terminal frames with an emacs daemon
  • emacs 30 mac menu-bar-lines reappears in tty frames after emacsclient -c