34

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?

Jorge Castro
  • 71,754

5 Answers5

35

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'

References

  • why the quotes around the 'all arguments'? – xtofl Dec 07 '12 at 19:42
  • sorry. I wondered why there are quotes around "$@" in the .bashrc function. – xtofl Dec 07 '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 08 '12 at 00:25
  • Out of interest, could you explain how and why the first solution works? – ecatmur Dec 17 '13 at 11:13
  • 1
    @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
5

There is a workaround here: https://bugs.launchpad.net/ubuntu/+source/vim/+bug/776499

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

alias gvim="UBUNTU_MENUPROXY=0 gvim"
3

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
Chu-Siang Lai
  • 489
  • 4
  • 10
2

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.

kev
  • 843
0

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.

Umang
  • 6,473