mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-09-22 11:51:04 +02:00
44198: Add cd_silent option to suppress all cd output
This commit is contained in:
parent
5e11082349
commit
78fb8aaccf
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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');
|
||||
}
|
||||
|
@ -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},
|
||||
|
Loading…
Reference in New Issue
Block a user