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)
|
||||
fi
|
||||
|
||||
pw () {
|
||||
set_win_title() {
|
||||
echo -ne "\033]0;$USER@$HOSTNAME: $PWD\007"
|
||||
}
|
||||
starship_precmd_user_func=set_win_title
|
||||
|
||||
pw() {
|
||||
len=''${1:-$(( $RANDOM % 24 + 8 ))}
|
||||
tr -dc a-zA-Z0-9 < /dev/urandom | head -c $len
|
||||
echo
|
||||
}
|
||||
|
||||
cdg() {
|
||||
gitroot=$(until [ -d .git ]; do [ "$PWD" == "/" ] && exit 1; cd ..; done; echo $PWD)
|
||||
if [ $? == 0 ]; then
|
||||
precmd_user_func = "title"
|
||||
cd $gitroot
|
||||
else
|
||||
echo "gitroot not found."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue