Skip to content

Commit

Permalink
Set title of terminal (tab) to 'channel@repo-name'
Browse files Browse the repository at this point in the history
  • Loading branch information
JKrag committed Feb 7, 2023
1 parent ae1e1c3 commit bb6d49c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion chat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@ welcome() {
echo
}

welcome
title(){
BASE=$(basename -s .git "$(git config --get remote.origin.url)")
BRANCH=$(git branch --show-current)
TITLE="#$BRANCH @ $BASE"
printf '\033]2;%s\a' "$TITLE"
#printf "\[\e]2;%s\a\]"
}

welcome
title
fetch_print_ff() {
git fetch --quiet
git chatlog "..@{u}"
Expand All @@ -57,6 +65,7 @@ while true ; do
echo
elif [ "$cm" = "/switch" ]; then
git switch "$options"
title
echo "Showing last 5 messages in $options"
git chatlog -5
elif [ "$cm" = "/list" ]; then
Expand All @@ -67,6 +76,7 @@ while true ; do
git switch --quiet --orphan "$options"
git commit --allow-empty --message "Beginning of Channel $options"
git push --set-upstream --quiet origin "$options"
title
elif [ "$cm" = "/repeat" ]; then
: "${options:=5}"
echo -e "Repeating last $options messages in ${RED}$(git branch --show-current)${RC}"
Expand Down

0 comments on commit bb6d49c

Please sign in to comment.