I have vim-athena package (the same is observed for vim-gtk) in my Debian machine.
- Running
vimspawns Vim in the terminal. - Running
gvimspawns a new window with Vim in a Athena GUI.
But what is vim and gvim? Symlinks pointing to a same target.
$ readlink -e "$(type -p gvim)"
/usr/bin/vim.athena
$ readlink -e "$(type -p vim)"
/usr/bin/vim.athena
And that final target is a binary.
$ file --brief /usr/bin/vim.athena
ELF 64-bit LSB shared object, ...
How can it be that vim and gvim do different things if both resolve to the
same binary?
Background:
I was changing my default editor via update-alternatives --config editor. In
the list, there are vim.tiny and vim.athena, but even if I select the
latter, Vim always opens in the terminal, not in a separate GUI.
shinstead ofbash. – terdon Feb 12 '21 at 11:50sh/bashis a very well known example, it might be worth pointing out. – terdon Feb 12 '21 at 17:05