Skip to content

Commit

Permalink
feat(zsh): make pr segment a hyperlink
Browse files Browse the repository at this point in the history
  • Loading branch information
denolfe committed May 9, 2024
1 parent d409388 commit 1d3fc84
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions zsh/p10k.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -1630,15 +1630,17 @@
typeset -g POWERLEVEL9K_PR_NUMBER_FOREGROUND=0
typeset -g POWERLEVEL9K_PR_NUMBER_BACKGROUND=208

# Show remaining time on AWS token, based upon credentials file modified date
# Shows the PR number as hyperlink
prompt_pr_number() {
if [[ ! -d .git ]]; then return; fi

local pr_number=$(git config --get branch."$(git branch --show-current)".github-pr-owner-number | awk -F "#" '{print $3}')

if [ -z "$pr_number" ]; then return; fi

_p9k_prompt_segment "$0$state" 208 016 '' 0 '' "#$pr_number"
# source: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
local pr_link=$(echo "\e]8;;https://github.com/payloadcms/payload/pull/$pr_number\e\\#$pr_number\e]8;;\e\\")
_p9k_prompt_segment "$0$state" 208 016 '' 0 '' "$pr_link"
}

#####################################[ work_aws: custom aws segment ]#########################
Expand Down

0 comments on commit 1d3fc84

Please sign in to comment.