From 05e7e2c502a07d9b38ca0c8f055445c38b10d049 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Tue, 30 Jul 2019 21:08:39 +0300 Subject: store escape sequence in a constant for clarity Escape character is also represented with octal notation to be consistent with prior usage --- ranger/gui/ui.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py index 207061ce..38065182 100644 --- a/ranger/gui/ui.py +++ b/ranger/gui/ui.py @@ -20,6 +20,11 @@ from .mouse_event import MouseEvent MOUSEMASK = curses.ALL_MOUSE_EVENTS | curses.REPORT_MOUSE_POSITION +# This escape is not available with a capname from terminfo unlike +# tsl (to_status_line), so it's hardcoded here. It's used just like tsl, +# but it sets the icon title instead of the window title. +ESCAPE_ICON_TITLE = '\033]1;' + _ASCII = ''.join(chr(c) for c in range(32, 127)) @@ -389,7 +394,7 @@ class UI( # pylint: disable=too-many-instance-attributes,too-many-public-method self.settings.update_title, ), ( - '\x1b]1;', + ESCAPE_ICON_TITLE, self.settings.update_icon_title, ), ] -- cgit 1.4.1-2-gfad0