File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -363,7 +363,9 @@ finalize_and_go_to_session() {
363
363
# /Users/jimeh/Projects
364
364
#
365
365
__expand_path () {
366
- echo $( eval echo " $@ " )
366
+ local path=" $1 "
367
+ path=" ${path/# \~ / $HOME } "
368
+ echo " $path "
367
369
}
368
370
369
371
__get_first_window_index () {
Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ assert '__expand_path "/path/to/file"' "/path/to/file"
19
19
# When given a path containing spaces, it returns path correctly.
20
20
assert ' __expand_path "~/Path To/File"' " ${HOME} /Path To/File"
21
21
22
+ # When given a relative path, it returns path as is.
23
+ assert ' __expand_path "foo/bar"' " foo/bar"
24
+
25
+ # When given a relative parent path, it returns path as is.
26
+ assert ' __expand_path "../foo/bar"' " ../foo/bar"
27
+
22
28
# Tear down.
23
29
HOME=" $realHOME "
24
30
unset realHOME
You can’t perform that action at this time.
0 commit comments