Compare commits

...

3 Commits

Author SHA1 Message Date
Shaheen Gandhi f77170285f
Merge 44ade697bf into 3e2053a934 2025-01-06 13:24:22 +00:00
Seyed Sajjad (Sina) Tak Tehrani 3e2053a934
fix(prompt): add support for AWS_SSO_PROFILE in AWS segment initialization (#2813)
- Updated `_p9k_prompt_aws_init` to include `AWS_SSO_PROFILE` in the condition for activating the AWS segment.
- Ensures compatibility with AWS SSO profiles in addition to other AWS environment variables.
2025-01-06 03:24:25 -08:00
Shaheen Gandhi 44ade697bf ssh: optimize detection 2024-10-15 22:45:19 -07:00
1 changed files with 3 additions and 2 deletions

View File

@ -1206,7 +1206,7 @@ prompt_aws() {
}
_p9k_prompt_aws_init() {
typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${AWS_VAULT:-${AWSUME_PROFILE:-${AWS_PROFILE:-$AWS_DEFAULT_PROFILE}}}'
typeset -g "_p9k__segment_cond_${_p9k__prompt_side}[_p9k__segment_index]"='${AWS_SSO_PROFILE:-${AWS_VAULT:-${AWSUME_PROFILE:-${AWS_PROFILE:-$AWS_DEFAULT_PROFILE}}}}'
}
################################################################
@ -8483,7 +8483,8 @@ _p9k_init_ssh() {
# When changing user on a remote system, the $SSH_CONNECTION environment variable can be lost.
# Attempt detection via `who`.
(( $+commands[who] )) || return
[[ -z "$(command -v who)" ]] && return
#(( $+commands[who] )) || return
local ipv6='(([0-9a-fA-F]+:)|:){2,}[0-9a-fA-F]+' # Simplified, only checks partial pattern.
local ipv4='([0-9]{1,3}\.){3}[0-9]+' # Simplified, allows invalid ranges.