[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: A bug in Vim, in Mate Terminal or in Debian 11?



On Sun, Sep 19, 2021 at 03:06:28PM -0300, Dedeco Balaco wrote:
> 
> 
> Em 19/09/2021 14:41, tomas@tuxteam.de escreveu:
> > On Sun, Sep 19, 2021 at 01:58:16PM -0300, Dedeco Balaco wrote:
> >>
> >>
> >>>   tomas@trotzki:~$ echo $PS1
> >>>   \[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$
> >>>
> >>
> >> There has been a lot of time that i use a fancy PS1. But it does not
> >> touch the terminal title, it never did. I just worked in it to get a
> >> satisfying informative prompt.
> > 
> > Interesting. In my box it seems to be PS1 what is setting the
> > term title...
> > 
> 
> That is because you use a <something> enclosed between "\e]0;" and "\]",
> and i never wanted to do it. Notice that, in the PS1 value you gave
> above, you have "\u@\h: \w\a\" written twice. This is because one (the
> first) is to set the title, and another (the second) is to set the prompt.

I know, I know (after all, I analysed that in another mail). I was
just trying to reverse-engineer how things are working (by default)
on my Debian box.

In any case, here it's not vim cleaning up its title after itself,
but rather the shell's PS1 restoring it at the next prompt after
vim.

I just hoped this data point might help you pin-pointing your
problem (BTW: vim could only restore the term's title if there
were... an escape sequence to either query the title or tell the
term to save/restore it.

As to how to get xterm's [1] window title, I think you might
have to fool around with xprop. Here [2] is some example code.

Have fun :)

[1] I'm always talking xterm. I guess that this parts are
   pretty similar (if not identical) to other X based terminal
   emulators.

[2] http://www.shelldorado.com/scripts/cmds/xtitle

 - tomás

Attachment: signature.asc
Description: Digital signature


Reply to: