Re: hostname in title of gnome-terminal



On Tue, Oct 17, 2006 at 08:01:46 +0200, John Que wrote:
Hello,
Thanks.
In which script do you put this ?

Stick it in a startup script for your shell that's always loaded for
interactive shells, e.g. ~/.bashrc for bash.

/M

On 10/16/06, Magnus Therning <magnus@xxxxxxxxxxxx> wrote:
On Mon, Oct 16, 2006 at 12:31:20 +0200, John Que wrote:
Hello,
I have gnome-terminal-2.14.0-1 on FC5.
Is there a way to configure it so that the hostname will be the title
of an opened tab?

I of course know about the "Set title" menu, but my question is : can
it be done automatically so when I ssh to some machine , the title will
be it's hostname (you can assume that I have the remote machine
hostname before ssh into it).

I usually let my shell do that for me:

bash:
case $TERM in
(xterm*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}($(id -ng))@${HOSTNAME}: ${PWD}\007"'
;;
esac

zsh:
case $TERM in
(xterm*)
function precmd () { print -Pn "\e]0;%n($(id -ng))@%m:%~\a" }
;;
esac

/M

--
Magnus Therning (OpenPGP: 0xAB4DFBA4)
magnus@xxxxxxxxxxxx Jabber: magnus.therning@xxxxxxxxx
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

The right to search for truth implies also a duty; one must not
conceal any part of what one has recognized to be true.
-- Albert Einstein


_______________________________________________
gnome-list mailing list
gnome-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gnome-list




_______________________________________________
gnome-list mailing list
gnome-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gnome-list


--
Magnus Therning (OpenPGP: 0xAB4DFBA4)
magnus@xxxxxxxxxxxx Jabber: magnus.therning@xxxxxxxxx
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

It says "My Computer" because Bill thinks that putting his software on
it makes it his. This explains a lot.
-- unitron (/.)

Attachment: pgpcjUDKRe356.pgp
Description: PGP signature

_______________________________________________
gnome-list mailing list
gnome-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gnome-list


Relevant Pages

  • Re: SSH problem!
    ... Is this Shell Interactive? ... To determine within a startup script whether or not Bash is running ... test the value of the `-' special parameter. ...
    (Fedora)
  • [gnu.bash.bug] BASH Frequently-Asked Questions (FAQ version 3.25)
    ... This is the Bash FAQ, version 3.25, for Bash version 2.05b. ... Bash, the GNU Bourne-Again Shell. ... C3) Which new features in ksh-93 are not in bash, ... D1) Why does bash run a different version of `command' than ...
    (comp.unix.questions)
  • [gnu.bash.bug] BASH Frequently-Asked Questions (FAQ version 3.30)
    ... This is the Bash FAQ, version 3.30, for Bash version 3.0. ... Bash, the GNU Bourne-Again Shell. ... C3) Which new features in ksh-93 are not in bash, ... D1) Why does bash run a different version of `command' than ...
    (comp.unix.shell)
  • [gnu.bash.bug] BASH Frequently-Asked Questions (FAQ version 3.30)
    ... This is the Bash FAQ, version 3.30, for Bash version 3.0. ... Bash, the GNU Bourne-Again Shell. ... C3) Which new features in ksh-93 are not in bash, ... D1) Why does bash run a different version of `command' than ...
    (comp.unix.shell)
  • [gnu.bash.bug] BASH Frequently-Asked Questions (FAQ version 3.25)
    ... This is the Bash FAQ, version 3.25, for Bash version 2.05b. ... Bash, the GNU Bourne-Again Shell. ... C3) Which new features in ksh-93 are not in bash, ... D1) Why does bash run a different version of `command' than ...
    (comp.unix.shell)