Skip to content

Commit 03244a8

Browse files
committed
Renaming repo to agkozak-zsh-prompt
1 parent 393e6b4 commit 03244a8

File tree

2 files changed

+44
-44
lines changed

2 files changed

+44
-44
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# agkozak ZSH Prompt
22

33
[![MIT License](img/mit_license.svg)](https://opensource.org/licenses/MIT)
4-
[![GitHub tag](https://img.shields.io/github/tag/agkozak/agkozak-zsh-theme.svg)](https://GitHub.com/agkozak/agkozak-zsh-theme/tags/)
4+
[![GitHub tag](https://img.shields.io/github/tag/agkozak/agkozak-zsh-prompt.svg)](https://GitHub.com/agkozak/agkozak-zsh-prompt/tags/)
55
![zsh version 4.3.11 and higher](img/zsh_4.3.11_plus.svg)
6-
[![GitHub Stars](https://img.shields.io/github/stars/agkozak/agkozak-zsh-theme.svg)](https://github.com/agkozak/agkozak-zsh-theme/stargazers)
6+
[![GitHub Stars](https://img.shields.io/github/stars/agkozak/agkozak-zsh-prompt.svg)](https://github.com/agkozak/agkozak-zsh-prompt/stargazers)
77

88
The agkozak ZSH Prompt is an asynchronous, dynamic color Git prompt for `zsh` that uses basic ASCII symbols to show:
99

@@ -16,7 +16,7 @@ The agkozak ZSH Prompt is an asynchronous, dynamic color Git prompt for `zsh` th
1616

1717
This prompt has been tested on numerous Linux and BSD distributions, as well as on Solaris 11.3. It also has full asynchronous functionality in Windows environments such as MSYS2, Cygwin, and WSL.
1818

19-
![agkozak-zsh-theme](img/demo.gif)
19+
![The agkozak ZSH Prompt](img/demo.gif)
2020

2121
## Table of Contents
2222

@@ -38,17 +38,17 @@ This prompt has been tested on numerous Linux and BSD distributions, as well as
3838

3939
The agkozak ZSH prompt requires no framework and can be simply sourced from your `.zshrc` file. Clone the git repo:
4040

41-
git clone https://github.com/agkozak/agkozak-zsh-theme
41+
git clone https://github.com/agkozak/agkozak-zsh-prompt
4242

4343
And add the following to your `.zshrc` file:
4444

45-
source /path/to/agkozak-zsh-theme.plugin.zsh
45+
source /path/to/agkozak-zsh-prompt.plugin.zsh
4646

4747
### For [antigen](https://github.com/zsh-users/antigen) users
4848

4949
Add the line
5050

51-
antigen bundle agkozak/agkozak-zsh-theme
51+
antigen bundle agkozak/agkozak-zsh-prompt
5252

5353
to your `.zshrc`, somewhere before the line that says `antigen apply`.
5454

@@ -59,32 +59,32 @@ to your `.zshrc`, somewhere before the line that says `antigen apply`.
5959
Execute the following commands:
6060

6161
[[ ! -d $ZSH_CUSTOM/themes ]] && mkdir $ZSH_CUSTOM/themes
62-
git clone https://github.com/agkozak/agkozak-zsh-theme $ZSH_CUSTOM/themes/agkozak
63-
ln -s $ZSH_CUSTOM/themes/agkozak/agkozak-zsh-theme.plugin.zsh $ZSH_CUSTOM/themes/agkozak.zsh-theme
62+
git clone https://github.com/agkozak/agkozak-zsh-prompt $ZSH_CUSTOM/themes/agkozak
63+
ln -s $ZSH_CUSTOM/themes/agkozak/agkozak-zsh-prompt.plugin.zsh $ZSH_CUSTOM/themes/agkozak.zsh-theme
6464

6565
And set `ZSH_THEME=agkozak` in your `.zshrc` file.
6666

6767
### For [zgen](https://github.com/tarjoilija/zgen) users
6868

6969
Add the line
7070

71-
zgen load agkozak/agkozak-zsh-theme
71+
zgen load agkozak/agkozak-zsh-prompt
7272

7373
to your `.zshrc` somewhere before the line that says `zgen save`.
7474

7575
### For [zplug](https://github.com/zplug/zplug) users
7676

7777
Add the line
7878

79-
zplug "agkozak/agkozak-zsh-theme"
79+
zplug "agkozak/agkozak-zsh-prompt"
8080

8181
to your `.zshrc` somewhere before the line that says `zplug load`.
8282

8383
### For [zplugin](https://github.com/zdharma/zplugin) users
8484

8585
Run the command
8686

87-
zplugin load agkozak/agkozak-zsh-theme
87+
zplugin load agkozak/agkozak-zsh-prompt
8888

8989
to try out the prompt; add the same command to your `.zshrc` to load it automatically.
9090

@@ -165,15 +165,15 @@ If you prefer to have a little space between instances of the prompt, put `AGKOZ
165165

166166
## Optional Single-Line Prompt
167167

168-
Older versions of the agkozak ZSH Prompt provided a single-line prompt. [Because of changes made in ZSH 5.5](https://github.com/agkozak/agkozak-zsh-theme/issues/6) that affect the calculation of cursor position when the prompt wraps, it has become difficult to ensure that in that situation the cursor will land where it is supposed to, i.e. two positions after the `%` or `#` and not on top of the left prompt or after the right prompt. I have made the default prompt two-line, which fixes the problem entirely, but if you prefer a single-line prompt and are willing to put up with the occasional glitch, put
168+
Older versions of the agkozak ZSH Prompt provided a single-line prompt. [Because of changes made in ZSH 5.5](https://github.com/agkozak/agkozak-zsh-prompt/issues/6) that affect the calculation of cursor position when the prompt wraps, it has become difficult to ensure that in that situation the cursor will land where it is supposed to, i.e. two positions after the `%` or `#` and not on top of the left prompt or after the right prompt. I have made the default prompt two-line, which fixes the problem entirely, but if you prefer a single-line prompt and are willing to put up with the occasional glitch, put
169169

170170
AGKOZAK_MULTILINE=0
171171

172-
in your `.zshrc` before you source agkozak-zsh-theme.
172+
in your `.zshrc` before you source agkozak-zsh-prompt.
173173

174174
Demo:
175175

176-
[![agkozak-zsh-theme (Singe-Line)](https://asciinema.org/a/155904.png)](https://asciinema.org/a/155904)
176+
[![agkozak ZSH Prompt (Singe-Line)](https://asciinema.org/a/155904.png)](https://asciinema.org/a/155904)
177177

178178
## Custom Colors
179179
If you would like to customize the prompt colors, change any of the `AGKOZAK_COLORS_*` variables from their defaults to any valid color and add it to your `.zshrc`. The following are the available color variables and their defaults:
@@ -208,11 +208,11 @@ The agkozak ZSH Prompt has two different ways of displaying its Git status async
208208

209209
The `zsh-async`-based method uses the `zsh/zpty` library to spin off pseudo-terminals that can calculate the Git status without blocking the user from continuing to use the terminal. Unfortunately, `zsh/zpty` does not work well or at all on many systems: Cygwin and MSYS2 are notable examples, but even some installations of BSD or Linux or certain point releases of `zsh` do not support using `zsh/zpty` for the present purpose.
210210

211-
The second method is quite similar to the first; it involves creating and disowning child processes that calculate the Git status and then kill themselves off, triggering SIGUSR1 in the process. The `zsh` `TRAPUSR1` function then displays the Git status in the right prompt. The problem with this method is that other `zsh` scripts might choose to use `TRAPUSR1`, so the agkozak ZSH Prompt takes the precaution of checking to see if that function has been defined already -- if it has, the theme switches off asynchronous mode entirely. It also routinely checks to see if some other script or the user has redefined `TRAPUSR1` and switches off asynchronous mode out of precaution.
211+
The second method is quite similar to the first; it involves creating and disowning child processes that calculate the Git status and then kill themselves off, triggering SIGUSR1 in the process. The `zsh` `TRAPUSR1` function then displays the Git status in the right prompt. The problem with this method is that other `zsh` scripts might choose to use `TRAPUSR1`, so the agkozak ZSH Prompt takes the precaution of checking to see if that function has been defined already -- if it has, the prompt switches off asynchronous mode entirely. It also routinely checks to see if some other script or the user has redefined `TRAPUSR1` and switches off asynchronous mode out of precaution.
212212

213-
If you want to force the agkozak ZSH Prompt to use a specific asynchronous mode (or none at all), execute `export AGKOZAK_FORCE_ASYNC_METHOD=zsh-async`, `usr1`, or `none` before sourcing it. If you want more insight into how the theme is working in your shell, put `export AGKOZAK_THEME_DEBUG=1` in your `.zshrc`.
213+
If you want to force the agkozak ZSH Prompt to use a specific asynchronous mode (or none at all), execute `export AGKOZAK_FORCE_ASYNC_METHOD=zsh-async`, `usr1`, or `none` before sourcing it. If you want more insight into how the prompt is working in your shell, put `export AGKOZAK_PROMPT_DEBUG=1` in your `.zshrc`.
214214

215215

216216
<p align="center">
217-
<img src="img/logo.png" alt="agkozak-zsh-theme Logo">
217+
<img src="img/logo.png" alt="agkozak ZSH Prompt Logo">
218218
</p>
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
# SOFTWARE.
3333
#
3434
#
35-
# https://github.com/agkozak/agkozak-zsh-theme
35+
# https://github.com/agkozak/agkozak-zsh-prompt
3636
#
3737

3838
# shellcheck disable=SC2034,SC2088,SC2148,SC2154,SC2190
@@ -48,10 +48,10 @@
4848
# psvar[3] %3v Current working Git branch, along
4949
# with indicator of changes made
5050

51-
# Set AGKOZAK_THEME_DEBUG to 1 to see debugging information
52-
AGKOZAK_THEME_DEBUG=${AGKOZAK_THEME_DEBUG:-0}
51+
# Set AGKOZAK_PROMPT_DEBUG to 1 to see debugging information
52+
AGKOZAK_PROMPT_DEBUG=${AGKOZAK_PROMPT_DEBUG:-0}
5353

54-
if (( AGKOZAK_THEME_DEBUG )); then
54+
if (( AGKOZAK_PROMPT_DEBUG )); then
5555
autoload -Uz is-at-least
5656

5757
setopt WARN_CREATE_GLOBAL
@@ -201,22 +201,22 @@ TRAPWINCH() {
201201
# ASYNCHRONOUS FUNCTIONS
202202
###########################################################
203203

204-
typeset -g AGKOZAK_THEME_DIR=${0:A:h}
204+
typeset -g AGKOZAK_PROMPT_DIR=${0:A:h}
205205

206206
###########################################################
207207
# If zsh-async has not already been loaded, try to load it;
208208
# the exit code should indicate success or failure
209209
#
210210
# Globals:
211-
# AGKOZAK_THEME_DEBUG
212-
# AGKOZAK_THEME_DIR
211+
# AGKOZAK_PROMPT_DEBUG
212+
# AGKOZAK_PROMPT_DIR
213213
###########################################################
214214
_agkozak_load_async_lib() {
215215
if ! whence -w async_init &> /dev/null; then # Don't load zsh-async twice
216-
if (( AGKOZAK_THEME_DEBUG )); then
217-
source "${AGKOZAK_THEME_DIR}/lib/async.zsh"
216+
if (( AGKOZAK_PROMPT_DEBUG )); then
217+
source "${AGKOZAK_PROMPT_DIR}/lib/async.zsh"
218218
else
219-
source "${AGKOZAK_THEME_DIR}/lib/async.zsh" &> /dev/null
219+
source "${AGKOZAK_PROMPT_DIR}/lib/async.zsh" &> /dev/null
220220
fi
221221
local success=$?
222222
return $success
@@ -228,17 +228,17 @@ _agkozak_load_async_lib() {
228228
# zsh, use it; otherwise disable asynchronous mode
229229
#
230230
# Globals:
231-
# AGKOZAK_THEME_DEBUG
231+
# AGKOZAK_PROMPT_DEBUG
232232
###########################################################
233233
_agkozak_has_usr1() {
234234
if whence -w TRAPUSR1 &> /dev/null; then
235-
(( AGKOZAK_THEME_DEBUG )) && echo 'agkozak-zsh-theme: TRAPUSR1 already defined.' >&2
235+
(( AGKOZAK_PROMPT_DEBUG )) && echo 'agkozak-zsh-prompt: TRAPUSR1 already defined.' >&2
236236
false
237237
else
238238
case $signals in # Array containing names of available signals
239239
*USR1*) true ;;
240240
*)
241-
(( AGKOZAK_THEME_DEBUG )) && echo 'agkozak-zsh-theme: SIGUSR1 not available.' >&2
241+
(( AGKOZAK_PROMPT_DEBUG )) && echo 'agkozak-zsh-prompt: SIGUSR1 not available.' >&2
242242
false
243243
;;
244244
esac
@@ -339,7 +339,7 @@ _agkozak_async_init() {
339339
# precmd uses this function to launch async workers to
340340
# calculate the Git status. It can tell if anything has
341341
# redefined the TRAPUSR1 function that actually
342-
# displays the status; if so, it will drop the theme
342+
# displays the status; if so, it will drop the prompt
343343
# down into non-asynchronous mode.
344344
#
345345
# Globals:
@@ -358,7 +358,7 @@ _agkozak_async_init() {
358358
_agkozak_usr1_async_worker &!
359359
typeset -g AGKOZAK_USR1_ASYNC_WORKER=$!
360360
else
361-
echo 'agkozak-zsh-theme: TRAPUSR1 has been redefined. Disabling asynchronous mode.' >&2
361+
echo 'agkozak-zsh-prompt: TRAPUSR1 has been redefined. Disabling asynchronous mode.' >&2
362362
typeset -g AGKOZAK_ASYNC_METHOD='none'
363363
fi
364364
}
@@ -367,14 +367,14 @@ _agkozak_async_init() {
367367
# Asynchronous Git branch status using SIGUSR1
368368
#
369369
# Globals:
370-
# AGKOZAK_THEME_DEBUG
370+
# AGKOZAK_PROMPT_DEBUG
371371
########################################################
372372
_agkozak_usr1_async_worker() {
373373
# Save Git branch status to temporary file
374-
_agkozak_branch_status > "/tmp/agkozak_zsh_theme_$$"
374+
_agkozak_branch_status > "/tmp/agkozak_zsh_prompt_$$"
375375

376376
# Signal parent process
377-
if (( AGKOZAK_THEME_DEBUG )); then
377+
if (( AGKOZAK_PROMPT_DEBUG )); then
378378
kill -s USR1 $$
379379
else
380380
kill -s USR1 $$ &> /dev/null
@@ -389,7 +389,7 @@ _agkozak_async_init() {
389389
########################################################
390390
TRAPUSR1() {
391391
# read from temp file
392-
psvar[3]="$(cat /tmp/agkozak_zsh_theme_$$)"
392+
psvar[3]="$(cat /tmp/agkozak_zsh_prompt_$$)"
393393

394394
# Reset asynchronous process number
395395
typeset -g AGKOZAK_USR1_ASYNC_WORKER=0
@@ -499,16 +499,16 @@ _agkozak_precmd() {
499499
}
500500

501501
############################################################
502-
# Theme setup
502+
# Prompt setup
503503
#
504504
# Globals:
505505
# AGKOZAK_ASYNC_METHOD
506506
# AGKOZAK_USR1_ASYNC_WORKER
507-
# AGKOZAK_THEME_DEBUG
508-
# AGKOZAK_THEME_DIR
507+
# AGKOZAK_PROMPT_DEBUG
508+
# AGKOZAK_PROMPT_DIR
509509
# AGKOZAK_HAS_COLORS
510510
############################################################
511-
agkozak_zsh_theme() {
511+
agkozak_zsh_prompt() {
512512

513513
_agkozak_async_init
514514

@@ -585,15 +585,15 @@ agkozak_zsh_theme() {
585585

586586
fi
587587

588-
if (( AGKOZAK_THEME_DEBUG )); then
589-
echo "agkozak-zsh-theme: using async method: $AGKOZAK_ASYNC_METHOD" >&2
588+
if (( AGKOZAK_PROMPT_DEBUG )); then
589+
echo "agkozak-zsh-prompt: using async method: $AGKOZAK_ASYNC_METHOD" >&2
590590
fi
591591
}
592592

593-
agkozak_zsh_theme
593+
agkozak_zsh_prompt
594594

595595
# Clean up environment
596-
unset AGKOZAK_THEME_DIR
596+
unset AGKOZAK_PROMPT_DIR
597597
unfunction _agkozak_load_async_lib _agkozak_has_usr1 \
598598
_agkozak_is_ssh
599599

0 commit comments

Comments
 (0)