Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Setting terminal title

  1. #11
    Join Date
    Aug 2008
    Beans
    93

    Re: Setting terminal title

    Quote Originally Posted by Smart Viking View Post
    What do you need this for? If the whole point for this just is that you want a custom title on all of them you could just edit the launcher for gnome-terminal.
    It seems no one understands what I'm looking for If I don't do this, then I have 15 terminal tabs open and all of them are titled "user@computer: [current directory]", which is stupid and completely useless when I need to find the right one. I want to launch firefox in one tab and rename that tab to "firefox"; launch emacs in another tab and rename that one to "emacs"; etc. Is this clear enough?

  2. #12
    Join Date
    Aug 2005
    Location
    Fargo, ND, USA
    Beans
    1,499
    Distro
    Kubuntu 10.04 Lucid Lynx

    Re: Setting terminal title

    Put this in your ~/.bashrc (or use the echo line in a script).
    Code:
    function set_terminal_title()
    {
        echo -ne "\033]0;$1\007"
    }
    Then you can set the title to whatever you want.
    Code:
    set_terminal_title "hello, world."
    I like to do
    Code:
    PROMPT_COMMAND='set_terminal_title "[${USER}@${HOSTNAME}][${PWD/$HOME/~}] "'
    Help yourself: Search the community docs or try other resources.
    Quote Originally Posted by Henry Spencer
    Those who do not understand Unix are condemned to reinvent it, poorly.
    Let science use your computer when you aren't: Folding@Home.

  3. #13
    Join Date
    Sep 2011
    Beans
    1

    Re: Setting terminal title

    Quote Originally Posted by jpkotta View Post
    Put this in your ~/.bashrc (or use the echo line in a script).
    Code:
    function set_terminal_title()
    {
        echo -ne "\033]0;$1\007"
    }
    Then you can set the title to whatever you want.
    Code:
    set_terminal_title "hello, world."
    I like to do
    Code:
    PROMPT_COMMAND='set_terminal_title "[${USER}@${HOSTNAME}][${PWD/$HOME/~}] "'

    This doesn't work on either Suse nor Unbuntu ub1104. It sort of works on Windows Command prompt, but the Command proccessor sets the title back. on Windows there is the "title" command to do this.

    The above code does work for xterms, but not Gnome Terminal.

    Regards Tom Bodine

  4. #14
    Join Date
    May 2010
    Beans
    7

    Re: Setting terminal title

    I think what your looking for is the xtitle command. I can confirm this works on the gnome terminal under Ubuntu 10.04. You can install it using:

    Code:
    $> sudo apt-get install xtitle
    Once you have xtitle installed you can simply type:

    Code:
    $> xtitle your-new-title-here
    The man page is online here:

    http://manpages.ubuntu.com/manpages/.../xtitle.1.html

  5. #15
    Join Date
    Nov 2005
    Location
    Lincolnshire, UK
    Beans
    1,461
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Setting terminal title

    Quote Originally Posted by zzzonked View Post
    It seems no one understands what I'm looking for If I don't do this, then I have 15 terminal tabs open and all of them are titled "user@computer: [current directory]", which is stupid and completely useless when I need to find the right one. I want to launch firefox in one tab and rename that tab to "firefox"; launch emacs in another tab and rename that one to "emacs"; etc. Is this clear enough?
    Do you really open 15 graphical apps (such as Firefox) from the terminal? I understand the need to do this while debugging etc but, as a matter of routine, surely this is not necessary. Just open them with a launcher in the usual way - fire and forget.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •