! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
using vim several times results in a 'Terminal - Terminal - Terminal -Termina...
Status:
RESOLVED: MOVED
Product:
Xfce4-terminal
Component:
General

Comments

Description Pete Beardmore 2011-04-02 15:24:01 CEST
hi,

i don't run Debian but could i please point you to this bug which has irritated me for years?

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=575795

version 0.4.3, 0.4.5, 0.4.6 are versions i've tested recently which exhibit this bug. the old (also buggy but bearable) behaviour in 0.2.6 was that from title 'Untitled' ..the first vim enter and exit resulted in 'Terminal' ..the next 'Terminal - Terminal' ..but that was as far as it went.

a vim build with the '--with-x' flag is required to trigger this bug. without this flag there is no such issue (and stock builds don't seem to use it now despite the fact it's the only way to enable copying to the registers that point to the X11 clipboard). 'vim --version | grep xterm_clipboard' will tell you whether the flag was used in your build or not (+xterm_clipboard as opposed to -xterm_clipboard).

i assume that the OP of the bug had too many moving parts (using a system that has dependency tracking) and possibly updated vim to a version built with 'without-x' at the same time as moving to 0.4.5, thus the move to 0.4.5 looked like it had fixed the problem when in fact it hadn't.

the reason i've assumed that this bug is 'Terminal' and not 'VIm' related is that tab title interaction with VIm works fine elsewhere (i.e konsole).

cheers,
Pete.
Comment 1 Pete Beardmore 2011-04-23 14:42:54 CEST
Created attachment 3634 
screenshot
Comment 2 Landry Breuil editbugs 2014-12-01 11:23:47 CET
Issue still present in terminal 0.6.3 - as a workaround you can set 'dynamically set title' to 'replaces initial title', but the root issue should still be fixed.
Comment 3 Landry Breuil editbugs 2014-12-01 11:35:03 CET
This doesnt seem to depend on the shell behaviour as this is on OpenBSD, and with zsh or ksh. Maybe a dumb sprintf somewhere, or vim doing something funky with the existing term title ?
Comment 4 Landry Breuil editbugs 2014-12-01 12:02:57 CET
The issue seems to be in xfce4-terminal and not in vte, because with sakura (another vte term) running and exiting vim doesnt multiply the title prefix/suffix.

Interestingly it seems sakura and xfce4-terminal share the vte settings, since setting the prefix/dynamic title position in xfce4-terminal also sets the behaviour for sakura (which uses vte3).
Comment 5 Thaddaeus Tintenfisch editbugs 2015-03-30 11:10:37 CEST
*** Bug 9337 has been marked as a duplicate of this bug. ***
Comment 6 Landry Breuil editbugs 2016-11-01 19:08:32 CET
Looking at the code, the string handling/appending/prepending is done here: https://git.xfce.org/apps/xfce4-terminal/tree/terminal/terminal-screen.c#n1828. Will dig with some debug
Comment 7 Landry Breuil editbugs 2016-11-01 19:15:59 CET
So, after having opened a file in vim, vte_title has the previous "full" value of the title.
with this:

@@ -1823,6 +1823,8 @@ terminal_screen_get_title (TerminalScreen *screen)
                 "title-initial", &tmp,
                 NULL);
   initial = terminal_screen_parse_title (screen, tmp);
+  g_warning ("Initial is %s, vte_title is %s", initial, vte_title);
+
   g_free (tmp);


initial status:

(xfce4-terminal:98566): xfce4-terminal-WARNING **: Initial is Terminal, vte_title is (null)

after the shell is open, first title is set:

(xfce4-terminal:98566): xfce4-terminal-WARNING **: Initial is Terminal, vte_title is landry@spud (ttyp3) - /home/landry/src/xfce/xfce4-terminal

open file in vim, the title is set to whatever vim sets :
(xfce4-terminal:98566): xfce4-terminal-WARNING **: Initial is Terminal, vte_title is Makefile (~/src/xfce/xfce4-terminal) - VIM

exit vim, vte_title gets the *full* previous value :

(xfce4-terminal:98566): xfce4-terminal-WARNING **: Initial is Terminal, vte_title is Terminal - landry@spud (ttyp3) - /home/landry/src/xfce/xfce4-terminal


Igor, any idea ?
Comment 8 Igor editbugs 2016-11-01 19:36:30 CET
Landry, I'm seeing different behavior.
After exiting vim, vte_title is indeed "full" but it immediately changes to the value that it had before running vim. I.e.:

initial="Terminal", vte_title="igor@ziv:~/xfce4-terminal3"            <-- started
initial="Terminal", vte_title="NEWS (~/xfce4-terminal3) - VIM"        <-- run vim
initial="Terminal", vte_title="Terminal - igor@ziv:~/xfce4-terminal3" <-- exit vim
initial="Terminal", vte_title="igor@ziv:~/xfce4-terminal3"            <-- immediate change

What is your vte version? Mine here is 0.46.0+5+g398a3f8.
Comment 9 Landry Breuil editbugs 2016-11-01 21:47:35 CET
vte3-0.44.2 (last stable, 0.46 isnt released) here. Interesting... here, after exiting vim, the title isnt immediately changed. Would be interesting to find out what triggers that other terminal_screen_get_title() call.
Comment 10 Landry Breuil editbugs 2016-11-01 22:08:07 CET
Same behaviour with 0.46.0, which i saw was released.
Comment 11 Landry Breuil editbugs 2016-11-01 22:16:26 CET
Or it might have something to do with the shell. Running openbsd's ksh here, if i switch to bash in the term (ie start bash from ksh), the title isnt changed at all.
Comment 12 Landry Breuil editbugs 2016-11-01 22:25:16 CET
Ok, that definitely seems to be related to something configured in my shell. With bash, or ksh with a default/empty config, i cant reproduce the 'broken' behaviour.
Comment 13 poma 2016-11-02 09:32:36 CET
With:

