From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] make OLDPWD influence 'cd -'
Date: Thu, 02 Jun 2011 23:59:36 -0700 [thread overview]
Message-ID: <110602235938.ZM16470@torch.brasslantern.com> (raw)
In-Reply-To: <225f0be.6cc0.13053a1119b.Coremail.hanpingtian@163.com>
On Jun 3, 11:52am, hanpingtian wrote:
} Subject: [PATCH] make OLDPWD influence 'cd -'
}
} This patch will let zsh check OLDPWD before run 'cd -', so let OLDPWD
} influence it:
} [hpt@hpt]~% echo $OLDPWD
} /home/hpt
} [hpt@hpt]~% vared OLDPWD
} /tmp
} [hpt@hpt]~% cd -
} /tmp
} [hpt@hpt]/tmp% pwd
} /tmp
Hmm. Aside from the fact that this makes OLDPWD sort of half a special
variable -- it at least moves it from the "set by the shell" category
into "used by the shell" -- I think putting this behavior into the "cd"
command may not be the best place for it.
In particular, it means that "cd -" and "cd ~-" become different things,
where currently they're all equivalent. Further, it affects "pushd -"
so that it no longer refers to the top of the directory stack.
--
next prev parent reply other threads:[~2011-06-03 6:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-03 3:52 hanpingtian
2011-06-03 6:59 ` Bart Schaefer [this message]
2011-06-03 10:35 ` hanpingtian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=110602235938.ZM16470@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).