Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 729852 - sys-apps/portage-2.3.103 fails to properly set XTerm titles for konsole
Summary: sys-apps/portage-2.3.103 fails to properly set XTerm titles for konsole
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 733180
  Show dependency tree
 
Reported: 2020-06-27 13:31 UTC by rnddim
Modified: 2020-09-18 18:44 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rnddim 2020-06-27 13:31:05 UTC
I noticed after upgrading portage that the titles that emerge always sets in my Konsole tab weren't showing up, making it look as if I wasn't running emerge at all. As you'll see in my emerge --info, I do not have the "notitles" FEATURE enabled.

emerge --info :
Portage 2.3.103 (python 3.7.7-final-0, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-10.1.0, glibc-2.31-r5, 5.7.0-gentoo x86_64)
=================================================================
System uname: Linux-5.7.0-gentoo-x86_64-AMD_Athlon-tm-_Dual_Core_Processor_4450B-with-gentoo-2.7
KiB Mem:     3755400 total,    179952 free
KiB Swap:    8388604 total,   7694832 free
Timestamp of repository gentoo: Sat, 27 Jun 2020 11:00:01 +0000
Head commit of repository gentoo: 80eaf4a2f289a4dc883265b58ae56d7519f97645
sh bash 5.0_p17
ld GNU ld (Gentoo 2.34 p4) 2.34.0
app-shells/bash:          5.0_p17::gentoo
dev-java/java-config:     2.3::gentoo
dev-lang/perl:            5.30.3-r1::gentoo
dev-lang/python:          2.7.18::gentoo, 3.7.7-r2::gentoo, 3.8.3::gentoo, 3.9.0_beta3::gentoo
dev-util/cmake:           3.17.3::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.2::gentoo
sys-devel/binutils:       2.34-r1::gentoo
sys-devel/gcc:            10.1.0-r1::gentoo
sys-devel/gcc-config:     2.3.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.7::gentoo (virtual/os-headers)
sys-libs/glibc:           2.31-r5::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24

mytestbed
    location: /usr/local/portage
    masters: gentoo

crossdev
    location: /usr/local/portage-crossdev
    masters: gentoo
    priority: 10

kde
    location: /var/lib/layman/kde
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/kde.git
    masters: gentoo
    priority: 50

qt
    location: /var/lib/layman/qt
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/proj/qt.git
    masters: gentoo
    priority: 50

Installed sets: @kde-frameworks, @kde-plasma
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/angband/gamedata/ /etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask-keep-masks"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.osuosl.org/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi activities alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli crypt cups dbus declarative dri dts dvd dvdr emboss encode exif ffmpeg flac fortran gdbm gif gtk iconv icu ipv6 jack jpeg kde kipi kwallet lcms ldap libnotify libtirpc mad mng mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds pulseaudio qml qt5 readline sdl seccomp semantic-desktop spell split-usr ssl startup-notification svg systemd tcpd tiff truetype udev udisks unicode upower usb vdpau vorbis widgets wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="sheets" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext sse sse2 sse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="wacom libinput joystick" KERNEL="linux" L10N="en-US en de fr" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python3_7 python3_8" QEMU_SOFTMMU_TARGETS="x86_64 i386 ppc" RUBY_TARGETS="ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="radeon r600" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 rnddim 2020-06-27 13:51:22 UTC
I had a thought to check if the title updated in other terminals, and it does. I also tried manually changing the title with echo and that worked too. I think the problem comes down to the file /usr/lib/<python-version>/site-packages/portage/output.py , specifically this line:

_legal_terms_re = re.compile(r'^(xterm|xterm-color|Eterm|aterm|rxvt|screen|kterm|rxvt-unicode|gnome|interix|tmux|st-256color|alacritty)')

I had recently changed my TERM variable in Konsole to more accurately reflect the fact that it isn't quite xterm (konsole doesn't let you modify the terminal's color palette):

$ echo $TERM
konsole-256color

And as you can see, the regex above doesn't check for this TERM value. This seems to me to be the culprit. It's worth noting that Konsole, for whatever unknown reason, has TERM set to xterm-256color by default, which would pass the regex (since it's not anchored at the end, it'll match just by starting with "xterm") and probably explains why nobody's noticed before.

I've manually added an alternative to the regex for TERMs starting with "konsole" to my local installation to test this out, and it allows the titles to work again.
Comment 2 Larry the Git Cow gentoo-dev 2020-06-27 19:46:41 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=06c333b65b6dfe59828408c47ca0225f1c182081

commit 06c333b65b6dfe59828408c47ca0225f1c182081
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-06-27 19:42:12 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-06-27 19:42:46 +0000

    xtermTitle: support konsole
    
    Bug: https://bugs.gentoo.org/729852
    Reported-by: rnddim@gmail.com
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/output.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 3 Zac Medico gentoo-dev 2020-06-27 19:47:40 UTC
Thanks for the report!
Comment 4 Larry the Git Cow gentoo-dev 2020-07-19 05:45:15 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bb3180edb5d310d5382bb3c0772c06be0b354806

commit bb3180edb5d310d5382bb3c0772c06be0b354806
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-07-19 05:18:41 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-07-19 05:37:48 +0000

    sys-apps/portage: Bump to version 3.0.0
    
     #703698 Improve repos.conf handling of boolean settings
     #721516 ecompress complains about compressed files that have
             been excluded by docompress -x
     #729852 Set XTerm titles for konsole
     #731114 Drop support for python2.7
     #731246 man ebuild(5) has incorrect example of $P and $PN
     #732378 Use lru_cache for use_reduce, vercmp, and catpkgsplit
     #733154 List of ignored warnings in .desktop files should be
             updated for compatibility with >=desktop-file-utils-0.25
    
    Bug: https://bugs.gentoo.org/733180
    Bug: https://bugs.gentoo.org/703698
    Bug: https://bugs.gentoo.org/721516
    Bug: https://bugs.gentoo.org/729852
    Bug: https://bugs.gentoo.org/731114
    Bug: https://bugs.gentoo.org/731246
    Bug: https://bugs.gentoo.org/732378
    Bug: https://bugs.gentoo.org/733154
    Package-Manager: Portage-3.0.0, Repoman-2.3.23
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/Manifest             |   1 +
 sys-apps/portage/portage-3.0.0.ebuild | 263 ++++++++++++++++++++++++++++++++++
 2 files changed, 264 insertions(+)