Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

Gvim does not have a global menu (appmenu / application menu) in 12.04, and when starting gvim from a terminal, the following warning appears in the terminal after 25 seconds:

** (gvim:20320): WARNING **: Unable to create Ubuntu Menu Proxy: Timeout was reached

How to fix this?

share|improve this question
up vote 35 down vote accepted

Solution 1: Make the global menu for gvim work

To get global menu for gvim and to get rid of the warning message, add this to ~/.bashrc and restart the terminal:

function gvim () { (/usr/bin/gvim -f "$@" &) }

Solution 2: Disable global menu for gvim

To just get rid of the warning message, you can disable the global menu, at least for gvim:

For example, add this to ~/.bashrc and restart the terminal:

alias gvim='UBUNTU_MENUPROXY= gvim'


share|improve this answer
why the quotes around the 'all arguments'? – xtofl Dec 7 '12 at 19:42
sorry. I wondered why there are quotes around "$@" in the .bashrc function. – xtofl Dec 7 '12 at 20:49
@xtofl: Without the quotes around "$@" you get trouble with e.g. space and literal '*' in arguments. – Håkon A. Hjortland Dec 8 '12 at 0:25
Out of interest, could you explain how and why the first solution works? – ecatmur Dec 17 '13 at 11:13
@ecatmur: This is how solution 1 works: The bug is related to gvim's way of going into background mode. gvim -f keeps gvim in the foreground. To make the shell run gvim in the background we add an &. The parenthesis in (foo &) runs the command in a subshell, so that gvim does not become a background process of the current shell. Without parenthesis, closing the terminal by clicking the X would also kill gvim. function foo () { ... } creates a shell function. We must add /usr/bin/ to gvim, otherwise we will get an infinitely recursive function. "$@" passes all arguments. – Håkon A. Hjortland Dec 19 '13 at 10:20

There is a workaround here:

Create an alias at the top of your shell init file (e.g. ~/.bashrc):

alias gvim="UBUNTU_MENUPROXY=0 gvim"
share|improve this answer

My Ubuntu 12.04 amd64 can work with gvim -f.

  • vim-gnome: 2:7.3.429-2ubuntu2.1+aptbuild1
  • terminator: 0.96-0ubuntu1+aptbuild1
  • guake: 0.4.2-7+aptbuild1
share|improve this answer

I can add the -f(--nofork) option when start gvim:

alias gvim="gvim -f"

This only works for gvim.
firefox and others don't have this -f option.

share|improve this answer

Another potential cause might be the ~/.gnome2/Vim file. This solution (which suggests that you delete ~/.gnome2/Vim) for the issue in Hardy Heron (before Unity) fixed the issue for me on Ubuntu 13.10.

For whatever reason, gvim -f didn't work for me.

share|improve this answer

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.