You are not logged in.

#1 2004-12-08 14:47:04

CarLost
Member
From: Chile
Registered: 2004-12-08
Posts: 35
Website

Prompt Questions

Hi, I have a little problem and is very ....... strange

In console my prompt looks like :

;root@Depto:~[11:39][root@Depto ~]#

and in a terminal just;

[11:39][root@Depto ~]#


my PS1 is
PS1='[`date +'%H:%M'`][[33[01;31m]u[33[37m]@[33[01;34m]h[33[32m] w[33[00m]]$ '

and I don't know why..... please help, is not a big deal, but it noise me

thanks

Offline

#2 2004-12-08 15:31:12

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Prompt Questions

I don't understand the problem... do you want the prompt to look like this?  Do you want a different prompt?

Offline

#3 2004-12-08 15:49:23

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Prompt Questions

Make sure your $TERM is set to 'linux' when in the console (if you change it manually then you need to restart bash too to fix your prompt).

Offline

#4 2004-12-08 16:53:06

CarLost
Member
From: Chile
Registered: 2004-12-08
Posts: 35
Website

Re: Prompt Questions

phrakture wrote:

I don't understand the problem... do you want the prompt to look like this?  Do you want a different prompt?

the problem is the first part of the prompt in console i.e. ";root@Depto:~"

only in console, not in terminal

other....

TERM=xterm-color    in both, term & console


last notice.....

when i do a ssh login to others machines (in console) I get the same promt

like:        ;carlos@FIREWALL:~[carlos@FIREWALL carlos]$


and in the local machine  ";carlos@FIREWALL:~" don't exist

I DON' LIKE THIS ";carlos@FIREWALL:~"

Offline

#5 2004-12-08 17:04:39

xerxes2
Member
From: Malmoe, Sweden
Registered: 2004-04-23
Posts: 1,249
Website

Re: Prompt Questions

could it be some problem with a double ps1 declaration,
both in /etc/profile ansd someplace else like ~/.bashrc


arch + gentoo + initng + python = enlisy

Offline

#6 2004-12-08 17:54:48

aias
Member
Registered: 2004-06-28
Posts: 39

Re: Prompt Questions

I think the order is:
~/.bashrc and then /etc/profile

could you post your
echo $PS1

from both console and terminal?

Offline

#7 2004-12-08 18:49:46

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Prompt Questions

*hint*

i3839 wrote:

Make sure your $TERM is set to 'linux' when in the console

*hint*

Offline

#8 2004-12-08 19:00:44

aias
Member
Registered: 2004-06-28
Posts: 39

Re: Prompt Questions

I think you should take the hint  big_smile CarLost.  incidentally i3839, (and this is purely because I want to learn), how is it normally done?  I mean how does the system know to set $TERM to linux in a console and xterm or rxvt or something like that in a terminal? (termcap?)

Offline

#9 2004-12-08 19:09:01

CarLost
Member
From: Chile
Registered: 2004-12-08
Posts: 35
Website

Re: Prompt Questions

i3839 wrote:

*hint*

i3839 wrote:

Make sure your $TERM is set to 'linux' when in the console

*hint*

I already do that! but don't work

the .bashrc should not pass trough a ssh login...... I repeat, that is only in console, not in terminal

I check env (& set) both (console& term) & are the same, are equals

My $PS1 are in the first post
sad

Offline

#10 2004-12-08 19:12:44

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Prompt Questions

CarLost wrote:
i3839 wrote:

*hint*

i3839 wrote:

Make sure your $TERM is set to 'linux' when in the console

*hint*

I already do that! but don't work

the .bashrc should not pass trough a ssh login...... I repeat, that is only in console, not in terminal

I check env (& set) both (console& term) & are the same, are equals

My $PS1 are in the first post
sad

he's not saying they should be the same...
in a previous post you stated they were both "xterm-color".... i3839 is saying you need to switch from "xterm-color" to "linux"

Offline

#11 2004-12-08 19:31:30

CarLost
Member
From: Chile
Registered: 2004-12-08
Posts: 35
Website

Re: Prompt Questions

phrakture wrote:

he's not saying they should be the same...
in a previous post you stated they were both "xterm-color".... i3839 is saying you need to switch from "xterm-color" to "linux"

OK I repeat, I do this... and restart .bashrc  ..... even I reboot the system and get the same result

I have ArchLinux at work too and there I don't have that problem....

I still looking for an answer in other places to.... just in case

Offline

#12 2004-12-08 19:42:06

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Prompt Questions

ok post your PS1 contents from all the following files, if they exist:
/etc/profile
~/.bashrc
~/.bash_profile
~/.profile

Offline

#13 2004-12-08 19:55:56

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Prompt Questions

aias wrote:

how does the system know to set $TERM to linux in a console and xterm or rxvt or something like that in a terminal? (termcap?)

Normally the terminal program should be smart enough to know it's own termname, but somehow Arch's rxvt version isn't (can't remember having this problem with another rxvt version). So how to work around this issue is just a matter of creativity. Simplest would be to always call e.g. rxvt with the -tn option, or to set the termName X resource setting to "rxvt", can also set other things there, e.g.

In ~/.Xdefaults:

rxvt.termName:     rxvt
rxvt.background:   black
rxvt.foreground:     white

Offline

#14 2004-12-08 20:26:46

CarLost
Member
From: Chile
Registered: 2004-12-08
Posts: 35
Website

Re: Prompt Questions

phrakture wrote:

ok post your PS1 contents from all the following files, if they exist:
/etc/profile
~/.bashrc
~/.bash_profile
~/.profile

OK!!!!!! I fix the problemmmmmmm
realy thanks to everyone

the proble was a line in /etc/profile

if [ "$TERM" = "xterm" -o "$TERM" = "xterm-color" -o "$TERM" = "rxvt" ]; then
  PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}07"'
fi

maybe I put my fingers there

I just unset and done...... THANKS

Offline

#15 2004-12-08 21:07:47

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Prompt Questions

that's the problem that i3839 had pointed out earlier:
the PROMPT_COMMAND variable is pushed on the front of PS1 - in an xterm/rxvt/aterm/whatever this is parsed and set to the window title... in a real terminal it is not parsed and is output instead.... as the if statement above the command states, it only uses it for the right terminals.... if your console was set to "linux" it would not hit inside that if statement and PROMPT_COMMAND would not exist...

Offline

#16 2004-12-08 23:03:24

CarLost
Member
From: Chile
Registered: 2004-12-08
Posts: 35
Website

Re: Prompt Questions

phrakture wrote:

that's the problem that i3839 had pointed out earlier:
the PROMPT_COMMAND variable is pushed on the front of PS1 - in an xterm/rxvt/aterm/whatever this is parsed and set to the window title... in a real terminal it is not parsed and is output instead.... as the if statement above the command states, it only uses it for the right terminals.... if your console was set to "linux" it would not hit inside that if statement and PROMPT_COMMAND would not exist...

Ok, just abobe the PROMPT_COMMAND line I found an export TERM=xterm-color, thats is because I get the problem

I don't know the PROMPT_C... is for the windows title before

Thanks a lot

Offline

Board footer

Powered by FluxBB