diff --git a/powerline_shell/segments/cwd.py b/powerline_shell/segments/cwd.py index a7023178..7a233590 100644 --- a/powerline_shell/segments/cwd.py +++ b/powerline_shell/segments/cwd.py @@ -6,9 +6,10 @@ 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