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:
The definition of the
foreground()
function is empty (eval.c):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 forforeground()
because on Linux we can raise a terminal emulator window with the command: