about summary refs log tree commit diff
path: root/Src/builtin.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/builtin.c')
-rw-r--r--Src/builtin.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index ce4d2a46e..cbc69b599 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -1042,11 +1042,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 */