mirror of
https://github.com/b-ryan/powerline-shell.git
synced 2026-09-10 07:26:28 -04:00
Merge e805d34b4d into 4b19aa47f1
This commit is contained in:
commit
f15d64489a
|
|
@ -6,9 +6,10 @@ ELLIPSIS = u'\u2026'
|
|||
|
||||
|
||||
def replace_home_dir(cwd):
|
||||
realcwd = os.path.realpath(cwd)
|
||||
home = os.path.realpath(os.getenv('HOME'))
|
||||
if cwd.startswith(home):
|
||||
return '~' + cwd[len(home):]
|
||||
if realcwd.startswith(home):
|
||||
return '~' + realcwd[len(home):]
|
||||
return cwd
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue