From 78fb8aaccf960c48a6b3b51794af6d28b87b9866 Mon Sep 17 00:00:00 2001 From: dana Date: Fri, 12 Apr 2019 14:00:19 -0500 Subject: 44198: Add cd_silent option to suppress all cd output --- Src/builtin.c | 4 ++-- Src/options.c | 1 + Src/zsh.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'Src') diff --git a/Src/builtin.c b/Src/builtin.c index 8dcdcc024..49f017046 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -720,7 +720,7 @@ bin_set(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) /**** directory-handling builtins ****/ /**/ -int doprintdir = 0; /* set in exec.c (for autocd) */ +int doprintdir = 0; /* set in exec.c (for autocd, cdpath, etc.) */ /* pwd: display the name of the current directory */ @@ -1251,7 +1251,7 @@ cd_new_pwd(int func, LinkNode dir, int quiet) if (func != BIN_CD && isset(INTERACTIVE)) { if (unset(PUSHDSILENT) && !quiet) printdirstack(); - } else if (doprintdir) { + } else if (unset(CDSILENT) && doprintdir) { fprintdir(pwd, stdout); putchar('\n'); } diff --git a/Src/options.c b/Src/options.c index 600b649e4..48c14c179 100644 --- a/Src/options.c +++ b/Src/options.c @@ -108,6 +108,7 @@ static struct optname optns[] = { {{NULL, "cbases", 0}, CBASES}, {{NULL, "cprecedences", OPT_EMULATE|OPT_NONZSH}, CPRECEDENCES}, {{NULL, "cdablevars", OPT_EMULATE}, CDABLEVARS}, +{{NULL, "cdsilent", 0}, CDSILENT}, {{NULL, "chasedots", OPT_EMULATE}, CHASEDOTS}, {{NULL, "chaselinks", OPT_EMULATE}, CHASELINKS}, {{NULL, "checkjobs", OPT_EMULATE|OPT_ZSH}, CHECKJOBS}, diff --git a/Src/zsh.h b/Src/zsh.h index 10897372b..fc3ed2127 100644 --- a/Src/zsh.h +++ b/Src/zsh.h @@ -2348,6 +2348,7 @@ enum { CASEMATCH, CBASES, CDABLEVARS, + CDSILENT, CHASEDOTS, CHASELINKS, CHECKJOBS, -- cgit 1.4.1