Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 309261 - app-misc/mc - using subshell makes bash log some PS1-related junk into history
Summary: app-misc/mc - using subshell makes bash log some PS1-related junk into history
Status: VERIFIED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Alex Alexander (RETIRED)
URL: http://www.midnight-commander.org/tic...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-13 13:56 UTC by Doktor Notor
Modified: 2010-03-17 12:41 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 Doktor Notor 2010-03-13 13:56:13 UTC
E.g., if I type cd /usr/portage/distfiles into a subshell in , the folloging will get logged:

 cd "`printf "%b" '\0057'`"
 cd "`printf "%b" '\0057usr'`"
 cd "`printf "%b" '\0057usr\0057portage'`"
 cd "`printf "%b" '\0057usr\0057portage\0057distfiles'`"
 cd "`printf "%b" '\0057'`"

Have had this problem for ages, valid with any app-misc/mc version incl. the latest masked 4.7.1. Happens not always, usually doesn't happen if I press Enter before typing into the subshell. 

Extremely annoying, would at least welcome a hint how to make bash not log such crap.

Just in case, but this is Gentoo-standard anyway:

$ echo $PS1
\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\]

Portage 2.1.8.3 (default/linux/x86/10.0/desktop, gcc-4.4.3, glibc-2.11-r1, 2.6.33-gentoo-ck1 i686)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.33-gentoo-ck1-i686-AMD_Athlon-tm-_XP_2800+-with-gentoo-2.0.1
Timestamp of tree: Sat, 13 Mar 2010 12:15:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.1_p2
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.4-r1, 3.1.1-r1
dev-python/pycrypto: 2.1.0
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.8.0-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.0-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1
sys-devel/gcc:       4.4.3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.33
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo"
CXXFLAGS="-O2 -march=athlon-xp -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--alphabetical --keep-going --with-bdeps y"
FEATURES="assume-digests buildsyspkg ccache distlocks fakeroot fixpackages metadata-transfer news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.mirror.web4u.cz/ http://ftp.fi.muni.cz/pub/linux/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,--hash-style=gnu"
LINGUAS="cs en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--prune-empty-dirs --omit-dir-times"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/php-testing /var/lib/layman/php-experimental /var/lib/layman/sunrise /var/lib/layman/enlightenment /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X X509 a52 aac aalib acl acpi alsa amr ao bash-completion berkdb bluetooth branding bzip2 cairo caps cdda cddb cdparanoia cdr cleartype cli cracklib crypt css cups curl cvs cxx dbus directfb djvu dri dts dv dvd dvdr encode exif faac faad fam fat fbcon ffmpeg firefox flac flash fontconfig ftp fuse gd gdbm ggi gif git gnome-keyring gnutls gpm gs gsm gstreamer gtk hal iconv icu id3tag idn ieee1394 imagemagick imap ipv6 irda jbig jpeg jpeg2k ladspa lame lcms libcaca libnotify libsamplerate lirc lm_sensors lock lua lzo mad maildir matroska mikmod mmx mmxext mng modules mp3 mp4 mpeg mudflap musepack musicbrainz ncurses network network-cron nfs nfsv3 nfsv4 nls nptl nptlonly nsplugin ntfs offensive ogg openal openexr opengl openmp pam pch pcre pdf perl pkcs11 plotutils png portaudio ppds pppd python quicktime raw readline reflection reiserfs rss schroedinger sdl session shorten skey sndfile sox speex spell spl sqlite sqlite3 sse ssl startup-notification subversion svg symlink sysfs system-sqlite taglib tcl tcpd theora thunar tiff tk truetype unicode usb v4l v4l2 vcd vorbis wavpack win32codecs wmf wxwidgets x264 x86 xattr xcb xinerama xinetd xml xorg xpm xulrunner xv xvid xvmc zlib" ALSA_CARDS="emu10k1 bt87x" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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 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" ELIBC="glibc" INPUT_DEVICES="evdev joystick keyboard lirc mouse vmmouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="cs en" LIRC_DEVICES="cph06x devinput" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nouveau nvidia v4l vmware" 
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS

=================================================================
                        Package Settings
=================================================================

app-shells/bash-4.1_p2 was built with the following:
USE="-afs -bashlogger -examples -mem-scramble net nls -plugins -vanilla" 

app-misc/mc-4.7.1 was built with the following:
USE="X edit gpm nls -samba -slang"
Comment 1 Rafał Mużyło 2010-03-13 17:18:20 UTC
Well, I'm seeing something alike, but it seems quite random.
Comment 2 Doktor Notor 2010-03-14 11:58:11 UTC
(In reply to comment #1)
> Well, I'm seeing something alike, but it seems quite random.

Good to know I'm not alone. Upstream stuff related to shell history:

http://www.midnight-commander.org/ticket/2027
http://www.midnight-commander.org/ticket/2082

I guess I should file one about this there are well, it's not Gentoo-specific since I managed to reproduce this on FreeBSD as well. Though, I'd like to find out when exactly this happpens at least first before filing something upstream.
Comment 3 Doktor Notor 2010-03-17 09:36:16 UTC
Oh well... meanwhile, sticking 

export HISTIGNORE='cd "\`printf*'

into $HOME/.bashrc seems to kill most of the junk. Since this clearly isn't anything Gentoo-specific, I'm closing the bug as UPSTREAM. Clean solutions still welcome. :)
Comment 4 Doktor Notor 2010-03-17 12:41:37 UTC
Ok, so... for those scratching their head about their clobbered history, this is the outcome :)

http://www.midnight-commander.org/wiki/doc/faq#a6.8Iseelotofstrangecdprintflinesintomy.historyfile