44198: Add cd_silent option to suppress all cd output

This commit is contained in:
dana 2019-04-12 14:00:19 -05:00
parent 5e11082349
commit 78fb8aaccf
5 changed files with 24 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2019-04-12 dana <dana@dana.is>
* 44198: Doc/Zsh/options.yo, Src/builtin.c, Src/options.c,
Src/zsh.h: Add cd_silent option to suppress all cd output
2019-04-10 Peter Stephenson <p.stephenson@samsung.com>
* Eric Freese: 44214: Src/exec.c: <(...) substitutions shouldn't

View File

@ -88,6 +88,21 @@ tt(AUTO_CD) option set) is not a directory, and does not begin with a
slash, try to expand the expression as if it were preceded by a `tt(~)' (see
noderef(Filename Expansion)).
)
pindex(CD_SILENT)
pindex(NO_CD_SILENT)
pindex(CDSILENT)
pindex(NOCDSILENT)
cindex(cd, silencing)
cindex(autocd, silencing)
item(tt(CD_SILENT))(
Never print the working directory after a tt(cd) (whether explicit or
implied with the tt(AUTO_CD) option set). tt(cd) normally prints the
working directory when the argument given to it was tt(-), a stack entry, or
the name of a directory found under tt(CDPATH). Note that this is distinct
from tt(pushd)'s stack-printing behaviour, which is controlled by
tt(PUSHD_SILENT). This option overrides the printing-related effects of
tt(POSIX_CD).
)
pindex(CHASE_DOTS)
pindex(NO_CHASE_DOTS)
pindex(CHASEDOTS)

View File

@ -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');
}

View File

@ -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},

View File

@ -2348,6 +2348,7 @@ enum {
CASEMATCH,
CBASES,
CDABLEVARS,
CDSILENT,
CHASEDOTS,
CHASELINKS,
CHECKJOBS,