set window title
This commit is contained in:
parent
dcc39189b7
commit
b8597f51a0
1 changed files with 7 additions and 2 deletions
|
@ -38,15 +38,20 @@ in {
|
||||||
eval $(ssh-agent)
|
eval $(ssh-agent)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
set_win_title() {
|
||||||
|
echo -ne "\033]0;$USER@$HOSTNAME: $PWD\007"
|
||||||
|
}
|
||||||
|
starship_precmd_user_func=set_win_title
|
||||||
|
|
||||||
pw() {
|
pw() {
|
||||||
len=''${1:-$(( $RANDOM % 24 + 8 ))}
|
len=''${1:-$(( $RANDOM % 24 + 8 ))}
|
||||||
tr -dc a-zA-Z0-9 < /dev/urandom | head -c $len
|
tr -dc a-zA-Z0-9 < /dev/urandom | head -c $len
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
cdg() {
|
cdg() {
|
||||||
gitroot=$(until [ -d .git ]; do [ "$PWD" == "/" ] && exit 1; cd ..; done; echo $PWD)
|
gitroot=$(until [ -d .git ]; do [ "$PWD" == "/" ] && exit 1; cd ..; done; echo $PWD)
|
||||||
if [ $? == 0 ]; then
|
if [ $? == 0 ]; then
|
||||||
|
precmd_user_func = "title"
|
||||||
cd $gitroot
|
cd $gitroot
|
||||||
else
|
else
|
||||||
echo "gitroot not found."
|
echo "gitroot not found."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue