Skip to content

Dynamic window and tab title #620

Open

Description

@NelvinBHV

Problem

The window or tab title only show the current directory. For me is not possible to see, which user use this terminal (user or root). Some commands like emerge, apt-get or pacman need to change the title to see the progress.

Proposal

Please add a dynamic title like username@hostname:currentdirectory. If i am the user which start the terminal the nicer way should be to see only username@hostname:~/Downloads in the title. If i switch so root the full path should be shown like root@hostname:/home/username/Downloads
Some commands like emerge or pacman should be allow to change the title dynamic. So i am able the progress of this commands.
Please take a look to the mate-terminal.

Activity

  1. GammaGames commented on Sep 9, 2021

    @GammaGames

    Are you on odin? I remember tabs showing the previous commands and directories in 5.1, it was a lot easier to remember which tab was which that way.

  2. jeremypw commented on Sep 9, 2021

    @jeremypw
    Collaborator

    This recent commit may fix this: #602

  3. puvi7722 commented on Sep 20, 2021

    @puvi7722

    Is this fix #602 working for any one?

  4. GammaGames commented on Sep 20, 2021

    @GammaGames

    Haven't tested, the package hasn't been updated since July.

  5. nevillepark commented on Sep 27, 2021

    @nevillepark

    Just chiming in to say that although my .bashrc is set up to make the tab/window title the current running command, it hasn't done this since I updated to Odin.

  6. GammaGames commented on Dec 11, 2024

    @GammaGames

    Would be nice to have this back

  7. nevillepark commented on Dec 19, 2024

    @nevillepark

    feel like pure shit just want her changeable window and tab titles back

  8. jeremypw commented on Dec 19, 2024

    @jeremypw
    Collaborator

    In OS7.1 and 8 at least, the headerbar title shows the window title property of the Vte.Terminal widget which for me is the same as the prompt i.e. the user@computername:current_dir. After #830 the name of the app will also be shown in multi-tasking view.

    I am not sure what is meant by "changeable" in this context - changeable by the user, the foreground process, or according to the current directory?

  9. GammaGames commented on Dec 19, 2024

    @GammaGames

    I thought it used to automatically show things like username and host. I set up oh-my-posh with the config "console_title_template": "{{.UserName}}@{{.HostName}} {{.Shell}} in {{.PWD}}" and now I at least have the window title working, even if the tabs are all the same.

  10. jeremypw commented on Dec 19, 2024

    @jeremypw
    Collaborator

    I've just seen that in a fresh install of Elementary8-rc in a VM, Terminal does indeed behave differently from OS7.1 even when both are compiled from the same source. Not sure why this is but I would note that Xterm also behaves differently. Either one of the libraries differs or a system config file I guess. Both only show the current directory in the header even though the prompt contains the user and host names as well as the path to the current directory. I'll investigate further and try to restore the previous behaviour.

  11. jeremypw commented on Dec 19, 2024

    @jeremypw
    Collaborator

    Even Mate Terminal does the same, i.e. shows only the current folder name in the headerbar.

  12. jeremypw commented on Dec 19, 2024

    @jeremypw
    Collaborator

    Looks like the cause of this is that the ~/.bashrc file shipped with elementary8-rc is substantially different from the one with elementary7.1. In particular, the following lines are missing:

    # 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
    

    If these are replaced after the lines that initially set PS:

    if [ "$color_prompt" = yes ]; then
        PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ '
    else
        PS1='${debian_chroot:+($debian_chroot)}\u@\h:\W\$ '
    fi
    unset color_prompt force_color_prompt
    

    then the OS7.1 title format is restored.

  13. nevillepark commented on Dec 19, 2024

    @nevillepark

    In OS7.1 and 8 at least, the headerbar title shows the window title property of the Vte.Terminal widget which for me is the same as the prompt i.e. the user@computername:current_dir. After #830 the name of the app will also be shown in multi-tasking view.

    I am not sure what is meant by "changeable" in this context - changeable by the user, the foreground process, or according to the current directory?

    The foreground process, I think? E. g. I have this in my .bashrc, but neither the tab title, headerbar title, nor window title in Multitasking view show the current/last command. Is that the intended behaviour?

    (Terminal 6.3.0, elementary 7.1.)

  14. Marukesu commented on Dec 19, 2024

    @Marukesu
    Contributor

    The linked script makes uses of the bash-preexec script for working. If you don't have it sourced in your bashrc file, then this part of the script will do nothing.

  15. nevillepark commented on Dec 20, 2024

    @nevillepark

    Thank you so much!!

  16. jeremypw commented on Dec 20, 2024

    @jeremypw
    Collaborator

    I notice that on OS8 the shipped ~/.bashrc changes the window title to the name of the running command.

  17. added theissue type on Aug 11, 2025
  18. changed the issue type fromtoon Aug 11, 2025
  19. added
    Status: Confirmed
    on Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Confirmed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions