about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2002-03-04 15:51:58 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2002-03-04 15:51:58 +0000
commit15630b234ad7d2e91b165ba0bf584ee0e6e6efce (patch)
tree626ecff3182405134e27d0203ef2274601cf3f60 /Src
parentf56ba813bb92b1d61be91cb39df620b37a5a0588 (diff)
downloadzsh-15630b234ad7d2e91b165ba0bf584ee0e6e6efce.tar.gz
zsh-15630b234ad7d2e91b165ba0bf584ee0e6e6efce.tar.xz
zsh-15630b234ad7d2e91b165ba0bf584ee0e6e6efce.zip
16759: Src/builtin.c: from Eric Norum <eric.norum@usask.ca>:
cd prints output whenever the target directory is not obvious
to the user.  This confuses scripts, so restrict it to
interactive mode.
Diffstat (limited to 'Src')
-rw-r--r--Src/builtin.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index 564edfb46..b2815c155 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -1059,11 +1059,13 @@ cd_new_pwd(int func, LinkNode dir)
     pwd = new_pwd;
     set_pwd_env();
 
-    if (unset(PUSHDSILENT) && func != BIN_CD && isset(INTERACTIVE))
-	printdirstack();
-    else if (doprintdir) {
-	fprintdir(pwd, stdout);
-        putchar('\n');
+    if (isset(INTERACTIVE)) {
+	if (unset(PUSHDSILENT) && func != BIN_CD)
+	    printdirstack();
+	else if (doprintdir) {
+	    fprintdir(pwd, stdout);
+	    putchar('\n');
+	}
     }
 
     /* execute the chpwd function */