Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 140335 - xterm title bar escape sequence trouble with utf8
Summary: xterm title bar escape sequence trouble with utf8
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Emanuele Giaquinta (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-14 03:42 UTC by michael
Modified: 2006-07-16 16:07 UTC (History)
2 users (show)

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 michael 2006-07-14 03:42:13 UTC
When using the default xterm PROMPT_COMMAND echo escape sequence:

PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'

AND when entering a directory with a name containing UTF-8 characters,

The characters that are not US-ASCII are displayed in the title bar using ISO-8859-1 encoding. US-ASCII characters are displayed correctly, and everything displays correctly (as far as font support is available) inside the xterm. Replacing the part of the escape sequence between ; and \007 with UTF-8 data shows the same behavior. I have not seen this behavior with any other application. Creating a directory with a name encoded in ISO-8859-1 and entering it using 'cd' causes the title bar to display correctly.

Relevant application versions:

xorg-x11-7.0-r1
gtk+-2.8.19
xfce4-4.2.3.2
xterm-215
bash-3.1_p16
baselayout-1.11.15-r3

Locale ("locale" output):

LANG=en_US.utf8
LC_CTYPE=en_US.utf8
LC_NUMERIC=en_US.utf8
LC_TIME=C
LC_COLLATE=C
LC_MONETARY=sv_SE.utf8
LC_MESSAGES=en_US.utf8
LC_PAPER=sv_SE.utf8
LC_NAME=sv_SE.utf8
LC_ADDRESS=sv_SE.utf8
LC_TELEPHONE=sv_SE.utf8
LC_MEASUREMENT=sv_SE.utf8
LC_IDENTIFICATION=en_US.utf8
LC_ALL=

Installed locales ("locale -a" output):

C
POSIX
en_US
en_US.utf8
sv_SE.utf8

I have had the same problem with X.org 6.8.2, various releases. Reportedly, X.org 6.8.2 + bash-3.00 + xterm-197 exhibits the same behavior (Xfce version in that case is unknown).

"emerge --info" output:

Portage 2.1-r1 (default-linux/amd64/2005.0, gcc-3.4.6, glibc-2.3.6-r4, 2.6.16-gentoo-r12 x86_64)
=================================================================
System uname: 2.6.16-gentoo-r12 x86_64 AMD Athlon(tm) 64 Processor 3000+
Gentoo Base System version 1.6.15
app-admin/eselect-compiler: [Not Present]
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=k8 -pipe -m3dnow -mmmx -msse -msse2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -march=k8 -pipe -m3dnow -mmmx -msse -msse2"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks metadata-transfer sandbox sfperms strict userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.utf8"
LINGUAS="en_US en"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="amd64 X alsa arts audiofile avi berkdb bitmap-fonts bonobo bzip2 cjk cli crypt cups directfb dlloader dri elibc_glibc emboss encode esd exif flac foomaticdb fortran gd gdbm gif gmp gnome gpm gstreamer gtk gtk2 gtkhtml guile imlib isdnlog jpeg jpeg2k kde kernel_linux lcms lzw lzw-tiff mad mng mp3 mpeg ncurses nls ogg openal opengl pam pcre pdflib perl png ppds pppd python qt qt3 qt4 quicktime readline reflection samba sdl session slang spell spl ssl svg tcltk tcpd tetex tiff truetype truetype-fonts type1-fonts udev unicode usb userland_GNU vorbis xml xml2 xorg xpm xv zlib input_devices_keyboard input_devices_mouse linguas_en_US linguas_en video_cards_radeon video_cards_vga"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Emanuele Giaquinta (RETIRED) gentoo-dev 2006-07-14 05:02:50 UTC
It's not a bug; title strings are limited to iso-8859-1, and when running in an utf-8 locale xterm converts the input string to utf-8 (see the ChangeGroup function in misc.c). However, to insert utf-8 data you can set the utf8Title resource, see the man page. 
Comment 2 michael 2006-07-14 05:13:42 UTC
(In reply to comment #1)
> However, to insert utf-8 data you can set the utf8Title resource, see the man page.

Setting utf8Title to 'true' works as a workaround at least, thank you!
Comment 3 Emanuele Giaquinta (RETIRED) gentoo-dev 2006-07-16 16:07:13 UTC
np, closing as invalid then.