From dfca6b0bed0ca674a38d14248e94ae727e522959 Mon Sep 17 00:00:00 2001
From: David Allsopp <david.allsopp@metastack.com>
Date: Wed, 4 Sep 2024 11:52:38 +0100
Subject: [PATCH] Env: Add install.exe to the shadow program list

install.exe is installed by Vim for Windows, which can result in the
install command being shadowed, e.g. for ocamlfind.
---
 master_changes.md    | 1 +
 src/state/opamEnv.ml | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/master_changes.md b/master_changes.md
index 67e22214752..0e86f2274c7 100644
--- a/master_changes.md
+++ b/master_changes.md
@@ -88,6 +88,7 @@ users)
 
 ## Env
   * Make the shell environment update hint easier to copy/paste [#6159 @kit-ty-kate - fix #6158]
+  * Add install.exe to the list of non-shadowed programs when adding Cygwin's bin directory to PATH (ocamlfind et al can be affected by Vim for Windows) [#6190 @dra27]
 
 ## Opamfile
   * Make all writes atomic [#5489 @kit-ty-kate]
diff --git a/src/state/opamEnv.ml b/src/state/opamEnv.ml
index d3e76b6a225..d47b7ce9ec0 100644
--- a/src/state/opamEnv.ml
+++ b/src/state/opamEnv.ml
@@ -307,7 +307,9 @@ let rezip_to_string ?insert z =
   join_var (rezip ?insert z)
 
 let cygwin_non_shadowed_programs =
-  ["bash.exe"; "make.exe"; "sort.exe"; "tar.exe"]
+  [ "bash.exe"; "make.exe"; "sort.exe"; "tar.exe";
+    "install.exe"; (* from Vim for Windows *)
+  ]
 
 let apply_op_zip ~sepfmt var op arg (rl1,l2 as zip) =
   let arg = transform_format ~sepfmt var arg in