From 43bf591a8b9cec1b6306a981dd805bd6eca95bdd Mon Sep 17 00:00:00 2001 From: Andy Kluger Date: Mon, 16 Nov 2020 17:11:04 -0500 Subject: [PATCH 1/8] Add variable AGKOZAK_PROMPT_DIRTRIM_CHAR (default: '...') _agkozak_prompt_dirtrim now takes this value as argument 3 (second mandatory argument) Add variable with default value to the environment (if unset) Update docs in comments accordingly Functions using the new global variable now include an annotation saying as much NOTE: The default _can_ be overridden with an empty string value; default value '...' is only used when the variable is _unset_ README: - Add note to Abbreviated Paths - Add entry in configuration variable table - Add note to new 'Unreleased' pseudo-version at top of News --- README.md | 9 +++++++-- agkozak-zsh-prompt.plugin.zsh | 22 ++++++++++++++-------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f731146..5222677 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ This prompt has been tested on numerous Linux and BSD distributions, as well as
Here are the latest features and updates. +- Unreleased + - The characters used as ellipsis with `AGKOZAK_PROMPT_DIRTRIM` (`...` by default) can now be overridden by setting `AGKOZAK_PROMPT_DIRTRIM_CHAR`. - v3.8 (July 9, 2020) - The prompt no longer defaults to `zsh-async` on Solaris and Solaris-derived operating systems, as I have noticed that `zsh-async`'s performance can be quirky on underperforming systems. - v3.7.3 (May 14, 2020) @@ -209,6 +211,8 @@ is displayed as that is, without a tilde. +Setting `AGKOZAK_PROMPT_DIRTRIM_CHAR` will override the default `...` string used for the ellipsis. + If you would like to display a different number of directory elements, set the environment variable `AGKOZAK_PROMPT_DIRTRIM` in your `.zshrc` file thus (as in the example below): AGKOZAK_PROMPT_DIRTRIM=4 # Or whatever number you like @@ -412,13 +416,13 @@ Now that the right prompt no longer does anything, you could use the `AGKOZAK_CU So far, you will have used only the following code: AGKOZAK_LEFT_PROMPT_ONLY=1 - AGKOZAK_COLORS_BRANCH_STATUS=243 + AGKOZAK_COLORS_BRANCH_STATUS=243 AGKOZAK_CUSTOM_RPROMPT='%*' The same result could be achieved by starting with the default code given at the top of this section and altering it to produce ```sh -# Exit status +# Exit status AGKOZAK_CUSTOM_PROMPT='%(?..%B%F{red}(%?%)%f%b )' # Command execution time AGKOZAK_CUSTOM_PROMPT+='%(9V.%9v .)' @@ -688,6 +692,7 @@ Option | Default | Meaning [`AGKOZAK_PRE_PROMPT_CHAR`](#optional-single-line-prompt) | ` ` | For a single-line prompt, the character or characters to display before the prompt character [`AGKOZAK_PROMPT_DEBUG`](#asynchronous-methods) | `0` | Show debugging information [`AGKOZAK_PROMPT_DIRTRIM`](#abbreviated-paths) | `2` | Number of directory elements to display; `0` turns off directory trimming +[`AGKOZAK_PROMPT_DIRTRIM_CHAR`](#abbreviated-paths) | `...` | Character or characters used as ellipsis when directory trimming [`AGKOZAK_SHOW_STASH`](#agkozak_show_stash) | `1` | Display stashed changes [`AGKOZAK_SHOW_VIRTUALENV`](#virtual-environments) | `1` | Display virtual environments [`AGKOZAK_USER_HOST_DISPLAY`](#agkozak_user_host_display) | `1` | Display the username and hostname diff --git a/agkozak-zsh-prompt.plugin.zsh b/agkozak-zsh-prompt.plugin.zsh index 55d81aa..9c6bcb6 100644 --- a/agkozak-zsh-prompt.plugin.zsh +++ b/agkozak-zsh-prompt.plugin.zsh @@ -198,6 +198,8 @@ fi : ${AGKOZAK_NAMED_DIRS:=1} # The number of path elements to display (default: 2; 0 displays the whole path) : ${AGKOZAK_PROMPT_DIRTRIM:=2} +# The ellipsis string to use when trimming paths (default: ...) +: ${AGKOZAK_PROMPT_DIRTRIM_CHAR=...} # Whether or not to display the Git stash (default: on) : ${AGKOZAK_SHOW_STASH:=1} # Whether or not to display the username and hostname (default: on) @@ -256,7 +258,8 @@ _agkozak_is_ssh() { # has more than a certain number of elements in its # directory tree, keep the number specified by # AGKOZAK_PROMPT_DIRTRIM (default: 2) and abbreviate the -# rest with `...'. (Set AGKOZAK_PROMPT_DIRTRIM=0 to disable +# rest with AGKOZAK_PROMPT_DIRTRIM_CHAR (default: `...'). +# (Set AGKOZAK_PROMPT_DIRTRIM=0 to disable # directory trimming). For example, # # $HOME/dotfiles/polyglot/img @@ -277,6 +280,7 @@ _agkozak_is_ssh() { # $1 [Optional] If `-v', store the function's output in # psvar[2] instead of printing it to STDOUT # $2 Number of directory elements to display (default: 2) +# $3 Ellipsis string (default: ...) ############################################################ _agkozak_prompt_dirtrim() { emulate -L zsh @@ -303,9 +307,9 @@ _agkozak_prompt_dirtrim() { if (( $1 )); then case $zsh_pwd in \~) output=${(%)zsh_pwd} ;; - \~/*) output="${(%):-%($(( $1 + 2 ))~|~/.../%${1}~|%~)}" ;; - \~*) output="${(%):-%($(( $1 + 2 ))~|${zsh_pwd%%${zsh_pwd#\~*\/}}.../%${1}~|%~)}" ;; - *) output="${(%):-%($(( $1 + 1 ))/|.../%${1}d|%d)}" ;; + \~/*) output="${(%):-%($(( $1 + 2 ))~|~/${2}/%${1}~|%~)}" ;; + \~*) output="${(%):-%($(( $1 + 2 ))~|${zsh_pwd%%${zsh_pwd#\~*\/}}${2}/%${1}~|%~)}" ;; + *) output="${(%):-%($(( $1 + 1 ))/|${2}/%${1}d|%d)}" ;; esac else output=$zsh_pwd @@ -339,8 +343,8 @@ _agkozak_prompt_dirtrim() { (( i++ )) done case $PWD in - ${HOME}*) output="~/...${dir#${lopped_path}}" ;; - *) output="...${PWD#${lopped_path}}" ;; + ${HOME}*) output="~/${2}${dir#${lopped_path}}" ;; + *) output="${2}${PWD#${lopped_path}}" ;; esac fi @@ -813,6 +817,7 @@ _agkozak_preexec() { # AGKOZAK_PRE_PROMPT_CHAR # AGKOZAK_BLANK_LINES # AGKOZAK_PROMPT_DIRTRIM +# AGKOZAK_PROMPT_DIRTRIM_CHAR ############################################################ _agkozak_precmd() { emulate -L zsh @@ -900,7 +905,7 @@ _agkozak_precmd() { esac # Construct and display PROMPT and RPROMPT - _agkozak_prompt_dirtrim -v ${AGKOZAK_PROMPT_DIRTRIM:-2} + _agkozak_prompt_dirtrim -v ${AGKOZAK_PROMPT_DIRTRIM:-2} ${AGKOZAK_PROMPT_DIRTRIM_CHAR-...} _agkozak_prompt_strings } @@ -974,6 +979,7 @@ _agkozak_prompt_strings() { # AGKOZAK # AGKOZAK_PROMPT_DEBUG # AGKOZAK_PROMPT_DIRTRIM +# AGKOZAK_PROMPT_DIRTRIM_CHAR ############################################################ agkozak-zsh-prompt() { emulate -L zsh @@ -1018,7 +1024,7 @@ agkozak-zsh-prompt() { if [[ $TERM == 'dumb' ]]; then PROMPT='%(?..(%?%) )' PROMPT+='%n%1v ' - PROMPT+='$(_agkozak_prompt_dirtrim "${AGKOZAK_PROMPT_DIRTRIM:-2}")' + PROMPT+='$(_agkozak_prompt_dirtrim "${AGKOZAK_PROMPT_DIRTRIM:-2}" "${AGKOZAK_PROMPT_DIRTRIM_CHAR-...}")' PROMPT+='$(_agkozak_branch_status) ' PROMPT+='%# ' else From c9fcc977fd468148b962121865fcc7b4de05b38f Mon Sep 17 00:00:00 2001 From: Alexandros Kozak Date: Sat, 12 Dec 2020 21:39:56 -0800 Subject: [PATCH 2/8] Code style --- agkozak-zsh-prompt.plugin.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/agkozak-zsh-prompt.plugin.zsh b/agkozak-zsh-prompt.plugin.zsh index 339c7d0..70f1efc 100644 --- a/agkozak-zsh-prompt.plugin.zsh +++ b/agkozak-zsh-prompt.plugin.zsh @@ -815,9 +815,8 @@ _agkozak_preexec() { ############################################################ _agkozak_precmd() { emulate -L zsh - (( AGKOZAK_PROMPT_DEBUG )) \ - && [[ $ZSH_VERSION != 5.0.[0-2] ]] \ - && setopt LOCAL_OPTIONS WARN_CREATE_GLOBAL + (( AGKOZAK_PROMPT_DEBUG )) && [[ $ZSH_VERSION != 5.0.[0-2] ]] && + setopt LOCAL_OPTIONS WARN_CREATE_GLOBAL # Calculate the time it took to run the last command psvar[8]='' From 5770946327ece4c7572e26cc9c42076ee4268e93 Mon Sep 17 00:00:00 2001 From: Alexandros Kozak Date: Sun, 13 Dec 2020 19:37:34 -0800 Subject: [PATCH 3/8] Code style --- agkozak-zsh-prompt.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agkozak-zsh-prompt.plugin.zsh b/agkozak-zsh-prompt.plugin.zsh index 70f1efc..1c3c5dc 100644 --- a/agkozak-zsh-prompt.plugin.zsh +++ b/agkozak-zsh-prompt.plugin.zsh @@ -821,7 +821,7 @@ _agkozak_precmd() { # Calculate the time it took to run the last command psvar[8]='' psvar[9]='' - if (( AGKOZAK_CMD_START_TIME )) && (( AGKOZAK_CMD_EXEC_TIME )); then + if (( AGKOZAK_CMD_START_TIME && AGKOZAK_CMD_EXEC_TIME )); then local cmd_exec_time=$(( EPOCHSECONDS - AGKOZAK_CMD_START_TIME )) if (( cmd_exec_time >= AGKOZAK_CMD_EXEC_TIME )); then psvar[8]=$cmd_exec_time @@ -886,7 +886,7 @@ _agkozak_precmd() { fi # Optionally put blank lines between instances of the prompt - (( AGKOZAK_BLANK_LINES )) && (( AGKOZAK[FIRST_PROMPT_PRINTED] )) && print + (( AGKOZAK_BLANK_LINES && AGKOZAK[FIRST_PROMPT_PRINTED] )) && print AGKOZAK[FIRST_PROMPT_PRINTED]=1 # Begin to calculate the Git status From 5db5effe3874af01828a395e99c10b50204986ff Mon Sep 17 00:00:00 2001 From: Alexandros Kozak Date: Fri, 18 Dec 2020 20:07:35 -0800 Subject: [PATCH 4/8] AGKOZAK_PROMPT_DIRTRIM_STRING - a conservative approach --- README.md | 7 +++++-- agkozak-zsh-prompt.plugin.zsh | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 139a07f..75a707c 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ This prompt has been tested on numerous Linux and BSD distributions, as well as Here are the latest features and updates. - Unreleased - - The characters used as ellipsis with `AGKOZAK_PROMPT_DIRTRIM` (`...` by default) can now be overridden by setting `AGKOZAK_PROMPT_DIRTRIM_CHAR`. + - The characters used to signify path abbreviation with `AGKOZAK_PROMPT_DIRTRIM` (`...` by default) can now be overridden with `AGKOZAK_PROMPT_DIRTRIM_STRING`. - v3.8.1 (November 23, 2020) - WSL2 now uses the `subst-async` method, while WSL1 continues to use `usr1` for reasons of speed. - The error message `permission denied: /proc/version` is no longer produced in `termux` on Android. @@ -230,6 +230,8 @@ if you have executed then `/var/www/html/wp-content` will appear in the prompt as `wp-content`, and `/var/www/html/wp-content/plugins/redirection/actions` will be represented as `~wp-content/.../redirection/actions`. If you prefer to have named directories displayed just like any others, set `AGKOZAK_NAMED_DIRS=0`. +If you want to use a string other than `...` to signify that a path has been abbreviated, you may specify it using `AGKOZAK_PROMPT_DIRTRIM_STRING`. + ## Virtual Environments ![Virtual environments](img/virtual_environments.gif) @@ -280,7 +282,7 @@ This prompt will work perfectly if you use the default ZSH Emacs editing mode; i The agkozak ZSH Prompt chooses the fastest and most reliable of three different methods for displaying the Git status asynchronously. One asynchronous method that works on all known platforms and with all supported versions of ZSH is [@psprint](https://github.com/psprint)'s `subst-async` technique, which uses process substitution (`<()`) to fork a background process that fetches the Git status and feeds it to a file descriptor. A `zle -F` callback handler then processes the input from the file descriptor and uses it to update the prompt. -`subst-async` works on Windows environments such as Cygwin, MSYS2, and WSL, but it is comparatively slow on these systems. For these platforms, the agkozak ZSH Prompt uses a method described by [Anish Athalye](http://www.anishathalye.com/2015/02/07/an-asynchronous-shell-prompt/). This `usr1` method creates and disowns child processes that calculate the Git status and then kill themselves off, triggering SIGUSR1 in the process. The ZSH `TRAPUSR1` trap function then displays that Git status. Since other scripts or the user could conceivably define `TRAPUSR1` either before or after this prompt is loaded, it regularly checks to see if that is the case and, if so, falls back to the slower but entirely reliable `subst-async` method. +`subst-async` works on Windows environments such as Cygwin, MSYS2, and WSL1, but it is comparatively slow on these systems. For these platforms, the agkozak ZSH Prompt uses a method described by [Anish Athalye](http://www.anishathalye.com/2015/02/07/an-asynchronous-shell-prompt/). This `usr1` method creates and disowns child processes that calculate the Git status and then kill themselves off, triggering SIGUSR1 in the process. The ZSH `TRAPUSR1` trap function then displays that Git status. Since other scripts or the user could conceivably define `TRAPUSR1` either before or after this prompt is loaded, it regularly checks to see if that is the case and, if so, falls back to the slower but entirely reliable `subst-async` method. This prompt also supplies a `zsh-async` method that relies on the [`zsh-async`](https://github.com/mafredri/zsh-async) library, which uses ZSH's `zsh/zpty` module to spin off pseudo-terminals that can calculate the Git status without blocking the user from continuing to use the terminal. `zsh/zpty` does not work well with Cygwin or MSYS2, however, and it can be quirky on Solaris and related operating systems, so it is no longer used by default, and is only provided for those who want it. @@ -694,6 +696,7 @@ Option | Default | Meaning [`AGKOZAK_PRE_PROMPT_CHAR`](#optional-single-line-prompt) | ` ` | For a single-line prompt, the character or characters to display before the prompt character [`AGKOZAK_PROMPT_DEBUG`](#asynchronous-methods) | `0` | Show debugging information [`AGKOZAK_PROMPT_DIRTRIM`](#abbreviated-paths) | `2` | Number of directory elements to display; `0` turns off directory trimming +[`AGKOZAK_PROMPT_DIRTRIM_STRING`] | `...` | Ellipsis string used in directory trimming [`AGKOZAK_SHOW_STASH`](#agkozak_show_stash) | `1` | Display stashed changes [`AGKOZAK_SHOW_VIRTUALENV`](#virtual-environments) | `1` | Display virtual environments [`AGKOZAK_USER_HOST_DISPLAY`](#agkozak_user_host_display) | `1` | Display the username and hostname diff --git a/agkozak-zsh-prompt.plugin.zsh b/agkozak-zsh-prompt.plugin.zsh index eaaf936..73b4d0c 100644 --- a/agkozak-zsh-prompt.plugin.zsh +++ b/agkozak-zsh-prompt.plugin.zsh @@ -199,7 +199,7 @@ fi # The number of path elements to display (default: 2; 0 displays the whole path) : ${AGKOZAK_PROMPT_DIRTRIM:=2} # The ellipsis string to use when trimming paths (default: ...) -: ${AGKOZAK_PROMPT_DIRTRIM_CHAR=...} +: ${AGKOZAK_PROMPT_DIRTRIM_STRING:=...} # Whether or not to display the Git stash (default: on) : ${AGKOZAK_SHOW_STASH:=1} # Whether or not to display the username and hostname (default: on) @@ -258,7 +258,7 @@ _agkozak_is_ssh() { # has more than a certain number of elements in its # directory tree, keep the number specified by # AGKOZAK_PROMPT_DIRTRIM (default: 2) and abbreviate the -# rest with AGKOZAK_PROMPT_DIRTRIM_CHAR (default: `...'). +# rest with AGKOZAK_PROMPT_DIRTRIM_STRING (default: `...'). # (Set AGKOZAK_PROMPT_DIRTRIM=0 to disable # directory trimming). For example, # @@ -277,10 +277,9 @@ _agkozak_is_ssh() { # AGKOZAK_PROMPT_DEBUG # AGKOZAK_NAMED_DIRS # Arguments: -# $1 [Optional] If `-v', store the function's output in +# [Optional] If `-v', store the function's output in # psvar[2] instead of printing it to STDOUT -# $2 Number of directory elements to display (default: 2) -# $3 Ellipsis string (default: ...) +# [Optional] Number of directory elements to display (default: 2) ############################################################ _agkozak_prompt_dirtrim() { emulate -L zsh @@ -296,6 +295,9 @@ _agkozak_prompt_dirtrim() { done [[ $1 -ge 0 ]] || set 2 + # The ellipsis string (default: ...) + local ellipsis=${AGKOZAK_PROMPT_DIRTRIM_STRING} + local output # Default behavior (when AGKOZAK_NAMED_DIRS is 1) @@ -307,9 +309,9 @@ _agkozak_prompt_dirtrim() { if (( $1 )); then case $zsh_pwd in \~) output=${(%)zsh_pwd} ;; - \~/*) output="${(%):-%($(( $1 + 2 ))~|~/${2}/%${1}~|%~)}" ;; - \~*) output="${(%):-%($(( $1 + 2 ))~|${zsh_pwd%%${zsh_pwd#\~*\/}}${2}/%${1}~|%~)}" ;; - *) output="${(%):-%($(( $1 + 1 ))/|${2}/%${1}d|%d)}" ;; + \~/*) output="${(%):-%($(( $1 + 2 ))~|~/${ellipsis}/%${1}~|%~)}" ;; + \~*) output="${(%):-%($(( $1 + 2 ))~|${zsh_pwd%%${zsh_pwd#\~*\/}}${ellipsis}/%${1}~|%~)}" ;; + *) output="${(%):-%($(( $1 + 1 ))/|${ellipsis}/%${1}d|%d)}" ;; esac else output=$zsh_pwd @@ -343,8 +345,8 @@ _agkozak_prompt_dirtrim() { (( i++ )) done case $PWD in - ${HOME}*) output="~/${2}${dir#${lopped_path}}" ;; - *) output="${2}${PWD#${lopped_path}}" ;; + ${HOME}*) output="~/${ellipsis}${dir#${lopped_path}}" ;; + *) output="${ellipsis}${PWD#${lopped_path}}" ;; esac fi @@ -816,7 +818,6 @@ _agkozak_preexec() { # AGKOZAK_PRE_PROMPT_CHAR # AGKOZAK_BLANK_LINES # AGKOZAK_PROMPT_DIRTRIM -# AGKOZAK_PROMPT_DIRTRIM_CHAR ############################################################ _agkozak_precmd() { emulate -L zsh @@ -903,7 +904,7 @@ _agkozak_precmd() { esac # Construct and display PROMPT and RPROMPT - _agkozak_prompt_dirtrim -v ${AGKOZAK_PROMPT_DIRTRIM:-2} ${AGKOZAK_PROMPT_DIRTRIM_CHAR-...} + _agkozak_prompt_dirtrim -v ${AGKOZAK_PROMPT_DIRTRIM:-2} _agkozak_prompt_strings } @@ -977,7 +978,6 @@ _agkozak_prompt_strings() { # AGKOZAK # AGKOZAK_PROMPT_DEBUG # AGKOZAK_PROMPT_DIRTRIM -# AGKOZAK_PROMPT_DIRTRIM_CHAR ############################################################ agkozak-zsh-prompt() { emulate -L zsh @@ -1022,7 +1022,7 @@ agkozak-zsh-prompt() { if [[ $TERM == 'dumb' ]]; then PROMPT='%(?..(%?%) )' PROMPT+='%n%1v ' - PROMPT+='$(_agkozak_prompt_dirtrim "${AGKOZAK_PROMPT_DIRTRIM:-2}" "${AGKOZAK_PROMPT_DIRTRIM_CHAR-...}")' + PROMPT+='$(_agkozak_prompt_dirtrim "${AGKOZAK_PROMPT_DIRTRIM:-2}")' PROMPT+='$(_agkozak_branch_status) ' PROMPT+='%# ' else From 520fc8eef77a4f3ba29141ca900011220c50cf5b Mon Sep 17 00:00:00 2001 From: Alexandros Kozak Date: Fri, 18 Dec 2020 20:35:15 -0800 Subject: [PATCH 5/8] Set default ellipsis string inside function --- agkozak-zsh-prompt.plugin.zsh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/agkozak-zsh-prompt.plugin.zsh b/agkozak-zsh-prompt.plugin.zsh index 73b4d0c..1d3c11c 100644 --- a/agkozak-zsh-prompt.plugin.zsh +++ b/agkozak-zsh-prompt.plugin.zsh @@ -198,8 +198,6 @@ fi : ${AGKOZAK_NAMED_DIRS:=1} # The number of path elements to display (default: 2; 0 displays the whole path) : ${AGKOZAK_PROMPT_DIRTRIM:=2} -# The ellipsis string to use when trimming paths (default: ...) -: ${AGKOZAK_PROMPT_DIRTRIM_STRING:=...} # Whether or not to display the Git stash (default: on) : ${AGKOZAK_SHOW_STASH:=1} # Whether or not to display the username and hostname (default: on) @@ -295,8 +293,8 @@ _agkozak_prompt_dirtrim() { done [[ $1 -ge 0 ]] || set 2 - # The ellipsis string (default: ...) - local ellipsis=${AGKOZAK_PROMPT_DIRTRIM_STRING} + # The ellipsis string to use when trimming paths (default: ...) + local ellipsis=${AGKOZAK_PROMPT_DIRTRIM_STRING:-...} local output From 215512c5fcb3510433d92cb39e7608c7938aa119 Mon Sep 17 00:00:00 2001 From: Alexandros Kozak Date: Sat, 19 Dec 2020 13:15:40 -0800 Subject: [PATCH 6/8] AGKOZAK_PROMPT_DIRTRIM_STRING example --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 75a707c..541758d 100644 --- a/README.md +++ b/README.md @@ -230,7 +230,11 @@ if you have executed then `/var/www/html/wp-content` will appear in the prompt as `wp-content`, and `/var/www/html/wp-content/plugins/redirection/actions` will be represented as `~wp-content/.../redirection/actions`. If you prefer to have named directories displayed just like any others, set `AGKOZAK_NAMED_DIRS=0`. -If you want to use a string other than `...` to signify that a path has been abbreviated, you may specify it using `AGKOZAK_PROMPT_DIRTRIM_STRING`. +If you want to use a string other than `...` to signify that a path has been abbreviated, you may specify it using `AGKOZAK_PROMPT_DIRTRIM_STRING`. For example, + + AGKOZAK_PROMPT_DIRTRIM_STRING=$'\u2026' + +will replace the default three dots (`...`) with a Unicode ellipsis (`…`), which can free up a little screen space if your terminal font supports it. ## Virtual Environments From 8c6c917501efe41d5f6b42139dcb55a44f1e2449 Mon Sep 17 00:00:00 2001 From: Alexandros Kozak Date: Sat, 19 Dec 2020 13:33:24 -0800 Subject: [PATCH 7/8] Tab completion for AGKOZAK_DIRTRIM_PROMPT_STRING --- agkozak-zsh-prompt.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/agkozak-zsh-prompt.plugin.zsh b/agkozak-zsh-prompt.plugin.zsh index 1d3c11c..919dd31 100644 --- a/agkozak-zsh-prompt.plugin.zsh +++ b/agkozak-zsh-prompt.plugin.zsh @@ -198,6 +198,8 @@ fi : ${AGKOZAK_NAMED_DIRS:=1} # The number of path elements to display (default: 2; 0 displays the whole path) : ${AGKOZAK_PROMPT_DIRTRIM:=2} +# The string to use to indicate that a path has been abbreviated (default: ...) +: ${AGKOZAK_PROMPT_DIRTRIM_STRING:=...} # Whether or not to display the Git stash (default: on) : ${AGKOZAK_SHOW_STASH:=1} # Whether or not to display the username and hostname (default: on) From c3da737204f2135be8036479b3cb3726e6ef66df Mon Sep 17 00:00:00 2001 From: Alexandros Kozak Date: Mon, 21 Dec 2020 19:26:36 -0800 Subject: [PATCH 8/8] v3.9.0 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 541758d..d0fcac4 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ This prompt has been tested on numerous Linux and BSD distributions, as well as
Here are the latest features and updates. -- Unreleased +- v3.9.0 - The characters used to signify path abbreviation with `AGKOZAK_PROMPT_DIRTRIM` (`...` by default) can now be overridden with `AGKOZAK_PROMPT_DIRTRIM_STRING`. - v3.8.1 (November 23, 2020) - WSL2 now uses the `subst-async` method, while WSL1 continues to use `usr1` for reasons of speed.