Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #240163 > unrolled thread
| Started by | Greg Wooledge <greg@wooledge.org> |
|---|---|
| First post | 2021-09-19 19:10 +0200 |
| Last post | 2021-09-19 21:00 +0200 |
| Articles | 4 — 3 participants |
Back to article view | Back to linux.debian.user
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: A bug in Vim, in Mate Terminal or in Debian 11? Greg Wooledge <greg@wooledge.org> - 2021-09-19 19:10 +0200
Re: A bug in Vim, in Mate Terminal or in Debian 11? Dedeco Balaco <dedeco.balaco@yahoo.com> - 2021-09-19 19:30 +0200
Re: A bug in Vim, in Mate Terminal or in Debian 11? Greg Wooledge <greg@wooledge.org> - 2021-09-19 19:40 +0200
Re: A bug in Vim, in Mate Terminal or in Debian 11? Nate Bargmann <n0nb@n0nb.us> - 2021-09-19 21:00 +0200
| From | Greg Wooledge <greg@wooledge.org> |
|---|---|
| Date | 2021-09-19 19:10 +0200 |
| Subject | Re: A bug in Vim, in Mate Terminal or in Debian 11? |
| Message-ID | <CZ8ue-1qF-17@gated-at.bofh.it> |
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.)
[toc] | [next] | [standalone]
| From | Dedeco Balaco <dedeco.balaco@yahoo.com> |
|---|---|
| Date | 2021-09-19 19:30 +0200 |
| Message-ID | <CZ8NA-1wW-11@gated-at.bofh.it> |
| In reply to | #240163 |
Em 19/09/2021 14:07, Greg Wooledge escreveu:
> 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.)
>
I do not understand you. I have said my prompt is (and always were)
fancy. Then, you say that this might be the cause of the problem - BUT,
as a possible try to solve, you tell me to make another fancy prompt.
And do not forget one thing: the tabs' titles are working almost as they
were before. With vim, sometimes, it does not reset when vim exits, as
it always did, since around 20 years ago.
I check all lines in /etc/skel/.bashrc. It does not show me anything
new. My prompt contains only things that it has, and sometimes different
(skel does not use as many colors as i do, for PS1).
[toc] | [prev] | [next] | [standalone]
| From | Greg Wooledge <greg@wooledge.org> |
|---|---|
| Date | 2021-09-19 19:40 +0200 |
| Message-ID | <CZ8Xf-1A5-1@gated-at.bofh.it> |
| In reply to | #240164 |
On Sun, Sep 19, 2021 at 02:25:25PM -0300, Dedeco Balaco wrote: > Em 19/09/2021 14:07, Greg Wooledge escreveu: > > 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. > I do not understand you. I have said my prompt is (and always were) > fancy. Then, you say that this might be the cause of the problem - BUT, > as a possible try to solve, you tell me to make another fancy prompt. > > And do not forget one thing: the tabs' titles are working almost as they > were before. With vim, sometimes, it does not reset when vim exits, as > it always did, since around 20 years ago. > > I check all lines in /etc/skel/.bashrc. It does not show me anything > new. My prompt contains only things that it has, and sometimes different > (skel does not use as many colors as i do, for PS1). You customized your .bashrc and changed your prompt (the PS1 variable) yourself. That's fine. You're absolutely allowed to do that (I do it too). If you want the terminal title to be set to a useful value when vim exits, then the most obvious way to do it is to change PS1 as I said in the previous message. You could copy the code that Debian uses, or you could write your own additional code. I'm trying to give you the *simplest* answer that will work. Copying a small chunk of code from Debian's /etc/skel/.bashrc file to your ~/.bashrc file is the simplest answer. But you also seem to be determined to find out how it used to work in stretch. I don't know how it worked in stretch. I don't use mate-terminal, or Mate, or even a desktop environment. So I can't help you figure out how it worked before. All I can help you with is making it work *now*.
[toc] | [prev] | [next] | [standalone]
| From | Nate Bargmann <n0nb@n0nb.us> |
|---|---|
| Date | 2021-09-19 21:00 +0200 |
| Message-ID | <CZacG-2iW-5@gated-at.bofh.it> |
| In reply to | #240164 |
[Multipart message — attachments visible in raw view] — view raw
* On 2021 19 Sep 12:26 -0500, Dedeco Balaco wrote:
>
>
> Em 19/09/2021 14:07, Greg Wooledge escreveu:
> > 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.)
> >
>
> I do not understand you. I have said my prompt is (and always were)
> fancy. Then, you say that this might be the cause of the problem - BUT,
> as a possible try to solve, you tell me to make another fancy prompt.
This is not "another fancy prompt", it is code to set the terminal title
and does not affect nor replace your prompt as it adds code that is not
displayed in the prompt to the PS1 variable. Any user setting of PS1 is
undisturbed as shown by the $PS1 at the end.
> And do not forget one thing: the tabs' titles are working almost as they
> were before. With vim, sometimes, it does not reset when vim exits, as
> it always did, since around 20 years ago.
I've not used Vim as a main editor until very recently, right about the
time that Bullseye was released. I don't see Vim changing the tab
titles though I do see Midnight Commander changing them as the directory
and/or panels are switched.
> I check all lines in /etc/skel/.bashrc. It does not show me anything
> new. My prompt contains only things that it has, and sometimes different
> (skel does not use as many colors as i do, for PS1).
My PS1 is very complex (I posted its code here a few weeks back), yet
the path when I cd to a directory is reflected in the tab title (gnome
terminal) as is whatever mc sets it to.
As I cannot say whether Vim formerly set tab titles, I must stop here.
- Nate
--
"The optimist proclaims that we live in the best of all
possible worlds. The pessimist fears this is true."
Web: https://www.n0nb.us
Projects: https://github.com/N0NB
GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.user
csiph-web