mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
Change all pwd calls for $PWD variable
This avoids spawning additional processes as $PWD **always** contains the current working directory.
This commit is contained in:
parent
74177c5320
commit
4310a15de5
6 changed files with 13 additions and 13 deletions
|
|
@ -3,7 +3,7 @@
|
|||
# that the user has changed to in the past, and ALT-RIGHT undoes ALT-LEFT.
|
||||
#
|
||||
|
||||
dirhistory_past=(`pwd`)
|
||||
dirhistory_past=($PWD)
|
||||
dirhistory_future=()
|
||||
export dirhistory_past
|
||||
export dirhistory_future
|
||||
|
|
@ -50,7 +50,7 @@ function push_future() {
|
|||
|
||||
# Called by zsh when directory changes
|
||||
function chpwd() {
|
||||
push_past `pwd`
|
||||
push_past $PWD
|
||||
# If DIRHISTORY_CD is not set...
|
||||
if [[ -z "${DIRHISTORY_CD+x}" ]]; then
|
||||
# ... clear future.
|
||||
|
|
@ -73,7 +73,7 @@ function dirhistory_back() {
|
|||
pop_past cw
|
||||
if [[ "" == "$cw" ]]; then
|
||||
# Someone overwrote our variable. Recover it.
|
||||
dirhistory_past=(`pwd`)
|
||||
dirhistory_past=($PWD)
|
||||
return
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue