macvim-dev / macvim

Vim - the text editor - for macOS
https://macvim.org
Vim License
7.55k stars 683 forks source link

Bad interaction between guioptions=! and TerminalOpen #896

Open lifepillar opened 5 years ago

lifepillar commented 5 years ago

When external commands are executed in a terminal window and a TerminalOpen autocommand is defined, the command may affect the current window.

To Reproduce

  1. Run mvim -N -i NONE -u vimrc where vimrc has the following content:
  set number
  autocmd TerminalOpen * set nonumber
  set guioptions=!
  1. Type :!ls (or any other :! command)
  2. You should see the line numbers have disappeared from the current window.

I am expecting that the external command is executed in a different window, hence options set in the terminal window shouldn't affect the current window, as is the case if you remove ! from guioptions.

eirnym commented 5 years ago

vim core runs command in a terminal with this GUI option set, and there's no difference between ViM and MacVim in that part.

I don't know if vim always requests a buffer for it, though

I suggest to test with GVim if you're able to, and/or file a ticket there first.