• 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 Thu Feb 19 17:00:02 2026
    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.

    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 Jackson@3:633/10 to All on Fri Feb 20 11:00:01 2026
    On 2026-02-19, Richard Harnden <richard.nospam@gmail.invalid> wrote:

    Does

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

    work?

    Bravo. The simplest solution - all "normal" characters.



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

    Gordon

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

    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.

    Thanks for writing!

    bob prohaska


    Gordon

    --- 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 Jim Diamond@3:633/10 to All on Sat Feb 21 07:30:01 2026
    On 2026-02-18 at 23:22 AST, 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:~$

    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.

    Bob,

    bp mentioned that he was using a script, and in his script $1 would be the first argument to the script.

    You were just typing that from the command line, where $1 is not what you want.

    As has been pointed out (and "bravo"ed), there are less error-prone ways to
    get the escape char out of the echo command, but assuming you know that to get
    ^[
    you want to type
    Ctrl-V Escape
    and that to get
    ^G
    you want to type
    Ctrl-V Ctrl-G
    then putting something useful in for $1 above might help:

    echo -n "^[]0;Hello There^G"

    Finally, if something in your default setup is resetting the tab/terminal
    title to something else every time before the prompt is printed, try

    echo -n "^[]0;Hello There^G" ; sleep 10

    and see if you see "Hello There" for 10 seconds (+/-) after you hit Enter.

    Cheers.
    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)
  • From bp@3:633/10 to All on Sun Feb 22 12:30:01 2026
    bp@www.zefox.net wrote:
    Richard Harnden <richard.nospam@gmail.invalid> wrote:
    On 19/02/2026 03:47, bp@www.zefox.net wrote:


    Does

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

    work?

    No, it doesn't do anything visible:

    Looks like I was mistaken. A simple copy and paste
    of the lineabove changes the tab title to Hello World.

    I'm not sure what's different now, it's the same Pi,
    just a newly-created tab.

    I'm also not sure I got the quotes right, apologies if things
    are now mis-attributed.

    It seems the remaining puzzle is how to replace the string
    Hello World with the name of the last-typed command...

    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 Mon Feb 23 10:26:56 2026
    On 22/02/2026 00:21, bp@www.zefox.net wrote:


    It seems the remaining puzzle is how to replace the string
    Hello World with the name of the last-typed command...


    I think this works ...

    ESC=$(echo -en "\033")
    BEL=$(echo -en "\007")

    export HISTFILE=~./bash_history$(tty | sed "s,/,_,g")

    export PS1='${ESC}]0;\
    $(fc -ln -1 |\
    tail -1 |\
    sed "s/^[[:space:]]*//g")${BEL}\
    ${LOGNAME}@${HOSTNAME}:${PWD/$HOME/\~} $ '







    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From bp@3:633/10 to All on Tue Feb 24 11:00:01 2026
    Richard Harnden <richard.nospam@gmail.invalid> wrote:
    On 22/02/2026 00:21, bp@www.zefox.net wrote:


    It seems the remaining puzzle is how to replace the string
    Hello World with the name of the last-typed command...


    I think this works ...

    ESC=$(echo -en "\033")
    BEL=$(echo -en "\007")

    export HISTFILE=~./bash_history$(tty | sed "s,/,_,g")

    export PS1='${ESC}]0;\
    $(fc -ln -1 |\
    tail -1 |\
    sed "s/^[[:space:]]*//g")${BEL}\
    ${LOGNAME}@${HOSTNAME}:${PWD/$HOME/\~} $ '

    I really owe everybody an apology here. I thought there'd
    be some trivial way to auto-title lxterminal windows so
    they could be easily distinguished. Clearly there isn't
    such a thing. The "name tab" option takes only a few seconds
    and is probably the most efficient way to keep folks like me
    from typing the wrong commands in the wrong window....

    Thanks for everybody's help and patience!


    bob prohaska


    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Thu Feb 26 10:00:01 2026
    On Wed, 25 Feb 2026 20:42:05 +0000, druck wrote:

    On 25/02/2026 19:45, Jim Jackson wrote:

    ??? Why a differnet desktop. Just a different terminal emulator -
    or are modern Term.

    Depends whether you want your desktop to be consistent, or have half
    a dozen different types of menus and window furniture on the apps
    that you use.

    Especially if you do this on the day your interior decorator comes to
    visit ...

    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Jim Jackson@3:633/10 to All on Thu Feb 26 10:00:01 2026
    On 2026-02-23, druck <news@druck.org.uk> wrote:
    On 23/02/2026 18:18, bp@www.zefox.net wrote:
    I really owe everybody an apology here. I thought there'd
    be some trivial way to auto-title lxterminal windows so
    they could be easily distinguished. Clearly there isn't
    such a thing. The "name tab" option takes only a few seconds
    and is probably the most efficient way to keep folks like me
    from typing the wrong commands in the wrong window....

    The problem is lxterminal is not as fully featured as the alternatives
    most people were probably using when they suggested the command
    sequences which work for them.

    You might want to consider an alternative desktop with a different
    terminal program, MATE is almost as light weight as Pixel and runs very nicely on Pi4s and Pi5s.

    ??? Why a differnet desktop. Just a different terminal emulator - or are modern Term. Emu's stupidly tied inextricably to a fixed set of other
    software that makes up a "desktop" whatever that is. I fired up
    lxterminal even though I'm not running lxde - it worked just fine. I've
    tried several others, all in my home made "desktop environment", they
    all worked.

    A term. emu. is just a program for creating a window for running command
    line programs in.


    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Jim Diamond@3:633/10 to All on Thu Feb 26 13:30:01 2026
    On 2026-02-20 at 16:49 AST, Theo <theom+news@chiark.greenend.org.uk> wrote:
    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,

    Huh. They don't work for me in urxvt.

    Of course, the question was about lxterminal. So maybe it didn't work for
    the OP because of the '3', and maybe for some other reason.

    Jim

    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Jim Jackson@3:633/10 to All on Sat Feb 28 11:30:01 2026
    On 2026-02-25, Lawrence D?Oliveiro <ldo@nz.invalid> wrote:
    On Wed, 25 Feb 2026 20:42:05 +0000, druck wrote:

    On 25/02/2026 19:45, Jim Jackson wrote:

    ??? Why a differnet desktop. Just a different terminal emulator -
    or are modern Term.

    Depends whether you want your desktop to be consistent, or have half
    a dozen different types of menus and window furniture on the apps
    that you use.

    Especially if you do this on the day your interior decorator comes to
    visit ...

    My interior decorator lives in the same house :-)

    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Jim Jackson@3:633/10 to All on Sat Feb 28 11:30:01 2026
    On 2026-02-25, druck <news@druck.org.uk> wrote:
    On 25/02/2026 19:45, Jim Jackson wrote:
    On 2026-02-23, druck <news@druck.org.uk> wrote:
    On 23/02/2026 18:18, bp@www.zefox.net wrote:
    You might want to consider an alternative desktop with a different
    terminal program, MATE is almost as light weight as Pixel and runs very
    nicely on Pi4s and Pi5s.

    ??? Why a differnet desktop. Just a different terminal emulator - or are
    modern Term.
    Depends whether you want your desktop to be consistent, or have half a
    dozen different types of menus and window furniture on the apps that you use.


    I thought your window manager dealt with window furniture.

    So which desktop environments are Firefox, GIMP, libreoffice etc etc
    meant to work with then? On my debian derived system, no matter what
    desktop system I'm running there's only one of each to install?

    Sorry that argument does not run. But you can try and prove me wrong.

    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Jim Diamond@3:633/10 to All on Sat Feb 28 11:30:01 2026
    On 2026-02-27 at 12:24 AST, Jim Jackson <jj@franjam.org.uk> wrote:
    On 2026-02-26, Jim Diamond <zsd@jdvb.ca> wrote:
    Huh. They don't work for me in urxvt.

    Of course, the question was about lxterminal. So maybe it didn't work for >> the OP because of the '3', and maybe for some other reason.


    just installed rxvt-unicode, fired it up and ran my usual terminal name script which uses these codes and it works! Dunno what makes you setup
    not work.

    Me neither. I just tried it again, in case I had done something wrong.

    Perhaps your urxvt was compiled with different options than mine, and one
    such option allows more

    On my Slackware system:
    options: perl,xft,styles,combining,blink,iso14755,unicode3,encodings=eu+vn+jp+jp-ext+kr+zh+zh-ext,fade,pixbuf,XIM,frills,selectionscrolling,wheel,slipwheel,smart-resize,cursorBlink,pointerBlank,scrollbars=plain+NeXT

    On one of my Pis:
    options: perl,xft,styles,combining,blink,iso14755,unicode3,encodings=eu+vn+jp+jp-ext+kr+zh+zh-ext,fade,transparent,tint,pixbuf,XIM,frills,selectionscrolling,wheel,slipwheel,smart-resize,cursorBlink,pointerBlank,scrollbars=plain+rxvt+NeXT+xterm

    The mystery continues...
    Jim

    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Jim Jackson@3:633/10 to All on Sat Feb 28 11:30:01 2026
    On 2026-02-26, Jim Diamond <zsd@jdvb.ca> wrote:
    Huh. They don't work for me in urxvt.

    Of course, the question was about lxterminal. So maybe it didn't work for the OP because of the '3', and maybe for some other reason.


    just installed rxvt-unicode, fired it up and ran my usual terminal name
    script which uses these codes and it works! Dunno what makes you setup
    not work.


    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Sun Mar 1 12:00:01 2026
    On Sat, 28 Feb 2026 11:28:16 -0000 (UTC), Jim Jackson wrote:

    I'm on Devuan, so urxvt is the Debian one.

    You can?t be sure of that. Who knows what the Devuan folks will rip
    out in their attempts to root out the dreaded systemd-contamination
    ...

    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Jim Jackson@3:633/10 to All on Sun Mar 1 12:00:01 2026
    On 2026-02-27, Jim Diamond <zsd@jdvb.ca> wrote:
    On 2026-02-27 at 12:24 AST, Jim Jackson <jj@franjam.org.uk> wrote:
    On 2026-02-26, Jim Diamond <zsd@jdvb.ca> wrote:
    Huh. They don't work for me in urxvt.

    Of course, the question was about lxterminal. So maybe it didn't work for >>> the OP because of the '3', and maybe for some other reason.


    just installed rxvt-unicode, fired it up and ran my usual terminal name
    script which uses these codes and it works! Dunno what makes you setup
    not work.

    Me neither. I just tried it again, in case I had done something wrong.

    Perhaps your urxvt was compiled with different options than mine, and one such option allows more

    I'm on Devuan, so urxvt is the Debian one. The options are the same as
    the Pi version.

    On my Slackware system: options:
    perl,xft,styles,combining,blink,iso14755,unicode3,
    encodings=eu+vn+jp+jp-ext+kr+zh+zh-ext,fade,pixbuf,
    XIM,frills,selectionscrolling,wheel,slipwheel,smart-resize,
    cursorBlink,pointerBlank,
    scrollbars=plain+NeXT

    On one of my Pis: options:
    perl,xft,styles,combining,blink,iso14755,unicode3,
    encodings=eu+vn+jp+jp-ext+kr+zh+zh-ext,fade,pixbuf
    transparent,tint,
    XIM,frills,selectionscrolling,wheel,slipwheel,smart-resize,
    cursorBlink,pointerBlank,
    scrollbars=plain+rxvt+NeXT+xterm

    What window manager do you use? I'm using openbox. Make sure your shell
    prompt isn't overwriting any change as explained earlier in this thread.

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