Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Dec 2015 17:19:05 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        freebsd-questions@freebsd.org
Subject:   Re: Place servername in TAB iTerm
Message-ID:  <56798609.4030104@infracaninophile.co.uk>
In-Reply-To: <56794743.5040808@gmail.com>
References:  <56794339.3080106@gmail.com> <20151222123933.GA3974@c720-r285885-amd64> <56794743.5040808@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--dIpq2iS8U7dP6oeuOvchc3AKNMjiWCqXN
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 12/22/15 12:51, Johan Hendriks wrote:
> Thanks that works, can this be automated when I log in
>=20
> regards
> Johan
>=20
> Op 22/12/15 om 13:39 schreef Matthias Apitz:
>> El d=C3=ADa Tuesday, December 22, 2015 a las 01:34:01PM +0100, Johan H=
endriks escribi=C3=B3:
>>
>>> Hello all.
>>>
>>> I use iTerm on my mac.
>>> When I connect to a Linux (Ubuntu) machine, in the TAB the name off t=
he
>>> server appears.
>>> If I connect to a FreeBSD machine it just shows me ssh.
>>> How can I change the name off the TAB in iTerm (and other terminal
>>> programs) to show the servername.
>>> I use the standard csh. BTW if i use portmaster then it renames the t=
ab
>>> also to what portmaster is doing.
>>>
>>> I do not know what I need to change to get the same behauviour as Lin=
ux
>>>
>>> Thank you for your time.
>> I can only speak for xterm and urxvt terminals (and maybe for iTerm on=

>> Mac you should consult its documentation or mac user forums); I have a=

>> script 'ti.sh' which says:
>>
>>
>> #!/bin/sh
>> printf "\033]0;$1\007"
>>
>> and when I run this as '~/ti.sh blabla' it puts 'blabla' in the titel
>> bar of the terminal.

Given you're using tcsh, try something like this in your .tcshrc:

        set prompt =3D "%B%m%b:%c03:%# "
        if ( $?TERM ) then
            switch ($TERM)
            case xterm:
            case xterm-color:
                set prompt =3D '%{\033]0;%n@%m:%/\007%}%B%m%b:%c03:%# '
                breaksw
            case screen:
                set prompt =3D '[%B%m%b]:%c03:%# '
                breaksw
            default:
                set prompt =3D '%B%m%b:%c03:%# '
                breaksw
            endsw
        endif

That sets your prompt to look like eg.

lucid-nonsense:~:%

(except the hostname bit is in bold)

and for any terminal that behaves like an xterm -- which includes both
Terminal.app and iTerm.app -- it sets the title bar to eg

matthew@lucid-nonsense:/home/matthew

The other cases in that switch statement are used for different terminal
types.

	Cheers,

	Matthew




--dIpq2iS8U7dP6oeuOvchc3AKNMjiWCqXN
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJWeYYJAAoJEABRPxDgqeTnu3oP/0jf/iBWvfCv6r77TaSXq0J/
mMHyuU/VftCXRbZurInDuXqiBI90OtJVq9ieoxZmw+38XaossvhKCWe7M9svl43O
N9WreCDUXeAr+aLK461iHuuGLe3RNngumecOtx1shdgPZC0vDMU81kQvid1mtJdm
VB3kyE65aOURI/3tdrXcRy/mM3T3DjCtzqx4n5a54C676GveOMKVLYl1X0C8anPZ
GMftB4ImYaDHAYMMejYvHBP2NB4bh0FtIP2Rbvt/YnRr4ZKS76vrirpGFDFZ2HDI
J7CuZyjaOPxaZ2owYRLtazePvT9LRC9666Cfv3b2tFupWFC8n6a/YfwhOp40JWa0
0DPx5iWSsVf5gZnXCxVJaArYmeKlBHTfHgXan3pmdQhpK6WMX/FgbSvh+BfOyWhF
JG201CoWw7qEog/jBPwxYzkxT8a/TjYzMpjND9GpeM+3Bl7/UsLbuLyHtvfm4bsf
cOgUl3EaSq5G1/bN1/RPJYIY69oM/MbLAXT570jEgSx+jpWgZj2/qp8NI+/S5gRp
NS6F/f8Ab5LLEfHksfZG32F3gRGSN4angNcI9ovMiDNmfwXD4j59DzE62A67bKMr
I4DNEbAJVnmJbsM/2ASH/F14WP/J4GGTyhRkj6rZNmJVxQv9lkExCmGXaIsJoYEQ
YDdvGVR9jFaXITe6ZywC
=WuPx
-----END PGP SIGNATURE-----

--dIpq2iS8U7dP6oeuOvchc3AKNMjiWCqXN--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?56798609.4030104>