diff options
author | hut <hut@lavabit.com> | 2010-02-13 00:54:27 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-02-13 00:54:32 +0100 |
commit | 87db0130f83b071845258a073c62460ccdf6efe5 (patch) | |
tree | 7a28bc06041b84ae09516e456c37ed6d21ebaff6 /ranger | |
parent | 336cc468e37cb41ce9c1838c7d93138cf48e0916 (diff) | |
download | ranger-87db0130f83b071845258a073c62460ccdf6efe5.tar.gz |
fixed #46: wrong username displayed when using su
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/gui/widgets/titlebar.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ranger/gui/widgets/titlebar.py b/ranger/gui/widgets/titlebar.py index 43729947..7c164ae9 100644 --- a/ranger/gui/widgets/titlebar.py +++ b/ranger/gui/widgets/titlebar.py @@ -53,9 +53,12 @@ class TitleBar(Widget): self.result = bar.combine() def _get_left_part(self, bar): - import socket, os + import socket, os, pwd - username = os.getenv('USER') + try: + username = pwd.getpwuid(os.geteuid()).pw_name + except: + username = "???" if username == 'root': clr = 'bad' else: |