macvim-dev / macvim-dev/macvim

Bad interaction between guioptions=! and TerminalOpen

Open
#896 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vim Script
Stars
7.9k
Forks
691
PR merge metrics
No merged PRs in 30d

Description

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.

  • Vim 8.1.950
  • OS: macOS 10.14
  • Terminal: GUI

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the provided vimrc and :!ls, then trace how guioptions=! creates or uses the terminal window and how the TerminalOpen autocommand is applied. Done means the autocommand changes only the terminal window, leaving the current window's line numbers enabled; verify both guioptions=! and the control case without !.

Written by the indexing model from the issue text.

Assessment

Tech stack
vim
Domain
desktop-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.