$ bash --version | head -1
GNU bash, version 4.3.42(1)-release (x86_64-redhat-linux-gnu)
$ xfce4-terminal --version | head -1
xfce4-terminal 0.8.1git-20161031git3cc680d (Xfce 4.12)
$ vim --version | head -1
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun  2 2016 10:02:17)

it works as expected.
Comment 14 Igor editbugs 2016-11-02 09:51:09 CET
(In reply to Landry Breuil from comment #12)
> Ok, that definitely seems to be related to something configured in my shell.
> With bash, or ksh with a default/empty config, i cant reproduce the 'broken'
> behaviour.

AFAIK, vte is using $PROMPT_COMMAND for the terminal title; and it's setting its value from /etc/profile.d/vte.sh (on Arch).
So, if your shell config modify $PROMPT_COMMAND, it may affect the title.
Comment 15 Landry Breuil editbugs 2016-11-02 10:19:18 CET
$PROMPT_COMMAND is a bash thing.

On OpenBSD's ksh, title is set by that kind of printf voodoo with escape codes:

                ILS='\033]1;'; ILE='\007'
                WLS='\033]2;'; WLE='\007'
                function ilabel { print -n "${ILS}$*${ILE}">/dev/tty; }
                function label { print -n "${WLS}$*${WLE}">/dev/tty; }

                alias stripe='label "$USER@$HOST ($tty) - $PWD"'
                alias istripe='ilabel "$USER@$HOST ($tty)"'

and stripe is called at the shell startup (i think)
Comment 16 Igor editbugs 2016-11-02 10:49:25 CET
Landry, can you also check gnome-terminal under OpenBSD? If you'll see the same behavior as for xfce4-terminal, then it's most probably a vte-on-BSD thing.
Comment 17 Jason 2017-01-30 03:03:04 CET
I see this problem on Xubuntu 16.04 when PS1 is set a particular way.

When PS1 is setup by the default skeleton bashrc code, I don't see the problem.

bash-4.3$ echo $PS1
\[\e]0;\u@\h: \w\a\]\s-\v\$

When PS1 is left at it's default setting, I get the "Terminal - Terminal" growing title problem.

bash-4.3$ echo $PS1
\s-\v\$

My versions:

bash-4.3$ bash --version | head -1
GNU bash, version 4.3.46(1)-release (x86_64-pc-linux-gnu)
bash-4.3$ xfce4-terminal --version | head -1
xfce4-terminal 0.6.3 (Xfce 4.12)
bash-4.3$ vim --version | head -1
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:44:48)

Cheers,
Jason
Comment 18 Igor editbugs 2017-01-30 15:12:45 CET
(In reply to Jason from comment #17)
> I see this problem on Xubuntu 16.04 when PS1 is set a particular way.
> 
> When PS1 is setup by the default skeleton bashrc code, I don't see the
> problem.
> 
> bash-4.3$ echo $PS1
> \[\e]0;\u@\h: \w\a\]\s-\v\$
> 
> When PS1 is left at it's default setting, I get the "Terminal - Terminal"
> growing title problem.
> 
> bash-4.3$ echo $PS1
> \s-\v\$
> 
> My versions:
> 
> bash-4.3$ bash --version | head -1
> GNU bash, version 4.3.46(1)-release (x86_64-pc-linux-gnu)
> bash-4.3$ xfce4-terminal --version | head -1
> xfce4-terminal 0.6.3 (Xfce 4.12)
> bash-4.3$ vim --version | head -1
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:44:48)

Jason, thanks for the update.
However, I cannot reproduce it with your $PS1 on 0.8.3. Can you try xfce4-terminal 0.8.3 on your system?
Comment 19 Frédéric Brière 2017-02-19 20:40:30 CET
(In reply to Igor from comment #18)
> Can you try xfce4-terminal 0.8.3 on your system?

I'm seeing the same behavior with 0.8.4 and vte 0.46.1 (Debian sid/amd64).  Of course, this requires making sure that the shell doesn't reset the title on its own (mucking with $PS1 in bash's case).
Comment 20 Igor editbugs 2017-02-21 07:45:36 CET
(In reply to Frédéric Brière from comment #19)
> (In reply to Igor from comment #18)
> > Can you try xfce4-terminal 0.8.3 on your system?
> 
> I'm seeing the same behavior with 0.8.4 and vte 0.46.1 (Debian sid/amd64). 
> Of course, this requires making sure that the shell doesn't reset the title
> on its own (mucking with $PS1 in bash's case).

Could you give an example of mucked $PS1?
Comment 21 Frédéric Brière 2017-02-21 16:54:12 CET
(In reply to Igor from comment #20)
> Could you give an example of mucked $PS1?

PS1='$ ' should do just fine.  :)
Comment 22 Git Bot editbugs 2020-05-24 23:40:06 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/apps/xfce4-terminal/-/issues/2.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #7460

Reported by:
Pete Beardmore
Reported on: 2011-04-02
Last modified on: 2020-05-24
Duplicates (1):
  • 9337 Opening and exiting Vim multiple times sets terminal title to "Terminal - Terminal - Terminal..."

People

CC List:
8 users

Version

Version:
unspecified

Attachments

screenshot (21.46 KB, image/png)
2011-04-23 14:42 CEST , Pete Beardmore
no flags

Additional information