Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #2873 WM_NAME now shows "not accessible" in non-existent directories #2896

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 12 additions & 9 deletions ranger/gui/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,18 @@ def draw(self):
self.win.touchwin()
DisplayableContainer.draw(self)
if self._draw_title and self.settings.update_title:
cwd = self.fm.thisdir.path
if self.settings.tilde_in_titlebar \
and (cwd == self.fm.home_path
or cwd.startswith(self.fm.home_path + "/")):
cwd = '~' + cwd[len(self.fm.home_path):]
if self.settings.shorten_title:
split = cwd.rsplit(os.sep, self.settings.shorten_title)
if os.sep in split[0]:
cwd = os.sep.join(split[1:])
if self.fm.thisdir:
cwd = self.fm.thisdir.path
if self.settings.tilde_in_titlebar \
and (cwd == self.fm.home_path
or cwd.startswith(self.fm.home_path + "/")):
cwd = '~' + cwd[len(self.fm.home_path):]
if self.settings.shorten_title:
split = cwd.rsplit(os.sep, self.settings.shorten_title)
if os.sep in split[0]:
cwd = os.sep.join(split[1:])
else:
cwd = "not accessible"
try:
fixed_cwd = cwd.encode('utf-8', 'surrogateescape'). \
decode('utf-8', 'replace')
Expand Down