Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How to get rid of Emacs's menu bar in terminal windows?

The standard answer is to put

(when (not (display-graphic-p))
  (menu-bar-mode -1))

in init.el. However, this solution is not good, because all it does is remove the menu bar after the fact. You can still see it for a split second. It's very annoying.

Looking at the source code in startup.el I don't see an obvious solution to this problem. I think the only way is to use before-init-hook. Maybe this could do the trick?

(add-hook 'before-init-hook
          (lambda ()
            (setq emacs-basic-display t)))

But this hook is run before init.el and other init files are evaluated, so how is one supposed to use it?

share|improve this question
    
Welcome to Super User. Please always include your OS. Solutions very often depend on the Operating System being used. Are you using Windows, Linux, Unix, OSX, BSD? Which version? –  terdon Oct 23 '13 at 22:54
    
Thanks, I'm using Debian GNU/Linux, the "testing" version. –  Ernest A Oct 23 '13 at 23:50
add comment

2 Answers

up vote 3 down vote accepted

I found that this seems to depend on the size of the terminal window of all things. I tested on terminator and xterm and in both cases, increasing the size of the window stopped the menu bar from appearing while emacs was loading. Go figure. Specifically, a terminal width of >=88 seems to stop the menu buffer from appearing. Height appears to be irrelevant. You could, therefore, change the default size of your terminal window and that might solve your issue.

This is not an ideal solution, obviously, and does not help if you are running from a tty not a terminal emulator but it may be the best you'll get without delving deep into the emacs source code which I imagine you won't find worth the effort to get rid of such a minor annoyance.

share|improve this answer
add comment

I doubt that there is a way to suppress it initially, at least the momentary appearance you mention. You might try customizing initial-frame-alist, but I have a doubt about that having any effect here. I tried emacs -nw -f menu-bar-mode, and that turns off the menu-bar, but again, it first appears momentarily.

share|improve this answer
add comment

Your Answer

 
discard

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.