Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
21e2a913
Commit
21e2a913
authored
Apr 02, 2010
by
Matt Cable
Browse files
Escape &'s in path name. Need to find general function for escaping all
shell metacharacters.
parent
870551e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/dirspersist.zsh
View file @
21e2a913
...
...
@@ -5,7 +5,8 @@
# Run dirpersiststore in ~/.zlogout
dirpersiststore
()
{
dirs
-p
|
sed
's/ /\\ /g;s/^/pushd -q /;1!G;h;$!d;'
>
~/.zdirstore
# FIXME: need to escape all shell metacharacters, not just spaces!
dirs
-p
|
sed
's/ /\\ /g;s/&/\\&/;s/^/pushd -q /;1!G;h;$!d;'
>
~/.zdirstore
}
dirpersistrestore
()
{
...
...
@@ -19,4 +20,4 @@ setopt autopushd pushdminus pushdsilent pushdtohome pushdignoredups
dirpersistrestore
# Make popd changes permanent without having to wait for logout
alias popd
=
"popd;dirpersiststore"
\ No newline at end of file
alias popd
=
"popd;dirpersiststore"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment