Title for xterm window

[b][color=red]This was moved out of the Installation thread – it doesn’t belong there. Please try and categorise your threads in the correct place, please.

– Thomas Adam

Moved out of Decorations and bindings as the focus was quite shifting from Fvwm to Bash…

– theBlackDragon
[/color][/b]

Hi. I’m a fvwm user, and have a persistant problem I’m now submitting. I’m using a .fvwm2rc file in X-Windows to bring up tailored xterm windows. I would like to keep the title, for example from the file:

AddToMenu XTerm-Ops “Tomato” Exec exec xterm -sl 1000 -sb -rightbar -geom 50x25 -fn 8x13 -T “Tomato” -bg tomato -fg black -e /usr/bin/bash

  •   	"Squash"	Exec exec xterm -sl 1000 -sb -rightbar -geom 120x50 -fn 8x13 -T "Squash" -bg Bisque -fg black -e /usr/bin/bash 
    

But even though the title “Tomato” briefly shows at the top of the newly created xterm window, it is quickly replaced by the pwd prompt. How does one get around this?

Thank you

I suspect what is happening is that you have $PROMPT_COMMAND overwriting your preference. For instance, in my ~/.bashrc file I used to have:

 case $TERM in
    xterm*)
        PROMPT_COMMAND="$(pwd)"
        ;;
    *)
        ;;
    esac

What you should therefore do is change PROMPT_COMMAND to:

 PROMPT_COMMAND=''

I notice in your example you had:

Exec exec xterm -sl 1000 -sb -rightbar -geom 120x50 -fn 8x13 -T "Squash" -bg Bisque -fg black -e /usr/bin/bash

That’s fine – but if Xterm spawns a login shell (implied with the '-ls- argument) – you should ensure that from within ~/.bash_profile you:

source ~/.bashrc

So that your ~/.bashrc file is read. Note that adding the PROMPT_COMMAND stuff to ~/.bashrc is the correct place so that interactive shells make use of this.

Does that help?

– Thomas Adam

To Adam,

I’ve examined the recource files, and tinkered some more with them, but I can’t find a PROMPT or PROMPT_COMMAND anywhere that affects this problem. Perhaps I can paste my .bashrc contents, and let you look at it for comments. This wouldn’t be a .fvwm2rc file configuration?

Thanks - Walter Goedecke
.bashrc:

User dependent .bashrc file

echo Entering .bashrc

See man bash for more options…

Don’t wait for job termination notification

set -o notify

Don’t use ^D to exit

set -o ignoreeof

Don’t put duplicate lines in the history.

export HISTCONTROL=ignoredups

Some user specific aliases and functions

alias less=‘less -r’
alias rm=‘rm -i’
alias whence=‘type -a’

alias ls=‘ls -F --color=tty’

alias dir=‘ls --color=auto --format=vertical’
alias vdir=‘ls --color=auto --format=long’
alias ll=‘ls -l’
alias la=‘ls -A’
alias l=‘ls -CF’
alias ls=‘ls -aF --color=never’
alias lc=‘ls -aF --color=auto’
alias lps=‘lp -opostscript’
alias xterm=‘xterm -sb’

alias hi=‘history 40’
alias EMA=‘cd c:/EMA/’
alias laas=‘cd c:/EMA/LAASproject’

Some example functions

function settitle() { echo -n “^[]2;$@^G^[]1;$@^G”; }

Source global definitions

if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

#Reset shell prompt
set PROMPT=$P$G
set shell PROMPT=$PWD

echo Sourceing additional script

Alias script for ForTran

source falias.sh

echo Exiting .bashrc

To Adam,

I found the problem. By using either “set” or “printenv” I was able to see the PS1 value:

PS1=$’\[\033]0;\w\007\n\033[32m\]\u@\h \[\033[33m\w\033[0m\]\n$ ’

The first part:

$’\[\033]0;\w\007\n\033[32m\]

affects the x-window title.

The seond part displays user@host, then displays the directory under the user area:

\u@\h \[\033[33m\w\033[0m\]\n$ ’

I’m using this last part:
export PS1=$’\u@\h \[\033[33m\w\033[0m\]\n$ ’

to get desired effect, without affecting the window title. I’m not good at deciphering this UNIX text.

Thanks
Walter Goedecke

My first name is “Thomas”. “Adam” is my surname. :slight_smile:

– Thomas Adam