From 3c1ed3b4901631f213fd65fb40df9ebaaa29bfa0 Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Thu, 3 Aug 2017 13:49:14 +0200
Subject: [PATCH] CONFIG: unset tcsh completions when cleaninp up (issue #551)

---
 etc/config.csh/unset | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/etc/config.csh/unset b/etc/config.csh/unset
index 6f52ec8c42..d9cb0ff21b 100644
--- a/etc/config.csh/unset
+++ b/etc/config.csh/unset
@@ -196,6 +196,15 @@ unalias wmRefresh
 unalias foamVersion
 unalias foamPV
 
+# Cleanup completions, which look like this:
+#   complete blockMesh 'p,*,`bash $WM_PROJECT_DIR/etc/ ...
+
+if ($?prompt && $?tcsh) then  # Interactive tcsh only
+    foreach cleaned (`complete | sed -n -e '/WM_PROJECT/s/\t.*$//p'`)
+        uncomplete $cleaned
+    end
+endif
+
 #------------------------------------------------------------------------------
 # Intermediate variables (do as last for a clean exit code)
 
-- 
GitLab