BBS:      TELESC.NET.BR
Assunto:  Re: Titles in lxterminal
De:       Theo
Data:     Thu, 19 Feb 2026 22:55:11 +0000
-----------------------------------------------------------
Gordon Henderson  wrote:
> In article <10n7fpe$3lun8$2@dont-email.me>,   wrote:
> >This suggestion might touch on a fundamental issue: Which host,
> >the ssh client or the ssh server, gets to set the window or tab
> >title on the client machine running RasPiOS? I've been thinking
> >it's the RasPiOS machine displaying the window or tab. If I'm
> >understanding you correctly it's the server end of the connection.
> >Is that correct?
> 
> It's whatever you want it to be. In my case it's the client - which to
> avoid ambiguity is the system I type the ssh command on...

To expand on that, all this \033]; stuff are 'terminal escape sequences'. 
They cause the app which is displaying the data stream from your terminal to
set the 'window title', whatever that means in its context (typically the
tab title in a tabbed terminal window), to the string embedded in the escape
sequence.

Because they're just bytes, they can be passed over an SSH connection just
like any other bytes (letters, text colour-changes, cursor movements, etc). 
It's then up to the receiver (the terminal app) to interpret them.

The other piece of the puzzle is that your terminal needs to be configured
for the same 'terminal escape sequence' language. There are many kinds of
terminals which speak different languages, described in /etc/termcap and
related files.

You (Bob) have TERM set to 'xterm-256color' which means that it's expecting
terminal messages in that language.  It sounds the right one to interpret
them: xterm is an X11 app where the concept of 'window title' makes sense -
older terminal types like 'vt100' probably don't understand them (VT100s just
had a keyboard and CRT screen - no windowing system).


Anyhow, I installed lxterminal (on Ubuntu 25.10) and I found I had the same
problem.  However this:

echo -e "\033]0;Hello\007" && sleep 3

does set the terminal title for 3 seconds and then it reverts to the
standard.  Which suggests it's the prompt that's setting it back. 

$ echo $PS1
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$

and if I drop the first part:

export PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$"

I can now set the terminal title in peace:

echo -ne "\033]0;Moo\007"

Theo

--- PyGate Linux v1.5.11
 * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)

-----------------------------------------------------------
[Voltar]