Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 568556 Details for
Bug 680022
[PATCH] sys-apps/portage: correct terminal window title escape codes for screen or tmux
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
correct escaped codes to change window title in screen/tmux
screen-tmux-title.patch (text/plain), 1.38 KB, created by
Heui-mun Park
on 2019-03-11 09:59:17 UTC
(
hide
)
Description:
correct escaped codes to change window title in screen/tmux
Filename:
MIME Type:
Creator:
Heui-mun Park
Created:
2019-03-11 09:59:17 UTC
Size:
1.38 KB
patch
obsolete
>diff -urN a/lib/portage/output.py b/lib/portage/output.py >--- a/lib/portage/output.py 2019-02-20 09:44:36.000000000 +0900 >+++ b/lib/portage/output.py 2019-03-11 12:13:16.957281932 +0900 >@@ -235,6 +235,7 @@ > return len(tmp) > > _legal_terms_re = re.compile(r'^(xterm|xterm-color|Eterm|aterm|rxvt|screen|kterm|rxvt-unicode|gnome|interix|tmux|st-256color)') >+_screen_tmux_re = re.compile(r'^(screen|tmux)') > _disable_xtermTitle = None > _max_xtermTitle_len = 253 > >@@ -251,7 +252,10 @@ > if len(mystr) > _max_xtermTitle_len: > mystr = mystr[:_max_xtermTitle_len] > if not raw: >- mystr = '\x1b]0;%s\x07' % mystr >+ if _screen_tmux_re.match(os.environ['TERM']) is None: >+ mystr = '\x1b]0;%s\x07' % mystr >+ else: >+ mystr = '\x1bk%s\x1b\\' % mystr > > # avoid potential UnicodeEncodeError > mystr = _unicode_encode(mystr, >@@ -294,9 +298,13 @@ > home = os.environ.get('HOME', '') > if home != '' and pwd.startswith(home): > pwd = '~' + pwd[len(home):] >- default_xterm_title = '\x1b]0;%s@%s:%s\x07' % ( >+ default_xterm_title = '%s@%s:%s' % ( > os.environ.get('LOGNAME', ''), > os.environ.get('HOSTNAME', '').split('.', 1)[0], pwd) >+ if _screen_tmux_re.match(os.environ['TERM']) is None: >+ default_xterm_title = '\x1b]0;%s\x07' % default_xterm_title >+ else: >+ default_xterm_title = '\x1bk%s\x1b\\' % default_xterm_title > xtermTitle(default_xterm_title, raw=True) > > def notitles():
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 680022
: 568556