You are not logged in.

#1 2008-02-17 19:10:15

blackmariah
Member
From: Greenville, SC
Registered: 2008-02-02
Posts: 4
Website

Getting an odd character before PS1 on login shell, remote and local

but only on initial login. I have been looking through init scripts and am at a loss.  Anybody have a direction I can look in? That initial "G" isn't that big of a deal, but it's driving me crazy trying to find it.

G[mmcadory@blackmariah ~]$ su -
Password: 
Groot ~ #   ls -a
. ..
root ~ #  exit
logout
[mmcadory@blackmariah ~]$
[mmcadory@blackmariah ~]$ uname -a 
Linux blackmariah.homelinux.com 2.6.24-ARCH #1 SMP PREEMPT Sun Feb 10 15:44:59 CET 2008 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ AuthenticAMD GNU/Linux

Offline

#2 2008-02-17 19:30:01

bender02
Member
From: Germany
Registered: 2007-02-04
Posts: 1,328

Re: Getting an odd character before PS1 on login shell, remote and local

If it's only on initial login, it's probably one of the profile files: check your .profile, .bash_profile, .zprofile ... (depending on your shell).

EDIT: Well, while you're at it, you can check all files run at the startup of a shell, one or another: .login, .*shrc,...

Last edited by bender02 (2008-02-17 19:30:59)

Offline

#3 2008-02-17 21:59:03

hacosta
Member
From: Mexico
Registered: 2006-10-22
Posts: 422

Re: Getting an odd character before PS1 on login shell, remote and local

grep PS1 /etc/profile

that's probably where the problem is

Offline

#4 2008-02-17 22:10:09

bender02
Member
From: Germany
Registered: 2007-02-04
Posts: 1,328

Re: Getting an odd character before PS1 on login shell, remote and local

Ah, right, I didn't notice it prints the 'G' also for root account... then of course it's not in your user .profile files, but in /etc/profile, or /etc/profile.d/*; hacosta is right.
But I don't think the problem is with PS1 line... if it would, then it would print 'G' before every prompt. It's probably just some forgotten 'G' somewhere else in /etc/profile.

Offline

#5 2008-02-18 20:17:41

blackmariah
Member
From: Greenville, SC
Registered: 2008-02-02
Posts: 4
Website

Re: Getting an odd character before PS1 on login shell, remote and local

[mmcadory@blackmariah ~]$ cat /etc/profile.d/locale.sh 
export LANG=en_US.utf8
if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then echo -ne "\e%G"; fi

was the culprit.  Can someone explaine the necessity of the echo statement?

Thanks for the heads up.

Offline

#6 2008-02-18 21:50:34

bender02
Member
From: Germany
Registered: 2007-02-04
Posts: 1,328

Re: Getting an odd character before PS1 on login shell, remote and local

I have the same /etc/profile.d/locale.sh, and no G gets printed anytime. Anyway, that thing is to "switch on" the unicode on consoles, see for example gentoo wiki on unicode. Note that the '\e' part should be just the "escape character" - on the wiki they use '\033'.

What I find strange is that /etc/profile.d/locale.sh does *not* belong to any package.

Offline

#7 2008-02-22 05:32:50

rdt
Member
Registered: 2007-04-26
Posts: 24

Re: Getting an odd character before PS1 on login shell, remote and local

If I make an account with /bin/dash as the login shell I sometimes see the complete '-ne "\e%G"' being printed to the VT when I login.

After checking with dash as the shell, I find that it should be changed to '/bin/echo -ne "\033%G"' in /etc/profile.d/locale.sh
as the echo in dash does not seem to like either the -ne or the '\e'.

Oh, and 'pacman -Qo /etc/profile.d/locale.sh' says:
error: No package owns /etc/profile.d/locale.sh

sad

Last edited by rdt (2008-02-22 05:37:47)

Offline

Board footer

Powered by FluxBB