• Titles in lxterminal

    From bp@3:633/10 to All on Thu Feb 19 11:00:01 2026
    From time to time I get badly confused about which terminal window does what. This is on a Pi5 running bookworm, if it matters.

    One thing that would help is causing each lxterminl window or tab to display the name of the command being run. In most cases that would be an ssh command and hostname.

    Obviously, this can be done manually by using the Tabs > Name Tab menuu,
    but it seems likely there'd be a setting in .config/lxterminal/lxterminal.conf which I'm unable to intuit.

    Does anyone know if this is true, and if so what syntax is required?

    Thanks for reading,

    bob prohaska


    --- PyGate Linux v1.5.11
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Jim Jackson@3:633/10 to All on Thu Feb 19 11:30:01 2026
    On 2026-02-18, bp@www.zefox.net <bp@www.zefox.net> wrote:
    From time to time I get badly confused about which terminal window does what. This is on a Pi5 running bookworm, if it matters.

    One thing that would help is causing each lxterminl window or tab to display the name of the command being run. In most cases that would be an ssh command and hostname.

    Obviously, this can be done manually by using the Tabs > Name Tab menuu,
    but it seems likely there'd be a setting in .config/lxterminal/lxterminal.conf
    which I'm unable to intuit.

    Does anyone know if this is true, and if so what syntax is required?

    Thanks for reading,

    bob prohaska


    You need to write the string ESC]0;Title^G to the terminal.

    I have this in a little script called xtn which does this.

    To generate ESC in bash use ^V^[ where '^' is holding down the control key. ^G is done like wise. You will have to wrap the strings in quotes

    e.g. echo -n "^[]0;"$1"^G"

    good luck. I've just done this in LXTerminal with bash as my shell.

    --- PyGate Linux v1.5.11
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Theo@3:633/10 to All on Thu Feb 19 00:43:23 2026
    bp@www.zefox.net wrote:
    From time to time I get badly confused about which terminal window does what. This is on a Pi5 running bookworm, if it matters.

    One thing that would help is causing each lxterminl window or tab to display the name of the command being run. In most cases that would be an ssh command and hostname.

    Obviously, this can be done manually by using the Tabs > Name Tab menuu,
    but it seems likely there'd be a setting in .config/lxterminal/lxterminal.conf
    which I'm unable to intuit.

    Does anyone know if this is true, and if so what syntax is required?

    Does this set the window title:

    $ export TITLE="hello world"
    $ echo -en "\e]30;$TITLE\a"

    bash should set the window title to the current command, using the same
    escape sequence. If it doesn't:

    a) you aren't using bash. Maybe it needs to be enabled in your shell?

    b) bash is not configured to set the title, I'm not sure where you'd find
    that

    c) your terminal is not advertising itself as a suitable type that uses the escape code. What's your TERM variable set to?

    d) your terminal is choosing not to display it, for some reason (perhaps
    the configuration you mention above)

    Theo

    --- PyGate Linux v1.5.11
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From bp@3:633/10 to All on Thu Feb 19 17:00:02 2026
    Jim Jackson <jj@franjam.org.uk> wrote:
    On 2026-02-18, bp@www.zefox.net <bp@www.zefox.net> wrote:
    From time to time I get badly confused about which terminal window does what.
    This is on a Pi5 running bookworm, if it matters.

    One thing that would help is causing each lxterminl window or tab to display >> the name of the command being run. In most cases that would be an ssh command
    and hostname.

    Obviously, this can be done manually by using the Tabs > Name Tab menuu,
    but it seems likely there'd be a setting in .config/lxterminal/lxterminal.conf
    which I'm unable to intuit.

    Does anyone know if this is true, and if so what syntax is required?

    Thanks for reading,

    bob prohaska


    You need to write the string ESC]0;Title^G to the terminal.

    I have this in a little script called xtn which does this.

    To generate ESC in bash use ^V^[ where '^' is holding down the control key. ^G is done like wise. You will have to wrap the strings in quotes

    e.g. echo -n "^[]0;"$1"^G"

    good luck. I've just done this in LXTerminal with bash as my shell.

    It doesn't seem to do much of anything in my case. Here's a transcript: bob@raspberrypi:~$ echo $TERM
    xterm-256color
    bob@raspberrypi:~$ echo -n "^[]0;"$1"^G"
    ^[]0;^Gbob@raspberrypi:~$
    bob@raspberrypi:~$

    I was hoping to see the title change, but no luck. As you might
    guess, my fluency with shells is abysmal. I use them only in a
    very simple-minded way, usually to type single commands.

    Thanks for writing!

    bob prohaska



    --- PyGate Linux v1.5.11
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From bp@3:633/10 to All on Fri Feb 20 11:00:01 2026
    Richard Harnden <richard.nospam@gmail.invalid> wrote:
    On 19/02/2026 03:47, bp@www.zefox.net wrote:
    Theo <theom+news@chiark.greenend.org.uk> wrote:
    bp@www.zefox.net wrote:
    From time to time I get badly confused about which terminal window does what.
    This is on a Pi5 running bookworm, if it matters.

    One thing that would help is causing each lxterminl window or tab to display
    the name of the command being run. In most cases that would be an ssh command
    and hostname.

    Obviously, this can be done manually by using the Tabs > Name Tab menuu, >>>> but it seems likely there'd be a setting in .config/lxterminal/lxterminal.conf
    which I'm unable to intuit.

    Does anyone know if this is true, and if so what syntax is required?

    Does this set the window title:

    $ export TITLE="hello world"
    $ echo -en "\e]30;$TITLE\a"

    No. Neither does it trigger an error message....

    bash should set the window title to the current command, using the same
    escape sequence. If it doesn't:

    a) you aren't using bash. Maybe it needs to be enabled in your shell?

    According to /etc/passwd, bash is my login shell, running
    bob@raspberrypi:~$ echo $TERM
    xterm-256color

    suggests that lxterm is a variant of xterm, which makes sense.



    b) bash is not configured to set the title, I'm not sure where you'd find >>> that

    c) your terminal is not advertising itself as a suitable type that uses the >>> escape code. What's your TERM variable set to?


    As above, xterm-256color

    d) your terminal is choosing not to display it, for some reason (perhaps >>> the configuration you mention above)

    The configuration file at ~/.config/lxterminal/lxterminal.conf contains
    quite a few entries, but none appears to be related to titles. The man
    page for lxterminal doesn't give any useful hints. The config file
    appears to be name=value format, Shift-ctrl-I brings up the dialog
    to manually enter a title which is interpreted as a simple string.



    Does

    echo -en "\033]0;Hello World\007"

    work?

    No, it doesn't do anything visible:

    bob@raspberrypi:~$ echo -en "\033]0;Hello World\007"
    bob@raspberrypi:~$

    so no output beyond the echoed input and no change in
    the tab title. I rather wonder where the command output
    went, since no error was reported.

    If I'm missing something idiotic please point it out!

    Thanks for writing,

    bob prohaska


    --- PyGate Linux v1.5.11
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Gordon Henderson@3:633/10 to All on Fri Feb 20 11:00:01 2026
    In article <10n7fpe$3lun8$2@dont-email.me>, <bp@www.zefox.net> wrote:
    Gordon Henderson <gordon+usenet@drogon.net> wrote:
    In article <10n560g$2u42e$1@dont-email.me>, <bp@www.zefox.net> wrote: >>>From time to time I get badly confused about which terminal window does what.
    This is on a Pi5 running bookworm, if it matters.

    This is on "generic Linux" if it matters:

    In ~/bin I have an executable script:

    #!/bin/sh

    if [ "x$*" = x ]; then
    echo -n "\033];`hostname`\007"
    else
    echo -n "\033];$*\007"
    fi

    I call it 'xtt' (xterm title - works in xterm and other terminals I use)
    You make it yours and call it what you like.

    So xtt on it's own resets the title to your hostname (handy if you login
    to many systems) othrwise it sets the title to whatever you put on the
    command line

    xtt silly editing session

    for example

    Your challenge is to make it work automatically for every command
    you type.. (I don't need that functionality, I use it inside other
    scripts that start stuff)

    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...

    I'm working with only one RasPiOS workstation client and several
    FreeBSD servers. I'd rather customize the workstation than the
    servers, if that's possible.

    Well... `hostname` returns the name of the host the script is running
    on.

    One way I use it is in scripts that ssh to remote systems, so rather
    than type ssh frotz, I type 'frotz' which is a script in my ~/bin
    directory and that script looks like:

    #!/bin/sh
    xtt '-> Frotz'
    ssh gordon@frotz.drogon.net $*
    xtt

    This sets the title of the xterm I'm typing into to '-> Frotz' then
    runs the ssh to the server...

    When the ssh exits (ie. I logout of Frotz), the xtt command with no
    arguments resets the terminal title bar to that on whatever host I typed
    the command at. (either my desktop or laptop)

    Gordon

    --- PyGate Linux v1.5.11
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Theo@3:633/10 to All on Thu Feb 19 22:55:11 2026
    Gordon Henderson <gordon+usenet@drogon.net> wrote:
    In article <10n7fpe$3lun8$2@dont-email.me>, <bp@www.zefox.net> 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)
  • From Jim Jackson@3:633/10 to All on Fri Feb 20 11:00:01 2026
    On 2026-02-19, bp@www.zefox.net <bp@www.zefox.net> wrote:
    Jim Jackson <jj@franjam.org.uk> wrote:
    On 2026-02-18, bp@www.zefox.net <bp@www.zefox.net> wrote:
    From time to time I get badly confused about which terminal window does what.
    This is on a Pi5 running bookworm, if it matters.

    One thing that would help is causing each lxterminl window or tab to display
    the name of the command being run. In most cases that would be an ssh command
    and hostname.

    Obviously, this can be done manually by using the Tabs > Name Tab menuu, >>> but it seems likely there'd be a setting in .config/lxterminal/lxterminal.conf
    which I'm unable to intuit.

    Does anyone know if this is true, and if so what syntax is required?

    Thanks for reading,

    bob prohaska


    You need to write the string ESC]0;Title^G to the terminal.

    I have this in a little script called xtn which does this.

    To generate ESC in bash use ^V^[ where '^' is holding down the control key.
    ^G is done like wise. You will have to wrap the strings in quotes

    e.g. echo -n "^[]0;"$1"^G"

    good luck. I've just done this in LXTerminal with bash as my shell.

    It doesn't seem to do much of anything in my case. Here's a transcript: bob@raspberrypi:~$ echo $TERM
    xterm-256color
    bob@raspberrypi:~$ echo -n "^[]0;"$1"^G"
    ^[]0;^Gbob@raspberrypi:~$
    bob@raspberrypi:~$

    Did you type '^' then '['? Instead you should type ctl-V Ctl-[
    and the same for for the other control character.

    It worked for me in lxterminal and the $TERM was identical to yours.


    I was hoping to see the title change, but no luck. As you might
    guess, my fluency with shells is abysmal. I use them only in a
    very simple-minded way, usually to type single commands.

    Thanks for writing!

    bob prohaska



    --- PyGate Linux v1.5.11
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Richard Harnden@3:633/10 to All on Thu Feb 19 16:01:33 2026
    On 19/02/2026 03:47, bp@www.zefox.net wrote:
    Theo <theom+news@chiark.greenend.org.uk> wrote:
    bp@www.zefox.net wrote:
    From time to time I get badly confused about which terminal window does what.
    This is on a Pi5 running bookworm, if it matters.

    One thing that would help is causing each lxterminl window or tab to display
    the name of the command being run. In most cases that would be an ssh command
    and hostname.

    Obviously, this can be done manually by using the Tabs > Name Tab menuu, >>> but it seems likely there'd be a setting in .config/lxterminal/lxterminal.conf
    which I'm unable to intuit.

    Does anyone know if this is true, and if so what syntax is required?

    Does this set the window title:

    $ export TITLE="hello world"
    $ echo -en "\e]30;$TITLE\a"

    No. Neither does it trigger an error message....

    bash should set the window title to the current command, using the same
    escape sequence. If it doesn't:

    a) you aren't using bash. Maybe it needs to be enabled in your shell?

    According to /etc/passwd, bash is my login shell, running
    bob@raspberrypi:~$ echo $TERM
    xterm-256color

    suggests that lxterm is a variant of xterm, which makes sense.



    b) bash is not configured to set the title, I'm not sure where you'd find
    that

    c) your terminal is not advertising itself as a suitable type that uses the >> escape code. What's your TERM variable set to?


    As above, xterm-256color

    d) your terminal is choosing not to display it, for some reason (perhaps
    the configuration you mention above)

    The configuration file at ~/.config/lxterminal/lxterminal.conf contains
    quite a few entries, but none appears to be related to titles. The man
    page for lxterminal doesn't give any useful hints. The config file
    appears to be name=value format, Shift-ctrl-I brings up the dialog
    to manually enter a title which is interpreted as a simple string.



    Does

    echo -en "\033]0;Hello World\007"

    work?

    --- PyGate Linux v1.5.11
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Richard Harnden@3:633/10 to All on Thu Feb 19 17:52:19 2026
    On 19/02/2026 16:54, bp@www.zefox.net wrote:
    Richard Harnden <richard.nospam@gmail.invalid> wrote:


    Does

    echo -en "\033]0;Hello World\007"

    work?

    No, it doesn't do anything visible:

    bob@raspberrypi:~$ echo -en "\033]0;Hello World\007"
    bob@raspberrypi:~$

    so no output beyond the echoed input and no change in
    the tab title. I rather wonder where the command output
    went, since no error was reported.

    If I'm missing something idiotic please point it out!


    Does your PS1 keep overwritting the window title?
    Does the window title change if you, say, change directory?



    --- PyGate Linux v1.5.11
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Jim Diamond@3:633/10 to All on Sat Feb 21 07:30:01 2026
    On 2026-02-18 at 20:43 AST, Theo <theom+news@chiark.greenend.org.uk> wrote:
    bp@www.zefox.net wrote:
    From time to time I get badly confused about which terminal window does what.
    This is on a Pi5 running bookworm, if it matters.

    One thing that would help is causing each lxterminl window or tab to display >> the name of the command being run. In most cases that would be an ssh command
    and hostname.

    Obviously, this can be done manually by using the Tabs > Name Tab menuu,
    but it seems likely there'd be a setting in .config/lxterminal/lxterminal.conf
    which I'm unable to intuit.

    Does anyone know if this is true, and if so what syntax is required?

    Does this set the window title:

    $ export TITLE="hello world"
    $ echo -en "\e]30;$TITLE\a"

    I realize that the conversation has moved on, but for anyone coming in late...

    There is a '3' in the above line which should not be there.

    Try
    $ echo -en "\e]0;$TITLE\a"

    Jim

    --- PyGate Linux v1.5.11
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Theo@3:633/10 to All on Fri Feb 20 20:49:28 2026
    Jim Diamond <zsd@jdvb.ca> wrote:
    On 2026-02-18 at 20:43 AST, Theo <theom+news@chiark.greenend.org.uk> wrote:
    bp@www.zefox.net wrote:
    From time to time I get badly confused about which terminal window does what.
    This is on a Pi5 running bookworm, if it matters.

    One thing that would help is causing each lxterminl window or tab to display
    the name of the command being run. In most cases that would be an ssh command
    and hostname.

    Obviously, this can be done manually by using the Tabs > Name Tab menuu, >> but it seems likely there'd be a setting in .config/lxterminal/lxterminal.conf
    which I'm unable to intuit.

    Does anyone know if this is true, and if so what syntax is required?

    Does this set the window title:

    $ export TITLE="hello world"
    $ echo -en "\e]30;$TITLE\a"

    I realize that the conversation has moved on, but for anyone coming in late...

    There is a '3' in the above line which should not be there.

    Try
    $ echo -en "\e]0;$TITLE\a"

    They both work for me (in Konsole). According to:
    $ zless /usr/share/doc/xterm/ctlseqs.txt.gz

    Code | Sun | CDE | XTerm | Description
    OSC 0 ST | - | yes | yes | set window and icon title
    OSC 1 ST | - | yes | yes | set icon label
    OSC 2 ST | - | yes | yes | set window title
    OSC 3 ST | - | n/a | yes | set X server property


    where OSC ('operating system command') is 'ESC ]' in 7-bit mode (0x9b in
    8-bit mode) and ST ('sequence terminator') is 'ESC \' or 0x9c. So it looks like the first 3 is overridden by the second 0 as there's no OSC 3 0 ST
    command listed.

    Theo

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