neovim / neovim

Vim-fork focused on extensibility and usability
https://neovim.io
Other
82.97k stars 5.69k forks source link

foreground() function definition is empty #2681

Open jalvesaq opened 9 years ago

jalvesaq commented 9 years ago

The definition of the foreground() function is empty (eval.c):

static void f_foreground(typval_T *argvars, typval_T *rettv)
{
}

Although the function is not useful for the default UI on Unix because it is not linked to X11 libraries and, thus, cannot raise the terminal window, it is useful for graphical user interfaces, like neovim-qt. Perhaps, the function should send a message to the UI which then would decide what to do.

I think that the default UI on Unix should do nothing. Another option is to work with a provider, like it is done with the clipboard. For example, wmctrl could be the provider for foreground() because on Linux we can raise a terminal emulator window with the command:

wmctrl -ia $WINDOWID
justinmk commented 9 years ago

All good ideas.