File: bashrc.example

package info (click to toggle)
xttitle 1.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 188 kB
  • sloc: ansic: 25; makefile: 11
file content (33 lines) | stat: -rw-r--r-- 695 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
This is a .bashrc example to use xttitle. 

Thanks to Chris Lawrence <lawrencc@debian.org> who provided it:

While the man page gives a (slightly erroneous, due to nroff mangling)
example, it might be useful to provide some example code for .bashrc.
Here's an extract from my .bashrc:

# begin example .bashrc
update_title()
{
     [ $TERM = "xterm" ] && xttitle "[$$] ${USER}@${HOSTNAME}:$PWD"
}

function cd()
{
     builtin cd $*; update_title
}

function ssh()
{
     /usr/bin/ssh $*; update_title
}

# If running interactively, then:
if [ "$PS1" ]; then
    update_title
fi
# end example .bashrc

These settings seem to keep my title reasonably updated and don't
interfere with scp/rsync.