Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customising terminal title format or disabling it altogether #657

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions pure.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ prompt_pure_preexec() {

typeset -g prompt_pure_cmd_timestamp=$EPOCHSECONDS

# Shows the current directory and executed command in the title while a process is active.
prompt_pure_set_title 'ignore-escape' "$PWD:t: $2"
if ((${PURE_PROMPT_SET_TITLE:-1})); then
# Shows the current directory and executed command in the title while a process is active.
prompt_pure_set_title 'expand-prompt' "${PURE_PROMPT_TITLE_ACTIVE:-$PWD:t: $2}" "$@"
fi

# Disallow Python virtualenv from updating the prompt. Set it to 12 if
# untouched by the user to indicate that Pure modified it. Here we use
Expand Down Expand Up @@ -204,8 +206,10 @@ prompt_pure_precmd() {
prompt_pure_check_cmd_exec_time
unset prompt_pure_cmd_timestamp

# Shows the full path in the title.
prompt_pure_set_title 'expand-prompt' '%~'
if ((${PURE_PROMPT_SET_TITLE:-1})); then
# Shows the full path in the title.
prompt_pure_set_title 'expand-prompt' "${PURE_PROMPT_TITLE_IDLE:-%~}" "$@"
fi

# Modify the colors if some have changed..
prompt_pure_set_colors
Expand Down
3 changes: 3 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ prompt pure
| **`PURE_GIT_DOWN_ARROW`** | Defines the git down arrow symbol. | `⇣` |
| **`PURE_GIT_UP_ARROW`** | Defines the git up arrow symbol. | `⇡` |
| **`PURE_GIT_STASH_SYMBOL`** | Defines the git stash symbol. | `≡` |
| **`PURE_PROMPT_TITLE_IDLE`** | Defines the format of the terminal title when a command is not running | `%~` |
| **`PURE_PROMPT_TITLE_ACTIVE`** | Defines the format of the terminal title when a command is running | `$PWD:t: $2` |
| **`PURE_PROMPT_SET_TITLE`** | Whether to set the terminal title | `1` |

## Zstyle options

Expand Down