gnome-terminal window loses title

Bug #60341 reported by Santiago Canez
4
Affects Status Importance Assigned to Milestone
gnome-terminal (Ubuntu)
Fix Released
Low
Ubuntu Desktop Bugs

Bug Description

Binary package hint: gnome-terminal

When gnome-terminal is first started, the window title reads "Terminal". After a while though, the title completely disappears. This doesn't happen with other apps so it doesn't seem to be a metacity problem, but specific to gnome-terminal. This happens every time gnome-terminal is started.

Revision history for this message
Daniel Holbach (dholbach) wrote :

Thanks for your bug report. Which version of Ubuntu and gnome-terminal do you use? Do use any other apt repositories? Can you attach the output of
    diff -u /etc/skel/.bash_profile .bash_profile
    diff -u /etc/skel/.bashrc .bashrc

Changed in gnome-terminal:
assignee: nobody → desktop-bugs
importance: Untriaged → Low
status: Unconfirmed → Needs Info
Revision history for this message
Santiago Canez (canez) wrote :

This is under Edgy with gnome-terminal 2.16.0-0ubuntu1, with no other apt repositories. Also, I use zsh insetad of bash.

After some more investigating, I now see that this happens when using vim. In other words, opening and then closing vim causes this. So maybe this is a vim problem instead? It also happens without anything in my .vimrc, and I did not have this problem under dapper.

Revision history for this message
David Planella (dpm) wrote :

Confirming. It happpens to me always after running vim as well. IIRC, this seems to happen to me after running 'cvs ci' commands with cvsnt as well.

Before executing vim, the gnome-terminal window title reads "Terminal", after exiting vim, it reads "untitled window".

I'm running Edgy, using the 2.16.1-0ubuntu g-t version, and I had never seen this behaviour in Dapper.

Changed in gnome-terminal:
status: Needs Info → Confirmed
Revision history for this message
David Planella (dpm) wrote :

I'm attaching a text file with the differences between ~/.bashrc and /etc/skel/.bashrc as requested. There were no differences between /etc/skel/.bash_profile and ~/.bash_profile

Revision history for this message
Sebastien Bacher (seb128) wrote :

Does it happen using bash? Do you get the bug when using xterm by example?

Changed in gnome-terminal:
status: Confirmed → Needs Info
Revision history for this message
David Planella (dpm) wrote :

I'm using bash, and I can reproduce the bug with gnome-terminal (simply edit any file with vim), but not with xterm.

Revision history for this message
Daniel Holbach (dholbach) wrote :

I can't reproduce it.

Revision history for this message
David Planella (dpm) wrote :

I can reproduce it on 2 computers. However, I've tried it on a third one and I could not reproduce it.

I believe it definitely has to do with vim, since this only happens after quitting it. Furthermore, on the comment I was saying that this also happens when executing 'cvs ci', I forgot that I'm using vim as $CVSEDITOR for commit log messages. Therefore, when commiting files on cvs I do execute vim.

I've observed the following:

1.- When opening a gnome-terminal window, the titlebar reads "Terminal" on the two computers where I can reproduce the bug. On the third ("bug-free") one however, the terminal titlebar shows "dpm@scenic: /home/dpm", where dpm is my user name and scenic the host name. Whenever I change directory on this computer, the titlebar gets updated with the current directory, which does not happen on the two other ones (It always stays as "Terminal").

2.- Copying .vimrc and the .vim folder from a computer where this bug happens to the computer where this *not* happens has no effect. That is, the bug is still not reproduceable there.

3.- I've got a root account enabled on one of the computers where the bug happens. If I do a 'su -' and then execute vim from the root account, the titlebar is not lost after executing vim. While being in the root shell, the titlebar is updated with the current directory. When exiting the root shell with CTRL+D, the titlebar remains frozen at the last folder navigated from the root shell (e.g. "root@orthanc ~").

After what I've seen on 1.-, I'm a bit confused to what it could be. Here's a short recap:

Computer Bug Initial title
                  reproduceable?
------------- -------------------- -----------------------------------------------------------------
#1 Yes "Terminal" (remains always like that)
#2 Yes "Terminal" (remains always like that)
#3 No <user>@<host> /home/<user> (the path gets updated when doing 'cd')

All 3 computers have the following same settings under Edit>Current Profile... Title and Command tab:

Initial Title: Terminal
Dynamically-set title: Replaces initial title.

Revision history for this message
David Planella (dpm) wrote :

Well, I found what the cause of the problem is in my particular case. On the following diff between /etc/skel/.bashrc and ~/.bashrc, which I attached some days ago, the bug disappears when I uncomment the line:

PROMPT_COMMAND='history -a'

@@ -70,3 +70,13 @@
 if [ -f /etc/bash_completion ]; then
     . /etc/bash_completion
 fi
+
+# Append entries to the history file for each new shell
+shopt -s histappend
+# The contents of this variable are executed as a regular Bash command
+# just before Bash displays a prompt. This appends the history entries
+# for all open shells
+PROMPT_COMMAND='history -a'
+
+# Export the local repository root
+export CVSROOT=/home/dpm/cvsrepo

After doing that, I no longer get a static "Terminal" title bar text, but it gets updated with the output of the current command as expected. So the vim thing was just a red herring, I believe.

What was happening, I think, was that on the initial launch of gnome-terminal, the title bar was not being set and the "Terminal" default was being used. When using vim, it set the titlebar text to the name of the file being edited, and when exiting vim, the title bar was updated to nothing.

So this is either a problem with bash or gnome-terminal, I think. But considering that Santiago is using zsh and also experiencing this problem, I'd be more inclined to think that this is a problem with gnome-terminal.

IIRC, on Dapper gnome-terminal was not showing this problem. I might try later on with a Dapper LiveCD if this was the case.

Changed in gnome-terminal:
status: Needs Info → Unconfirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

Do the other people having that problem use PROMPT_COMMAND?

Changed in gnome-terminal:
status: Unconfirmed → Needs Info
Revision history for this message
David Planella (dpm) wrote :

It seems that this bug is easily reproduceable in Feisty after a new installation (i.e. no ~/.bashrc) with and a non-customized vim (i.e. no ~/.vimrc, no plugins, just a default install).

Steps to reproduce:

1.- Start gnome-terminal.

2.- Execute vim.

3.- Exit vim.

4.- The gnome-terminal title is forever set to "Untitled window"

One thing I noticed as well is that the gnome-terminal window title on my Feisty installation does not get updated with the current directory but it always remains as "Terminal".

Revision history for this message
Santiago Canez (canez) wrote :

This bug is no longer present for me under Feisty using gnome-terminal version 2.18.0-0ubuntu1.

Revision history for this message
Sebastien Bacher (seb128) wrote :

closing the bug then

Changed in gnome-terminal:
status: Needs Info → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.