diff options
author | dana <dana@dana.is> | 2019-04-12 14:00:19 -0500 |
---|---|---|
committer | dana <dana@dana.is> | 2019-04-12 14:00:19 -0500 |
commit | 78fb8aaccf960c48a6b3b51794af6d28b87b9866 (patch) | |
tree | 94dcf82755b891c6ef51ba420f07b051bee8645f /Src | |
parent | 5e11082349bf72897f93f3a4493a97a2caf15984 (diff) | |
download | zsh-78fb8aaccf960c48a6b3b51794af6d28b87b9866.tar.gz zsh-78fb8aaccf960c48a6b3b51794af6d28b87b9866.tar.xz zsh-78fb8aaccf960c48a6b3b51794af6d28b87b9866.zip |
44198: Add cd_silent option to suppress all cd output
Diffstat (limited to 'Src')
-rw-r--r-- | Src/builtin.c | 4 | ||||
-rw-r--r-- | Src/options.c | 1 | ||||
-rw-r--r-- | Src/zsh.h | 1 |
3 files changed, 4 insertions, 2 deletions
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, |