[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 01:54:48PM -0300, Dedeco Balaco wrote:
> > Once we know what $TERM is, we can advise.
> > 
> 
> $  echo $TERM
> xterm-256color

Huh... OK.


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.

Oh, are you saying that you're not using Debian's default PS1?  That's
probably why it's no longer working the way you expected.

If you'd like to return to the previous behavior, you'll want to add
something like what Debian has in /etc/skel/.bashrc to your own .bashrc
file.

Since your TERM variable begins with "xterm", you can simply copy the
case command directly from the Debian .bashrc file into yours:


# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac


Put that chunk of code anywhere in your .bashrc after your PS1 assignment,
and it will add a prefix that sets the terminal's title.  You can alter
it to suit your own preferences.  Just make sure that whatever you add
is surrounded by \[ \] and contains one of the sequences for changing
the terminal title.  (There are three of them in xterm, depending on
whether you want to set the title, or the icon's name, or both.  Debian
is using the one that sets both.)


Reply to: