You are not logged in.

#1 2014-12-17 18:00:39

davama
Member
From: NY
Registered: 2014-02-07
Posts: 45

[Solved] lxterminal cannot set window title

Saw this post but i couldn't make it work for me. Although this post is dated 2011
http://bbs.archbang.org/viewtopic.php?id=1024

here is my /etc/bash.bashrc file

#
# /etc/bash.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

PS1='[\u@\h \W]\$ '
PS2='> '
PS3='> '
PS4='+ '

case ${TERM} in
  xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
    PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'

    ;;
  screen)
    PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
    ;;
esac

[ -r /usr/share/bash-completion/bash_completion   ] && . /usr/share/bash-completion/bash_completion
PATH=/home/dvmacias/.cabal/bin:$PATH

alias ll='ls -al'
alias vi=vim

and my local ~/.bashrc file

#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]\n\[\033[32m\]\w\n\[\033[0;33m\]** \# ** \[\033[1;34m\]\$(/bin/date) \[\033[0;35m\]\u@\h: \[\033[0;36m\]\$(/usr/bin/tty | /bin/sed -e 's:/dev/::'): \$(/bin/ls -1 | /usr/bin/wc -l | /bin/sed 's: ::g') files \$(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed 's/total //')b \n\[\033[0;37m\]-> \[\033[0;31m\]"
alias ll='ls -al'
alias vi='vim'
complete -cf sudo
complete -cf *
alias beep="beep -f 5000 -l 50 -r 2"
alias sudo="sudo "
alias tree='tree -C'
alias tunnel="sudo openvpn --config /etc/openvpn/openvpn.conf"
function sshnasty () {
	if [ -z $1 ]; then return; fi
	for K in "$@"; do sed -i "$K"d ~/.ssh/known_hosts; done
}
source ~/.bash_aliases
PATH=/home/dvmacias/.cabal/bin:$PATH

Env Variables

echo $SHELL
/bin/bash
echo $TERM
xterm

Using lxterminal-0.2.0-1

I even striped down my bashrc files to nothing but still no success. Any input is appreciated. Thanks

Dave

Last edited by davama (2015-03-23 12:38:19)

Offline

#2 2015-03-20 15:54:30

davama
Member
From: NY
Registered: 2014-02-07
Posts: 45

Re: [Solved] lxterminal cannot set window title

If nobody replies what should i do? Anyone around?

hmm

Offline

#3 2015-03-20 17:26:52

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,865

Re: [Solved] lxterminal cannot set window title

These are very active forums.  In general, no response means we don't understand your problem, or we really don't know the answer.  As it pointed out in our policy, it is better to meet silence with more information


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2015-03-20 17:44:22

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,662
Website

Re: [Solved] lxterminal cannot set window title

What is currently in the window title?  Can you set it from within the shell session in that window?  Try the following, does the terminal title change to "Hello" for 3 seconds?  Does it change back to something else after 3 seconds?

echo -e "\033]0;Hello\007" && sleep 3

"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2015-03-23 11:56:08

davama
Member
From: NY
Registered: 2014-02-07
Posts: 45

Re: [Solved] lxterminal cannot set window title

ewaller and Trilby

Thank you both for responding. It's appreciated.

So i ran the echo command, and yes the name did change for 3 seconds. Here is the before change (using xprop)

WM_CLASS(STRING) = "lxterminal", "Lxterminal"
WM_ICON_NAME(STRING) = "dvmacias@ARCH:~"
_NET_WM_ICON_NAME(UTF8_STRING) = "dvmacias@ARCH:~"
WM_NAME(STRING) = "dvmacias@ARCH:~"
_NET_WM_NAME(UTF8_STRING) = "dvmacias@ARCH:~"

And here is during the echo; sleep command:

WM_CLASS(STRING) = "lxterminal", "Lxterminal"
WM_ICON_NAME(STRING) = "Hello"
_NET_WM_ICON_NAME(UTF8_STRING) = "Hello"
WM_NAME(STRING) = "Hello"
_NET_WM_NAME(UTF8_STRING) = "Hello"

I have absolutely no idea what this tells me. Please educate me.
Thanks

Offline

#6 2015-03-23 12:03:55

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,662
Website

Re: [Solved] lxterminal cannot set window title

This means something in your PS1 or PROMPT_COMMAND (or something similar) is resetting the title.  But now I'm confused, what is the actual problem here?  The first xprop output shows the title to be user@host:pwd which is exactly what the PROMPT_COMMAND is supposed to set it to.  It looks to me like everything is working just as it should.  Can you describe how the results deviate from your intent?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2015-03-23 12:09:50

davama
Member
From: NY
Registered: 2014-02-07
Posts: 45

Re: [Solved] lxterminal cannot set window title

Well if i run:

lxterminal --title=TITLE
#or
lxterminal -t TITLE

Nothing happens. WIndow title is not changed.
xprop still shows:

WM_CLASS(STRING) = "lxterminal", "Lxterminal"
WM_ICON_NAME(STRING) = "dvmacias@ARCH:~"
_NET_WM_ICON_NAME(UTF8_STRING) = "dvmacias@ARCH:~"
WM_NAME(STRING) = "dvmacias@ARCH:~"
_NET_WM_NAME(UTF8_STRING) = "dvmacias@ARCH:~"

Since i use xmonad i rely on window titles.
Thanks again

Offline

#8 2015-03-23 12:13:59

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,662
Website

Re: [Solved] lxterminal cannot set window title

*headdesk*

That does indeed set the title - for a split seccond until the PROMPT_COMMAND resets it.  If you do not want the title to reset to user@host:pwd, then just remove/reset the PROMPT_COMMAND that does that.

The best way would probably be to just add the following to your bashrc:

PROMPT_COMMAND=

"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2015-03-23 12:38:02

davama
Member
From: NY
Registered: 2014-02-07
Posts: 45

Re: [Solved] lxterminal cannot set window title

Wow. That was so easy. It works now.
I added:

if [ $TERM = xterm ] ; then
    unset PROMPT_COMMAND
fi

to my ~/.bashrc

Marking as solved.

Thank you for your time Trilby.

Dave

Offline

Board footer

Powered by FluxBB