diff options
author | hut <hut@lavabit.com> | 2012-01-15 03:34:31 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2012-01-15 03:34:56 +0100 |
commit | 1cc4c0e4c2a022d64dac2d380729ffacb2cfa31c (patch) | |
tree | 9bfe68718b280420b3689daaf03f8670bbffdf2e /ranger | |
parent | a110af2a538104dd909e4766dd1c0044b804dbdc (diff) | |
download | ranger-1cc4c0e4c2a022d64dac2d380729ffacb2cfa31c.tar.gz |
gui.ui: Fix title drawing. Since when is this broken anyway?!
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/gui/ui.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py index 064d4a16..5599190d 100644 --- a/ranger/gui/ui.py +++ b/ranger/gui/ui.py @@ -21,7 +21,6 @@ import _curses from .displayable import DisplayableContainer from .mouse_event import MouseEvent from ranger.ext.keybinding_parser import ALT_KEY -from ranger.fsobject.fsobject import safe_path TERMINALS_WITH_TITLE = ("xterm", "xterm-256color", "rxvt", "rxvt-256color", "rxvt-unicode", "aterm", "Eterm", @@ -294,7 +293,10 @@ class UI(DisplayableContainer): split = cwd.rsplit(os.sep, self.settings.shorten_title) if os.sep in split[0]: cwd = os.sep.join(split[1:]) - sys.stdout.write("\033]2;ranger:" + safe_path(cwd) + "\007") + fixed_cwd = cwd.encode('utf-8', 'surrogateescape'). \ + decode('utf-8', 'replace') + sys.stdout.write("\033]2;ranger:" + fixed_cwd + "\007") + sys.stdout.flush() self.win.refresh() def finalize(self): |