summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/ISSUE_TEMPLATE/bug_report.md46
-rw-r--r--.github/ISSUE_TEMPLATE/bug_report.yml69
-rw-r--r--.github/ISSUE_TEMPLATE/feature_request.md29
-rw-r--r--.github/ISSUE_TEMPLATE/feature_request.yml32
-rw-r--r--lib/cli.zsh77
-rw-r--r--lib/functions.zsh34
-rw-r--r--plugins/ag/README.md2
-rw-r--r--plugins/aws/aws.plugin.zsh66
-rw-r--r--plugins/cloudapp/README.md26
-rw-r--r--plugins/cloudapp/cloudapp.plugin.zsh4
-rw-r--r--plugins/copybuffer/copybuffer.plugin.zsh2
-rw-r--r--plugins/dirhistory/README.md3
-rw-r--r--plugins/extract/README.md2
-rw-r--r--plugins/extract/_extract2
-rw-r--r--plugins/extract/extract.plugin.zsh147
-rw-r--r--plugins/fedora/README.md1
-rw-r--r--plugins/fedora/fedora.plugin.zsh3
-rw-r--r--plugins/fnm/.gitignore2
-rw-r--r--plugins/fnm/README.md9
-rw-r--r--plugins/fnm/fnm.plugin.zsh12
-rw-r--r--plugins/git/README.md35
-rw-r--r--plugins/git/git.plugin.zsh19
-rw-r--r--plugins/github/README.md4
-rw-r--r--plugins/gnu-utils/gnu-utils.plugin.zsh2
-rw-r--r--plugins/go/README.md1
-rw-r--r--plugins/go/go.plugin.zsh3
-rw-r--r--plugins/invoke/README.md10
-rw-r--r--plugins/invoke/invoke.plugin.zsh5
-rw-r--r--plugins/octozen/README.md12
-rw-r--r--plugins/octozen/octozen.plugin.zsh11
-rw-r--r--plugins/pyenv/pyenv.plugin.zsh83
-rwxr-xr-xtools/changelog.sh4
32 files changed, 461 insertions, 296 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
deleted file mode 100644
index 88a6b814d..000000000
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ /dev/null
@@ -1,46 +0,0 @@
----
-name: Bug report
-about: Create a report to help us improve Oh My Zsh
-labels: 'Bug'
-
----
-
-<!--
-Fill this out before posting. You can delete irrelevant sections, but
-an issue where no sections have been filled will be deleted without comment.
--->
-
-**Describe the bug**
-A clear description of what the bug is.
-
-**To Reproduce**
-Steps to reproduce the behavior, for example:
-1. Enable this plugin '...'
-2. Run command '...' or try the autocomplete command '...'
-3. See error
-
-**Expected behavior**
-A brief description of what should happen.
-
-**Screenshots and/or Recordings**
-If applicable, add screenshots to help explain your problem.
-You can also record an asciinema session: https://asciinema.org/
-
-**Self Check**
-
-- Have you tried reaching out on the [Discord server](https://discord.gg/ohmyzsh)?
- This can help cut down on filling up issues. We always have a few people
- online that are in a variety of timezones that are willing to help you!
-
-- Also searching existing [GitHub Issues](https://github.com/ohmyzsh/ohmyzsh/issues?q=) might help you get quicker support
-
-**Desktop (please complete the following information):**
-
- - OS / Distro: [e.g. Arch Linux, macOS]
- - If on Windows what version of WSL: [e.g. WSL1, WSL2]
- - Latest ohmyzsh update?: [e.g. Yes/No]
- - ZSH Version: [e.g. 5.6]
- - Terminal emulator: [e.g. iTerm2]
-
-**Additional context**
-Add any other context about the problem here. This can be themes, plugins, custom configs.
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 000000000..af2973fec
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,69 @@
+name: Bug report
+description: Create a report to help us improve Oh My Zsh
+labels: 'Bug'
+body:
+ - type: markdown
+ attributes:
+ value: |
+ ## Self Check
+ - Try searching existing [GitHub Issues](https://github.com/ohmyzsh/ohmyzsh/issues?q=is%3Aissue) (open or closed) for similar issues.
+ - Try reaching out on the [Discord server](https://discord.gg/ohmyzsh) for help.
+ - type: textarea
+ validations:
+ required: true
+ attributes:
+ label: Describe the bug
+ description: A clear description of what the bug is.
+ - type: textarea
+ validations:
+ required: true
+ attributes:
+ label: Steps to reproduce
+ description: |
+ Steps to reproduce the problem.
+ placeholder: |
+ For example:
+ 1. Enable plugin '...'
+ 2. Run command '...' or try to complete command '...'
+ 3. See error
+ - type: textarea
+ validations:
+ required: true
+ attributes:
+ label: Expected behavior
+ description: A brief description of what should happen.
+ - type: textarea
+ attributes:
+ label: Screenshots and recordings
+ description: |
+ If applicable, add screenshots to help explain your problem. You can also record an asciinema session: https://asciinema.org/
+ - type: input
+ validations:
+ required: true
+ attributes:
+ label: OS / Distro
+ placeholder: e.g. Windows 10, Ubuntu 20.04, Arch Linux, macOS 10.15...
+ - type: input
+ validations:
+ required: true
+ attributes:
+ label: Zsh version
+ description: Run `echo $ZSH_VERSION` to check.
+ placeholder: e.g. 5.6
+ - type: input
+ validations:
+ required: true
+ attributes:
+ label: Terminal emulator
+ placeholder: e.g. iTerm2, Gnome Terminal...
+ - type: dropdown
+ attributes:
+ label: If using WSL on Windows, which version of WSL
+ description: Run `wsl -l -v` to check.
+ options:
+ - WSL1
+ - WSL2
+ - type: textarea
+ attributes:
+ label: Additional context
+ description: Add any other context about the problem here. This can be themes, plugins, custom settings...
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
deleted file mode 100644
index 788f77368..000000000
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ /dev/null
@@ -1,29 +0,0 @@
----
-name: Feature request
-about: Suggest a feature for Oh My Zsh
-labels: 'Feature'
-
----
-
-<!--
-Fill this out before posting. You can delete irrelevant sections, but
-an issue where no sections have been filled will be deleted without comment.
--->
-
-**Is your feature request related to a particular plugin or theme? If so, specify it.**
-The name of the plugin, theme or alias that you would like us to improve. [...]
-
-**Is your feature request related to a problem? Please describe.**
-A description of what the problem is. Ex. I'm always frustrated when [...]
-
-**Describe the solution you'd like**
-A description of what you want to happen. [...]
-
-**Describe alternatives you've considered**
-A description of any alternative solutions or features you've considered. This can also include other plugins or themes.
-
-**Additional context**
-Add any other context, screenshots or discord conversations about the feature request here. Also if you have any PRs related to this issue that are already open that you would like us to look at.
-
-**Related Issues**
-Is there any open or closed issues that is related to this feature request? If so please link them below! [...]
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 000000000..dc4baf2b1
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,32 @@
+name: Feature request
+description: Suggest a feature for Oh My Zsh
+labels: 'Feature'
+body:
+ - type: input
+ attributes:
+ label: If the feature request is for a plugin or theme, specify it here.
+ description: The name of the plugin or theme that you would like us to improve.
+ placeholder: e.g. Git plugin, Agnoster theme
+ - type: textarea
+ attributes:
+ label: If the feature solves a problem you have, specify it here.
+ description: A description of what the problem is.
+ placeholder: Ex. I'm always frustrated when...
+ - type: textarea
+ attributes:
+ label: Describe the proposed feature.
+ description: A description of what you want to happen. Be as specific as possible.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Describe alternatives you've considered
+ description: A description of any alternative solutions or features you've considered. This can also include other plugins or themes.
+ - type: textarea
+ attributes:
+ label: Additional context
+ description: Add any other context, screenshots or Discord conversations about the feature request here. Also if you have any PRs related to this issue that are already open that you would like us to look at.
+ - type: textarea
+ attributes:
+ label: Related Issues
+ description: Is there any open or closed issues that is related to this feature request? If so please link them below!
diff --git a/lib/cli.zsh b/lib/cli.zsh
index 38e2f72f8..7e3e37be8 100644
--- a/lib/cli.zsh
+++ b/lib/cli.zsh
@@ -37,7 +37,7 @@ function _omz {
changelog) local -a refs
refs=("${(@f)$(command git for-each-ref --format="%(refname:short):%(subject)" refs/heads refs/tags)}")
_describe 'command' refs ;;
- plugin) subcmds=('info:Get plugin information' 'list:List plugins')
+ plugin) subcmds=('info:Get plugin information' 'list:List plugins' 'load:Load plugin(s)')
_describe 'command' subcmds ;;
pr) subcmds=('test:Test a Pull Request' 'clean:Delete all Pull Request branches')
_describe 'command' subcmds ;;
@@ -46,10 +46,26 @@ function _omz {
esac
elif (( CURRENT == 4 )); then
case "$words[2]::$words[3]" in
- plugin::info) compadd "$ZSH"/plugins/*/README.md(.N:h:t) \
- "$ZSH_CUSTOM"/plugins/*/README.md(.N:h:t) ;;
- theme::use) compadd "$ZSH"/themes/*.zsh-theme(.N:t:r) \
- "$ZSH_CUSTOM"/**/*.zsh-theme(.N:r:gs:"$ZSH_CUSTOM"/themes/:::gs:"$ZSH_CUSTOM"/:::) ;;
+ plugin::(info|load))
+ local -aU plugins=("$ZSH"/plugins/*/{_*,*.plugin.zsh}(.N:h:t) "$ZSH_CUSTOM"/plugins/*/{_*,*.plugin.zsh}(.N:h:t))
+ _describe 'plugin' plugins ;;
+ theme::use)
+ local -aU themes=("$ZSH"/themes/*.zsh-theme(.N:t:r) "$ZSH_CUSTOM"/**/*.zsh-theme(.N:r:gs:"$ZSH_CUSTOM"/themes/:::gs:"$ZSH_CUSTOM"/:::))
+ _describe 'theme' themes ;;
+ esac
+ elif (( CURRENT > 4 )); then
+ case "$words[2]::$words[3]" in
+ plugin::load)
+ local -aU plugins=("$ZSH"/plugins/*/{_*,*.plugin.zsh}(.N:h:t) "$ZSH_CUSTOM"/plugins/*/{_*,*.plugin.zsh}(.N:h:t))
+
+ # Remove plugins already passed as arguments
+ # NOTE: $(( CURRENT - 1 )) is the last plugin argument completely passed, i.e. that which
+ # has a space after them. This is to avoid removing plugins partially passed, which makes
+ # the completion not add a space after the completed plugin.
+ local -a args=(${words[4,$(( CURRENT - 1))]})
+ plugins=(${plugins:|args})
+
+ _describe 'plugin' plugins ;;
esac
fi
@@ -147,6 +163,7 @@ Available commands:
info <plugin> Get information of a plugin
list List all available Oh My Zsh plugins
+ load <plugin> Load plugin(s)
EOF
return 1
@@ -205,6 +222,56 @@ function _omz::plugin::list {
fi
}
+function _omz::plugin::load {
+ if [[ -z "$1" ]]; then
+ echo >&2 "Usage: omz plugin load <plugin> [...]"
+ return 1
+ fi
+
+ local plugins=("$@")
+ local plugin base has_completion=0
+
+ for plugin in $plugins; do
+ if [[ -d "$ZSH_CUSTOM/plugins/$plugin" ]]; then
+ base="$ZSH_CUSTOM/plugins/$plugin"
+ elif [[ -d "$ZSH/plugins/$plugin" ]]; then
+ base="$ZSH/plugins/$plugin"
+ else
+ _omz::log warn "plugin '$plugin' not found"
+ continue
+ fi
+
+ # Check if its a valid plugin
+ if [[ ! -f "$base/_$plugin" && ! -f "$base/$plugin.plugin.zsh" ]]; then
+ _omz::log warn "'$plugin' is not a valid plugin"
+ continue
+ # It it is a valid plugin, add its directory to $fpath unless it is already there
+ elif (( ! ${fpath[(Ie)$base]} )); then
+ fpath=("$base" $fpath)
+ fi
+
+ # Check if it has completion to reload compinit
+ if [[ -f "$base/_$plugin" ]]; then
+ has_completion=1
+ fi
+
+ # Load the plugin
+ if [[ -f "$base/$plugin.plugin.zsh" ]]; then
+ source "$base/$plugin.plugin.zsh"
+ fi
+ done
+
+ # If we have completion, we need to reload the completion
+ # We pass -D to avoid generating a new dump file, which would overwrite our
+ # current one for the next session (and we don't want that because we're not
+ # actually enabling the plugins for the next session).
+ # Note that we still have to pass -d "$_comp_dumpfile", so that compinit
+ # doesn't use the default zcompdump location (${ZDOTDIR:-$HOME}/.zcompdump).
+ if (( has_completion )); then
+ compinit -D -d "$_comp_dumpfile"
+ fi
+}
+
function _omz::pr {
(( $# > 0 && $+functions[_omz::pr::$1] )) || {
cat <<EOF
diff --git a/lib/functions.zsh b/lib/functions.zsh
index 9cc735196..73b491a59 100644
--- a/lib/functions.zsh
+++ b/lib/functions.zsh
@@ -13,10 +13,6 @@ function upgrade_oh_my_zsh() {
omz update
}
-function takedir() {
- mkdir -p $@ && cd ${@:$#}
-}
-
function open_command() {
local open_cmd
@@ -37,27 +33,35 @@ function open_command() {
${=open_cmd} "$@" &>/dev/null
}
+# take functions
+
+# mkcd is equivalent to takedir
+function mkcd takedir() {
+ mkdir -p $@ && cd ${@:$#}
+}
+
function takeurl() {
- data=$(mktemp)
- curl -L $1 > $data
- tar xf $data
- thedir=$(tar tf $data | head -1)
- rm $data
- cd $thedir
+ local data thedir
+ data="$(mktemp)"
+ curl -L "$1" > "$data"
+ tar xf "$data"
+ thedir="$(tar tf "$data" | head -1)"
+ rm "$data"
+ cd "$thedir"
}
function takegit() {
- git clone $1
- cd $(basename ${1%%.git})
+ git clone "$1"
+ cd "$(basename ${1%%.git})"
}
function take() {
if [[ $1 =~ ^(https?|ftp).*\.tar\.(gz|bz2|xz)$ ]]; then
- takeurl $1
+ takeurl "$1"
elif [[ $1 =~ ^([A-Za-z0-9]\+@|https?|git|ssh|ftps?|rsync).*\.git/?$ ]]; then
- takegit $1
+ takegit "$1"
else
- takedir $1
+ takedir "$@"
fi
}
diff --git a/plugins/ag/README.md b/plugins/ag/README.md
index 6acc54067..1983aaa41 100644
--- a/plugins/ag/README.md
+++ b/plugins/ag/README.md
@@ -5,7 +5,7 @@ This plugin provides completion support for [`ag`](https://github.com/ggreer/the
To use it, add ag to the plugins array in your zshrc file.
```zsh
-plugins=(... aws)
+plugins=(... ag)
```
## INSTALLATION NOTES
diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
index e1566b113..2d095635b 100644
--- a/plugins/aws/aws.plugin.zsh
+++ b/plugins/aws/aws.plugin.zsh
@@ -62,47 +62,47 @@ function acp() {
read -r sess_duration
fi
mfa_opt=(--serial-number "$mfa_serial" --token-code "$mfa_token" --duration-seconds "${sess_duration:-3600}")
+ fi
- # Now see whether we need to just MFA for the current role, or assume a different one
- local role_arn="$(aws configure get role_arn --profile $profile)"
- local sess_name="$(aws configure get role_session_name --profile $profile)"
-
- if [[ -n "$role_arn" ]]; then
- # Means we need to assume a specified role
- aws_command=(aws sts assume-role --role-arn "$role_arn" "${mfa_opt[@]}")
+ # Now see whether we need to just MFA for the current role, or assume a different one
+ local role_arn="$(aws configure get role_arn --profile $profile)"
+ local sess_name="$(aws configure get role_session_name --profile $profile)"
- # Check whether external_id is configured to use while assuming the role
- local external_id="$(aws configure get external_id --profile $profile)"
- if [[ -n "$external_id" ]]; then
- aws_command+=(--external-id "$external_id")
- fi
+ if [[ -n "$role_arn" ]]; then
+ # Means we need to assume a specified role
+ aws_command=(aws sts assume-role --role-arn "$role_arn" "${mfa_opt[@]}")
- # Get source profile to use to assume role
- local source_profile="$(aws configure get source_profile --profile $profile)"
- if [[ -z "$sess_name" ]]; then
- sess_name="${source_profile:-profile}"
- fi
- aws_command+=(--profile="${source_profile:-profile}" --role-session-name "${sess_name}")
+ # Check whether external_id is configured to use while assuming the role
+ local external_id="$(aws configure get external_id --profile $profile)"
+ if [[ -n "$external_id" ]]; then
+ aws_command+=(--external-id "$external_id")
+ fi
- echo "Assuming role $role_arn using profile ${source_profile:-profile}"
- else
- # Means we only need to do MFA
- aws_command=(aws sts get-session-token --profile="$profile" "${mfa_opt[@]}")
- echo "Obtaining session token for profile $profile"
+ # Get source profile to use to assume role
+ local source_profile="$(aws configure get source_profile --profile $profile)"
+ if [[ -z "$sess_name" ]]; then
+ sess_name="${source_profile:-profile}"
fi
+ aws_command+=(--profile="${source_profile:-profile}" --role-session-name "${sess_name}")
- # Format output of aws command for easier processing
- aws_command+=(--query '[Credentials.AccessKeyId,Credentials.SecretAccessKey,Credentials.SessionToken]' --output text)
+ echo "Assuming role $role_arn using profile ${source_profile:-profile}"
+ else
+ # Means we only need to do MFA
+ aws_command=(aws sts get-session-token --profile="$profile" "${mfa_opt[@]}")
+ echo "Obtaining session token for profile $profile"
+ fi
- # Run the aws command to obtain credentials
- local -a credentials
- credentials=(${(ps:\t:)"$(${aws_command[@]})"})
+ # Format output of aws command for easier processing
+ aws_command+=(--query '[Credentials.AccessKeyId,Credentials.SecretAccessKey,Credentials.SessionToken]' --output text)
- if [[ -n "$credentials" ]]; then
- aws_access_key_id="${credentials[1]}"
- aws_secret_access_key="${credentials[2]}"
- aws_session_token="${credentials[3]}"
- fi
+ # Run the aws command to obtain credentials
+ local -a credentials
+ credentials=(${(ps:\t:)"$(${aws_command[@]})"})
+
+ if [[ -n "$credentials" ]]; then
+ aws_access_key_id="${credentials[1]}"
+ aws_secret_access_key="${credentials[2]}"
+ aws_session_token="${credentials[3]}"
fi
# Switch to AWS profile
diff --git a/plugins/cloudapp/README.md b/plugins/cloudapp/README.md
deleted file mode 100644
index ef304edc2..000000000
--- a/plugins/cloudapp/README.md
+++ /dev/null
@@ -1,26 +0,0 @@
-# CloudApp plugin
-
-## The CloudApp API is deprecated, so the plugin will be removed shortly
-
-[CloudApp](https://www.getcloudapp.com) brings screen recording, screenshots, and GIF creation to the cloud, in an easy-to-use enterprise-level app. The CloudApp plugin allows you to upload a file to your CloadApp account from the command line.
-
-To use it, add `cloudapp` to the plugins array of your `~/.zshrc` file:
-
-```zsh
-plugins=(... cloudapp)
-```
-
-## Requirements
-
-1. [Aaron Russell's `cloudapp_api` gem](https://github.com/aaronrussell/cloudapp_api#installation)
-
-2. That you set your CloudApp credentials in `~/.cloudapp` as a simple text file like below:
- ```
- email
- password
- ```
-
-## Usage
-
-- `cloudapp <filename>`: uploads `<filename>` to your CloudApp account, and if you're using
- macOS, copies the URL to your clipboard.
diff --git a/plugins/cloudapp/cloudapp.plugin.zsh b/plugins/cloudapp/cloudapp.plugin.zsh
deleted file mode 100644
index a4d92a080..000000000
--- a/plugins/cloudapp/cloudapp.plugin.zsh
+++ /dev/null
@@ -1,4 +0,0 @@
-print -Pn "%F{yellow}"
-print "[oh-my-zsh] The CloudApp API no longer works, so the cloudapp plugin will"
-print "[oh-my-zsh] be removed shortly. Please remove it from your plugins list."
-print -Pn "%f"
diff --git a/plugins/copybuffer/copybuffer.plugin.zsh b/plugins/copybuffer/copybuffer.plugin.zsh
index 483ed5a5f..87a658d93 100644
--- a/plugins/copybuffer/copybuffer.plugin.zsh
+++ b/plugins/copybuffer/copybuffer.plugin.zsh
@@ -5,7 +5,7 @@ copybuffer () {
if which clipcopy &>/dev/null; then
printf "%s" "$BUFFER" | clipcopy
else
- echo "clipcopy function not found. Please make sure you have Oh My Zsh installed correctly."
+ zle -M "clipcopy not found. Please make sure you have Oh My Zsh installed correctly."
fi
}
diff --git a/plugins/dirhistory/README.md b/plugins/dirhistory/README.md
index 223650727..602fc8284 100644
--- a/plugins/dirhistory/README.md
+++ b/plugins/dirhistory/README.md
@@ -17,6 +17,9 @@ plugins=(... dirhistory)
| <kbd>alt</kbd> + <kbd>up</kbd> | Move into the parent directory |
| <kbd>alt</kbd> + <kbd>down</kbd> | Move into the first child directory by alphabetical order |
+NOTE: some terminals might override the ALT+Arrows key bindings (Windows Terminal, for example).
+If these don't work check your terminal settings and change them to a different keyboard shortcut.
+
## Usage
This plugin allows you to navigate the history of previous current-working-directories using ALT-LEFT and ALT-RIGHT. ALT-LEFT moves back to directories that the user has changed to in the past, and ALT-RIGHT undoes ALT-LEFT. MAC users may alternately use OPT-LEFT and OPT-RIGHT.
diff --git a/plugins/extract/README.md b/plugins/extract/README.md
index f2e6ad1d1..44f0b05a1 100644
--- a/plugins/extract/README.md
+++ b/plugins/extract/README.md
@@ -21,6 +21,8 @@ plugins=(... extract)
| `apk` | Android app file |
| `aar` | Android library file |
| `bz2` | Bzip2 file |
+| `cab` | Microsoft cabinet archive |
+| `cpio` | Cpio archive |
| `deb` | Debian package |
| `ear` | Enterprise Application aRchive |
| `gz` | Gzip file |
diff --git a/plugins/extract/_extract b/plugins/extract/_extract
index 267c4d4e1..27b099c9e 100644
--- a/plugins/extract/_extract
+++ b/plugins/extract/_extract
@@ -3,5 +3,5 @@
_arguments \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
- "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|ear|gz|ipa|ipsw|jar|lrz|lz4|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
+ "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|cab|cpio|deb|ear|gz|ipa|ipsw|jar|lrz|lz4|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
&& return 0
diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
index e390e2dcc..1112dd52f 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -1,82 +1,85 @@
alias x=extract
extract() {
- local remove_archive
- local success
- local extract_dir
+ setopt localoptions noautopushd
- if (( $# == 0 )); then
- cat <<-'EOF' >&2
- Usage: extract [-option] [file ...]
+ if (( $# == 0 )); then
+ cat >&2 <<'EOF'
+Usage: extract [-option] [file ...]
- Options:
- -r, --remove Remove archive after unpacking.
- EOF
- fi
+Options:
+ -r, --remove Remove archive after unpacking.
+EOF
+ fi
- remove_archive=1
- if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then
- remove_archive=0
- shift
- fi
+ local remove_archive=1
+ if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then
+ remove_archive=0
+ shift
+ fi
- while (( $# > 0 )); do
- if [[ ! -f "$1" ]]; then
- echo "extract: '$1' is not a valid file" >&2
- shift
- continue
- fi
+ local pwd="$PWD"
+ while (( $# > 0 )); do
+ if [[ ! -f "$1" ]]; then
+ echo "extract: '$1' is not a valid file" >&2
+ shift
+ continue
+ fi
- success=0
- extract_dir="${1:t:r}"
- case "${1:l}" in
- (*.tar.gz|*.tgz) (( $+commands[pigz] )) && { pigz -dc "$1" | tar xv } || tar zxvf "$1" ;;
- (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
- (*.tar.xz|*.txz)
- tar --xz --help &> /dev/null \
- && tar --xz -xvf "$1" \
- || xzcat "$1" | tar xvf - ;;
- (*.tar.zma|*.tlz)
- tar --lzma --help &> /dev/null \
- && tar --lzma -xvf "$1" \
- || lzcat "$1" | tar xvf - ;;
- (*.tar.zst|*.tzst)
- tar --zstd --help &> /dev/null \
- && tar --zstd -xvf "$1" \
- || zstdcat "$1" | tar xvf - ;;
- (*.tar) tar xvf "$1" ;;
- (*.tar.lz) (( $+commands[lzip] )) && tar xvf "$1" ;;
- (*.tar.lz4) lz4 -c -d "$1" | tar xvf - ;;
- (*.tar.lrz) (( $+commands[lrzuntar] )) && lrzuntar "$1" ;;
- (*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;;
- (*.bz2) bunzip2 "$1" ;;
- (*.xz) unxz "$1" ;;
- (*.lrz) (( $+commands[lrunzip] )) && lrunzip "$1" ;;
- (*.lz4) lz4 -d "$1" ;;
- (*.lzma) unlzma "$1" ;;
- (*.z) uncompress "$1" ;;
- (*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;;
- (*.rar) unrar x -ad "$1" ;;
- (*.rpm) mkdir "$extract_dir" && cd "$extract_dir" && rpm2cpio "../$1" | cpio --quiet -id && cd .. ;;
- (*.7z) 7za x "$1" ;;
- (*.deb)
- mkdir -p "$extract_dir/control"
- mkdir -p "$extract_dir/data"
- cd "$extract_dir"; ar vx "../${1}" > /dev/null
- cd control; tar xzvf ../control.tar.gz
- cd ../data; extract ../data.tar.*
- cd ..; rm *.tar.* debian-binary
- cd ..
- ;;
- (*.zst) unzstd "$1" ;;
- (*)
- echo "extract: '$1' cannot be extracted" >&2
- success=1
- ;;
- esac
+ local success=0
+ local extract_dir="${1:t:r}"
+ local file="$1" full_path="${1:A}"
+ case "${file:l}" in
+ (*.tar.gz|*.tgz) (( $+commands[pigz] )) && { pigz -dc "$file" | tar xv } || tar zxvf "$file" ;;
+ (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$file" ;;
+ (*.tar.xz|*.txz)
+ tar --xz --help &> /dev/null \
+ && tar --xz -xvf "$file" \
+ || xzcat "$file" | tar xvf - ;;
+ (*.tar.zma|*.tlz)
+ tar --lzma --help &> /dev/null \
+ && tar --lzma -xvf "$file" \
+ || lzcat "$file" | tar xvf - ;;
+ (*.tar.zst|*.tzst)
+ tar --zstd --help &> /dev/null \
+ && tar --zstd -xvf "$file" \
+ || zstdcat "$file" | tar xvf - ;;
+ (*.tar) tar xvf "$file" ;;
+ (*.tar.lz) (( $+commands[lzip] )) && tar xvf "$file" ;;
+ (*.tar.lz4) lz4 -c -d "$file" | tar xvf - ;;
+ (*.tar.lrz) (( $+commands[lrzuntar] )) && lrzuntar "$file" ;;
+ (*.gz) (( $+commands[pigz] )) && pigz -dk "$file" || gunzip -k "$file" ;;
+ (*.bz2) bunzip2 "$file" ;;
+ (*.xz) unxz "$file" ;;
+ (*.lrz) (( $+commands[lrunzip] )) && lrunzip "$file" ;;
+ (*.lz4) lz4 -d "$file" ;;
+ (*.lzma) unlzma "$file" ;;
+ (*.z) uncompress "$file" ;;
+ (*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$file" -d "$extract_dir" ;;
+ (*.rar) unrar x -ad "$file" ;;
+ (*.rpm)
+ command mkdir -p "$extract_dir" && builtin cd -q "$extract_dir" \
+ && rpm2cpio "$full_path" | cpio --quiet -id ;;
+ (*.7z) 7za x "$file" ;;
+ (*.deb)
+ command mkdir -p "$extract_dir/control" "$extract_dir/data"
+ builtin cd -q "$extract_dir"; ar vx "$full_path" > /dev/null
+ builtin cd -q control; extract ../control.tar.*
+ builtin cd -q ../data; extract ../data.tar.*
+ builtin cd -q ..; command rm *.tar.* debian-binary ;;
+ (*.zst) unzstd "$file" ;;
+ (*.cab) cabextract -d "$extract_dir" "$file" ;;
+ (*.cpio) cpio -idmvF "$file" ;;
+ (*)
+ echo "extract: '$file' cannot be extracted" >&2
+ success=1 ;;
+ esac
- (( success = $success > 0 ? $success : $? ))
- (( $success == 0 )) && (( $remove_archive == 0 )) && rm "$1"
- shift
- done
+ (( success = success > 0 ? success : $? ))
+ (( success == 0 && remove_archive == 0 )) && rm "$full_path"
+ shift
+
+ # Go back to original working directory in case we ran cd previously
+ builtin cd -q "$pwd"
+ done
}
diff --git a/plugins/fedora/README.md b/plugins/fedora/README.md
deleted file mode 100644
index 85d8d7dea..000000000
--- a/plugins/fedora/README.md
+++ /dev/null
@@ -1 +0,0 @@
-The fedora plugin is deprecated. Use the [dnf plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/dnf) instead.
diff --git a/plugins/fedora/fedora.plugin.zsh b/plugins/fedora/fedora.plugin.zsh
deleted file mode 100644
index 226506c05..000000000
--- a/plugins/fedora/fedora.plugin.zsh
+++ /dev/null
@@ -1,3 +0,0 @@
-print -P "%F{yellow}The 'fedora' plugin is deprecated. Use the '%Udnf%u' plugin instead.%f"
-
-source "$ZSH/plugins/dnf/dnf.plugin.zsh"
diff --git a/plugins/fnm/.gitignore b/plugins/fnm/.gitignore
new file mode 100644
index 000000000..0b2bc9ab7
--- /dev/null
+++ b/plugins/fnm/.gitignore
@@ -0,0 +1,2 @@
+_fnm
+
diff --git a/plugins/fnm/README.md b/plugins/fnm/README.md
new file mode 100644
index 000000000..00fab5cd4
--- /dev/null
+++ b/plugins/fnm/README.md
@@ -0,0 +1,9 @@
+# fnm plugin
+
+This plugin adds autocompletion for [fnm](https://github.com/Schniz/fnm) - a Node.js version manager.
+
+To use it, add `fnm` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... fnm)
+```
diff --git a/plugins/fnm/fnm.plugin.zsh b/plugins/fnm/fnm.plugin.zsh
new file mode 100644
index 000000000..5ce558dcb
--- /dev/null
+++ b/plugins/fnm/fnm.plugin.zsh
@@ -0,0 +1,12 @@
+# COMPLETION FUNCTION
+if (( $+commands[fnm] )); then
+ if [[ ! -f $ZSH_CACHE_DIR/fnm_version ]] \
+ || [[ "$(fnm --version)" != "$(< "$ZSH_CACHE_DIR/fnm_version")" ]] \
+ || [[ ! -f $ZSH/plugins/fnm/_fnm ]]; then
+ fnm completions --shell=zsh > $ZSH/plugins/fnm/_fnm
+ fnm --version > $ZSH_CACHE_DIR/fnm_version
+ fi
+ autoload -Uz _fnm
+ _comps[fnm]=_fnm
+fi
+
diff --git a/plugins/git/README.md b/plugins/git/README.md
index e00f4cf92..522257d2d 100644
--- a/plugins/git/README.md
+++ b/plugins/git/README.md
@@ -23,7 +23,7 @@ plugins=(... git)
| gb | git branch |
| gba | git branch -a |
| gbd | git branch -d |
-| gbda | git branch --no-color --merged \| command grep -vE "^(\+\|\*\|\s*($(git_main_branch)\|development\|develop\|devel\|dev)\s*$)" \| command xargs -n 1 git branch -d |
+| gbda | git branch --no-color --merged \| command grep -vE "^(\+\|\*\|\s*($(git_main_branch)\|$(git_develop_branch))\s*$)" \| command xargs -n 1 git branch -d |
| gbD | git branch -D |
| gbl | git blame -b -w |
| gbnm | git branch --no-merged |
@@ -49,8 +49,8 @@ plugins=(... git)
| gcl | git clone --recurse-submodules |
| gclean | git clean -id |
| gpristine | git reset --hard && git clean -dffx |
-| gcm | git checkout $(git_main_branch) |
-| gcd | git checkout develop |
+| gcm | git checkout $(git_main_branch) |
+| gcd | git checkout $(git_develop_branch) |
| gcmsg | git commit -m |
| gco | git checkout |
| gcor | git checkout --recurse-submodules |
@@ -88,7 +88,7 @@ plugins=(... git)
| ghh | git help |
| gignore | git update-index --assume-unchanged |
| gignored | git ls-files -v \| grep "^[[:lower:]]" |
-| git-svn-dcommit-push | git svn dcommit && git push github $(git_main_branch):svntrunk |
+| git-svn-dcommit-push | git svn dcommit && git push github $(git_main_branch):svntrunk |
| gk | gitk --all --branches |
| gke | gitk --all $(git log -g --pretty=%h) |
| gl | git pull |
@@ -107,10 +107,10 @@ plugins=(... git)
| gloga | git log --oneline --decorate --graph --all |
| glp | git log --pretty=\<format\> |
| gm | git merge |
-| gmom | git merge origin/$(git_main_branch) |
+| gmom | git merge origin/$(git_main_branch) |
| gmt | git mergetool --no-prompt |
| gmtvim | git mergetool --no-prompt --tool=vimdiff |
-| gmum | git merge upstream/$(git_main_branch) |
+| gmum | git merge upstream/$(git_main_branch) |
| gma | git merge --abort |
| gp | git push |
| gpd | git push --dry-run |
@@ -125,10 +125,10 @@ plugins=(... git)
| grb | git rebase |
| grba | git rebase --abort |
| grbc | git rebase --continue |
-| grbd | git rebase develop |
+| grbd | git rebase $(git_develop_branch) |
| grbi | git rebase -i |
-| grbm | git rebase $(git_main_branch) |
-| grbo | git rebase --onto |
+| grbm | git rebase $(git_main_branch) |
+| grbo | git rebase --onto |
| grbs | git rebase --skip |
| grev | git revert |
| grh | git reset |
@@ -176,7 +176,7 @@ plugins=(... git)
| gupv | git pull --rebase -v |
| gupa | git pull --rebase --autostash |
| gupav | git pull --rebase --autostash -v |
-| glum | git pull upstream $(git_main_branch) |
+| glum | git pull upstream $(git_main_branch) |
| gwch | git whatchanged -p --abbrev-commit --pretty=medium |
| gwip | git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]" |
| gam | git am |
@@ -214,13 +214,14 @@ These are aliases that have been removed, renamed, or otherwise modified in a wa
### Current
-| Command | Description |
-|:-----------------------|:-----------------------------------------------------------------------------|
-| `grename <old> <new>` | Rename `old` branch to `new`, including in origin remote |
-| current_branch | Return the name of the current branch |
-| git_current_user_name | Returns the `user.name` config value |
-| git_current_user_email | Returns the `user.email` config value |
-| git_main_branch | Returns the name of the main branch: `main` if it exists, `master` otherwise |
+| Command | Description |
+|:-----------------------|:---------------------------------------------------------------------------------------------------------|
+| `grename <old> <new>` | Rename `old` branch to `new`, including in origin remote |
+| current_branch | Return the name of the current branch |
+| git_current_user_name | Returns the `user.name` config value |
+| git_current_user_email | Returns the `user.email` config value |
+| git_main_branch | Returns the name of the main branch: `main` if it exists, `master` otherwise |
+| git_develop_branch | Returns the name of the develop branch: `dev`, `devel`, `development` if they exist, `develop` otherwise |
### Work in Progress (WIP)
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index 2a7c7290d..3cd558692 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -42,6 +42,19 @@ function git_main_branch() {
echo master
}
+# Check for develop and similarly named branches
+function git_develop_branch() {
+ command git rev-parse --git-dir &>/dev/null || return
+ local branch
+ for branch in dev devel development; do
+ if command git show-ref -q --verify refs/heads/$branch; then
+ echo $branch
+ return
+ fi
+ done
+ echo develop
+}
+
#
# Aliases
# (sorted alphabetically)
@@ -60,7 +73,7 @@ alias gapt='git apply --3way'
alias gb='git branch'
alias gba='git branch -a'
alias gbd='git branch -d'
-alias gbda='git branch --no-color --merged | command grep -vE "^(\+|\*|\s*($(git_main_branch)|development|develop|devel|dev)\s*$)" | command xargs -n 1 git branch -d'
+alias gbda='git branch --no-color --merged | command grep -vE "^(\+|\*|\s*($(git_main_branch)|$(git_develop_branch))\s*$)" | command xargs -n 1 git branch -d'
alias gbD='git branch -D'
alias gbl='git blame -b -w'
alias gbnm='git branch --no-merged'
@@ -88,7 +101,7 @@ alias gcl='git clone --recurse-submodules'
alias gclean='git clean -id'
alias gpristine='git reset --hard && git clean -dffx'
alias gcm='git checkout $(git_main_branch)'
-alias gcd='git checkout develop'
+alias gcd='git checkout $(git_develop_branch)'
alias gcmsg='git commit -m'
alias gco='git checkout'
alias gcor='git checkout --recurse-submodules'
@@ -227,7 +240,7 @@ alias gra='git remote add'
alias grb='git rebase'
alias grba='git rebase --abort'
alias grbc='git rebase --continue'
-alias grbd='git rebase develop'
+alias grbd='git rebase $(git_develop_branch)'
alias grbi='git rebase -i'
alias grbm='git rebase $(git_main_branch)'
alias grbo='git rebase --onto'
diff --git a/plugins/github/README.md b/plugins/github/README.md
index 70b863f64..af2b8a4e7 100644
--- a/plugins/github/README.md
+++ b/plugins/github/README.md
@@ -2,8 +2,8 @@
This plugin supports working with GitHub from the command line. It provides a few things:
-* Sets up the `hub` wrapper and completions for the `git` command if you have `hub` installed.
-* Completion for the `github` Ruby gem.
+* Sets up the `hub` wrapper and completions for the `git` command if you have [`hub`](https://github.com/github/hub) installed.
+* Completion for the [`github` Ruby gem](https://github.com/defunkt/github-gem).
* Convenience functions for working with repos and URLs.
### Functions
diff --git a/plugins/gnu-utils/gnu-utils.plugin.zsh b/plugins/gnu-utils/gnu-utils.plugin.zsh
index 23e00c295..539e7fe4d 100644
--- a/plugins/gnu-utils/gnu-utils.plugin.zsh
+++ b/plugins/gnu-utils/gnu-utils.plugin.zsh
@@ -36,7 +36,7 @@ __gnu_utils() {
gcmds+=('gfind' 'gxargs' 'glocate')
# Not part of either coreutils or findutils, installed separately.
- gcmds+=('gsed' 'gtar' 'gtime' 'gmake')
+ gcmds+=('gsed' 'gtar' 'gtime' 'gmake' 'ggrep')
for gcmd in "${gcmds[@]}"; do
# Do nothing if the command isn't found
diff --git a/plugins/go/README.md b/plugins/go/README.md
deleted file mode 100644
index bf43b9feb..000000000
--- a/plugins/go/README.md
+++ /dev/null
@@ -1 +0,0 @@
-The go plugin is deprecated. Use the [golang plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/golang) instead.
diff --git a/plugins/go/go.plugin.zsh b/plugins/go/go.plugin.zsh
deleted file mode 100644
index da7c87cfd..000000000
--- a/plugins/go/go.plugin.zsh
+++ /dev/null
@@ -1,3 +0,0 @@
-print -P "%F{yellow}The 'go' plugin is deprecated. Use the '%Ugolang%u' plugin instead.%f"
-
-source "$ZSH/plugins/golang/golang.plugin.zsh"
diff --git a/plugins/invoke/README.md b/plugins/invoke/README.md
new file mode 100644
index 000000000..3f4b88078
--- /dev/null
+++ b/plugins/invoke/README.md
@@ -0,0 +1,10 @@
+# Invoke plugin
+
+This plugin adds completion for [invoke](https://github.com/pyinvoke/invoke).
+
+To use it, add `invoke` to the plugins array in your `~/.zshrc` file:
+
+```zsh
+plugins=(... invoke)
+```
+
diff --git a/plugins/invoke/invoke.plugin.zsh b/plugins/invoke/invoke.plugin.zsh
new file mode 100644
index 000000000..8c807de02
--- /dev/null
+++ b/plugins/invoke/invoke.plugin.zsh
@@ -0,0 +1,5 @@
+# Autocompletion for invoke.
+#
+if [ $commands[invoke] ]; then
+ source <(invoke --print-completion-script=zsh)
+fi
diff --git a/plugins/octozen/README.md b/plugins/octozen/README.md
new file mode 100644
index 000000000..2051248ca
--- /dev/null
+++ b/plugins/octozen/README.md
@@ -0,0 +1,12 @@
+# Octozen plugin
+
+Displays a zen quote from GitHub's Octocat on start up.
+
+To use it, add `octozen` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... octozen)
+```
+
+It defines a `display_octozen` function that fetches a GitHub Octocat zen quote.
+NOTE: Internet connection is required (will time out if not fetched in 2 seconds).
diff --git a/plugins/octozen/octozen.plugin.zsh b/plugins/octozen/octozen.plugin.zsh
new file mode 100644
index 000000000..71ee550a5
--- /dev/null
+++ b/plugins/octozen/octozen.plugin.zsh
@@ -0,0 +1,11 @@
+# octozen plugin
+
+# Displays a zen quote from octocat
+function display_octozen() {
+ curl -m 2 -fsL "https://api.github.com/octocat"
+ add-zsh-hook -d precmd display_octozen
+}
+
+# Display the octocat on the first precmd, after the whole starting process has finished
+autoload -Uz add-zsh-hook
+add-zsh-hook precmd display_octozen
diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh
index 82ba6ff8c..813f64b42 100644
--- a/plugins/pyenv/pyenv.plugin.zsh
+++ b/plugins/pyenv/pyenv.plugin.zsh
@@ -1,46 +1,71 @@
# This plugin loads pyenv into the current shell and provides prompt info via
# the 'pyenv_prompt_info' function. Also loads pyenv-virtualenv if available.
-# Load pyenv only if command not already available
-if command -v pyenv &> /dev/null && [[ "$(uname -r)" != *icrosoft* ]]; then
- FOUND_PYENV=1
+# Look for pyenv in $PATH and verify that it's not a part of pyenv-win in WSL
+if ! command -v pyenv &>/dev/null; then
+ FOUND_PYENV=0
+elif [[ "${commands[pyenv]}" = */pyenv-win/* && "$(uname -r)" = *icrosoft* ]]; then
+ FOUND_PYENV=0
else
- FOUND_PYENV=0
+ FOUND_PYENV=1
fi
+# Look for pyenv and try to load it (will only work on interactive shells)
if [[ $FOUND_PYENV -ne 1 ]]; then
- pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv" "/usr/local/opt/pyenv")
- for dir in $pyenvdirs; do
- if [[ -d $dir/bin ]]; then
- export PATH="$PATH:$dir/bin"
- FOUND_PYENV=1
- break
- fi
- done
-fi
+ pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv" "/usr/local/opt/pyenv")
+ for dir in $pyenvdirs; do
+ if [[ -d "$dir/bin" ]]; then
+ FOUND_PYENV=1
+ break
+ fi
+ done
-if [[ $FOUND_PYENV -ne 1 ]]; then
+ if [[ $FOUND_PYENV -ne 1 ]]; then
if (( $+commands[brew] )) && dir=$(brew --prefix pyenv 2>/dev/null); then
- if [[ -d $dir/bin ]]; then
- export PATH="$PATH:$dir/bin"
- FOUND_PYENV=1
- fi
+ if [[ -d "$dir/bin" ]]; then
+ FOUND_PYENV=1
+ fi
fi
+ fi
+
+ # If we found pyenv, load it but show a caveat about non-interactive shells
+ if [[ $FOUND_PYENV -eq 1 ]]; then
+ cat <<EOF
+Found pyenv, but it is badly configured. pyenv might not work for
+non-interactive shells (for example, when run from a script).
+${bold_color}
+To fix this message, add these lines to the '.profile' and '.zprofile' files
+in your home directory:
+
+export PYENV_ROOT="${dir/#$HOME/\$HOME}"
+export PATH="\$PYENV_ROOT/bin:\$PATH"
+eval "\$(pyenv init --path)"
+${reset_color}
+For more info go to https://github.com/pyenv/pyenv/#installation.
+EOF
+
+ # Configuring in .zshrc only makes pyenv available for interactive shells
+ export PYENV_ROOT=$dir
+ export PATH="$PYENV_ROOT/bin:$PATH"
+ eval "$(pyenv init --path)"
+ fi
fi
if [[ $FOUND_PYENV -eq 1 ]]; then
- eval "$(pyenv init - --no-rehash zsh)"
- if (( $+commands[pyenv-virtualenv-init] )); then
- eval "$(pyenv virtualenv-init - zsh)"
- fi
- function pyenv_prompt_info() {
- echo "$(pyenv version-name)"
- }
+ eval "$(pyenv init - --no-rehash zsh)"
+
+ if (( ${+commands[pyenv-virtualenv-init]} )); then
+ eval "$(pyenv virtualenv-init - zsh)"
+ fi
+
+ function pyenv_prompt_info() {
+ echo "$(pyenv version-name)"
+ }
else
- # fallback to system python
- function pyenv_prompt_info() {
- echo "system: $(python -V 2>&1 | cut -f 2 -d ' ')"
- }
+ # Fall back to system python
+ function pyenv_prompt_info() {
+ echo "system: $(python -V 2>&1 | cut -f 2 -d ' ')"
+ }
fi
unset FOUND_PYENV pyenvdirs dir
diff --git a/tools/changelog.sh b/tools/changelog.sh
index 56ea42cb1..6913ae49a 100755
--- a/tools/changelog.sh
+++ b/tools/changelog.sh
@@ -391,9 +391,7 @@ function main {
# Get commit list from $until commit until $since commit, or until root
# commit if $since is unset, in short hash form.
- # --first-parent is used when dealing with merges: it only prints the
- # merge commit, not the commits of the merged branch.
- command git rev-list --first-parent --abbrev-commit --abbrev=7 ${since:+$since..}$until | while read hash; do
+ command git rev-list --abbrev-commit --abbrev=7 ${since:+$since..}$until | while read hash; do
# Truncate list on versions with a lot of commits
if [[ -z "$since" ]] && (( ++read_commits > 35 )); then
truncate=1