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
Changes from 1 commit
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
Prev Previous commit
Allow disabling terminal title altogether
benjamineskola committed Apr 28, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit b150fb6e7f7cc0424e144b0af366a4e9837423ea
12 changes: 8 additions & 4 deletions pure.zsh
Original file line number Diff line number Diff line change
@@ -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 'expand-prompt' "${PURE_PROMPT_TITLE_ACTIVE:-$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
@@ -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' "${PURE_PROMPT_TITLE_IDLE:-%~}" "$@"
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
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -129,6 +129,7 @@ prompt pure
| **`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