From 94c5643b06d7bce785e15ab3c95537bd5915fa24 Mon Sep 17 00:00:00 2001 From: dbsr Date: Sun, 3 Mar 2013 18:04:48 +0100 Subject: [PATCH] added option to not follow symlinks when resolving cwd --- powerline-shell.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/powerline-shell.py b/powerline-shell.py index 9aad34c6..b2ad3293 100755 --- a/powerline-shell.py +++ b/powerline-shell.py @@ -327,11 +327,14 @@ def get_valid_cwd(): arg_parser.add_argument('--cwd-only', action='store_true') arg_parser.add_argument('--mode', action='store', default='patched') arg_parser.add_argument('--shell', action='store', default='bash') + arg_parser.add_argument('--no-follow', action='store_true') arg_parser.add_argument('prev_error', nargs='?', default=0) args = arg_parser.parse_args() p = Powerline(mode=args.mode, shell=args.shell) cwd = get_valid_cwd() + if args.no_follow: + cwd = os.getenv('PWD') add_virtual_env_segment(p, cwd) #p.append(Segment(p, ' \\u ', 250, 240)) #p.append(Segment(p, ' \\h ', 250, 238))