Computing.Net > Forums > Linux > Xterm Problem

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Xterm Problem

Reply to Message Icon

Name: Acoc
Date: January 25, 2004 at 09:18:08 Pacific
OS: Slackware, Fluxbox
CPU/Ram: Pentium 120
Comment:

Hello,
I have installed fluxbox on my computer, but the xterm that comes with it only displays "bash-2.05b#". Does anyone know the command to make fluxbox display the location it is currently in.




Sponsored Link
Ads by Google

Response Number 1
Name: taurus
Date: January 25, 2004 at 12:47:26 Pacific
Reply:

Look in /etc/bashrc and/or /etc/profile to see what the setting is... Maybe one of the lines should look something like (one single line),

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

taurus


0

Response Number 2
Name: Acoc
Date: January 25, 2004 at 13:46:11 Pacific
Reply:

Hi taurus,
I looked into the /etc/profile using the cat command but there was no PROMT_COMMAND. Im kind of new to linux, so if you think I should add this command, could you please tell me the easiest way to do it.


0

Response Number 3
Name: taurus
Date: January 25, 2004 at 15:18:47 Pacific
Reply:

Did you look in /etc/bashrc as well? You should see that line in /etc/bashrc and if not, add it at the end of that file by using a text editor,

pico /etc/bashrc

Save it and run this at the prompt,

source /etc/bashrc

taurus


0

Response Number 4
Name: Acoc
Date: January 25, 2004 at 16:08:48 Pacific
Reply:

I looked for the /etc/bashrc but it doesn't exist on my computer. Then I found a nice program (xedit) that let me easily add the lines of code to /etc/profile. I then ran source /etc/profile and it worked with errors on the new lines. It did however give me the hostname and location, so I went back and deleted the new lines. After running source /etc/profile again everything worked great and I got everything I needed. I guess that the code was written another way earlier, even though no place said PROMPT_COMMAND.

Unfortunately, every time I close xterm it forgets the source /etc/profile and goes back to the other bash-2.05b#. Is there a way to make this automatic?

Thanks again.


0

Response Number 5
Name: taurus
Date: January 25, 2004 at 16:15:08 Pacific
Reply:

You need to create a .bashrc in your home directory, ~, that contains this line then,

xedit ~/.bashrc
source /etc/profile

Log out completely and back in again. All the prompts should display the right setting now :)

taurus


0

Related Posts

See More



Response Number 6
Name: Acoc
Date: January 25, 2004 at 17:08:56 Pacific
Reply:

Thank you so much. The xterm now opens right to these settings.

For others I used:
vi .bashrc (return)
(the letter i)source /etc/profile (esc)
:wq (return)

I have just a few more quick questions and I really appriciate all your help. The xterm now starts up with a dumb quote and the font color for some of the files is really hard to see. If possible could you point out what I can delete to remove the quote and change the colors.

Here is /etc/profile :
# /etc/profile: This file contains system-wide defaults used by
# all Bourne (and related) shells.

# Set the values for some environment variables:
export MINICOM="-c on"
export MANPATH=/usr/local/man:/usr/man:/usr/X11R6/man
export HOSTNAME="`cat /etc/HOSTNAME`"
export LESSOPEN="|lesspipe.sh %s"
export LESS="-M"

# If the user doesn't have a .inputrc, use the one in /etc.
if [ ! -r "$HOME/.inputrc" ]; then
export INPUTRC=/etc/inputrc
fi

# Set the default system $PATH:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games"

# For root users, ensure that /usr/local/sbin, /usr/sbin, and /sbin are in
# the $PATH. Some means of connection don't add these by default (sshd comes
# to mind).
if [ "`id -u`" = "0" ]; then
echo $PATH | grep /usr/local/sbin 1> /dev/null 2> /dev/null
if [ ! $? = 0 ]; then
PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH
fi
fi

# I had problems using 'eval tset' instead of 'TERM=', but you might want to
# try it anyway. I think with the right /etc/termcap it would work great.
# eval `tset -sQ "$TERM"`
if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
TERM=linux
fi

# Set ksh93 visual editing mode:
if [ "$SHELL" = "/bin/ksh" ]; then
VISUAL=emacs
# VISUAL=gmacs
# VISUAL=vi
fi

# Set a default shell prompt:
#PS1='`hostname`:`pwd`# '
if [ "$SHELL" = "/bin/pdksh" ]; then
PS1='! $ '
elif [ "$SHELL" = "/bin/ksh" ]; then
PS1='! ${PWD/#$HOME/~}$ '
elif [ "$SHELL" = "/bin/zsh" ]; then
PS1='%n@%m:%~%# '
elif [ "$SHELL" = "/bin/ash" ]; then
PS1='$ '
else
PS1='\u@\h:\w\$ '
fi
PS2='> '
export PATH DISPLAY LESS TERM PS1 PS2

# Default umask. A umask of 022 prevents new files from being created group
# and world writable.
umask 022

# Set up the LS_COLORS and LS_OPTIONS environment variables for color ls:
if [ "$SHELL" = "/bin/zsh" ]; then
eval `dircolors -z`
elif [ "$SHELL" = "/bin/ash" ]; then
eval `dircolors -s`
else
eval `dircolors -b`
fi

# Notify user of incoming mail. This can be overridden in the user's
# local startup file (~/.bash.login or whatever, depending on the shell)
if [ -x /usr/bin/biff ]; then
biff y
fi

# Append any additional sh scripts found in /etc/profile.d/:
for file in /etc/profile.d/*.sh ; do
if [ -x $file ]; then
. $file
fi
done

# For non-root users, add the current directory to the search path:
if [ ! "`id -u`" = "0" ]; then
PATH="$PATH:."
fi


0

Response Number 7
Name: taurus
Date: January 25, 2004 at 17:20:10 Pacific
Reply:

Just comment out those lines after LS_COLORS & LS_OPTIONS. And regarding the dumb quote, I believe the program that runs that is called fortune!!! Either rename it to something else or see which script file calls it...

taurus


0

Response Number 8
Name: Acoc
Date: January 25, 2004 at 18:43:57 Pacific
Reply:

Thanks again taurus,
Deleting those parameters after LS_COLORS & LS_OPTIONS made the colors go back to black and white. Also, after puttering around I finally found that the code that causes the fortune to run is actually in /etc/profile.d not /etc/profile. Hopefully someone will read this and not make the same mistakes I did, becuase I had corrupted the game pretty good and was getting some bad error messages after loading up.

Thanks for all your help!


0

Sponsored Link
Ads by Google
Reply to Message Icon

SuSe Download Sound drivers



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Xterm Problem

Problems with SiS 6326 www.computing.net/answers/linux/problems-with-sis-6326/788.html

Xterm: Cannot Over Ride Display Bla www.computing.net/answers/linux/xterm-cannot-over-ride-display-bla/26424.html

Xterm (Exceed) b/w win2k & linux www.computing.net/answers/linux/xterm-exceed-bw-win2k-amp-linux/15565.html