New feature: now shows current path in the title
and current directory and command when a process is running.
This commit is contained in:
9
pure.zsh
9
pure.zsh
@@ -55,12 +55,21 @@
|
|||||||
|
|
||||||
pure_preexec() {
|
pure_preexec() {
|
||||||
cmd_timestamp=`date +%s`
|
cmd_timestamp=`date +%s`
|
||||||
|
|
||||||
|
# shows the current dir and executed command in the title when a process is active
|
||||||
|
print -Pn "\e]0;$PWD:t: $2\a"
|
||||||
}
|
}
|
||||||
|
|
||||||
pure_precmd() {
|
pure_precmd() {
|
||||||
|
# shows the full path in the title
|
||||||
|
print -Pn '\e]0;%~\a'
|
||||||
|
|
||||||
|
# git info
|
||||||
vcs_info
|
vcs_info
|
||||||
|
|
||||||
# add `%*` to display the time
|
# add `%*` to display the time
|
||||||
print -P '\n%F{blue}%~%F{8}$vcs_info_msg_0_`pure_git_dirty` $username%f %F{yellow}`pure_cmd_exec_time`%f'
|
print -P '\n%F{blue}%~%F{8}$vcs_info_msg_0_`pure_git_dirty` $username%f %F{yellow}`pure_cmd_exec_time`%f'
|
||||||
|
|
||||||
# reset value since `preexec` isn't always triggered
|
# reset value since `preexec` isn't always triggered
|
||||||
unset cmd_timestamp
|
unset cmd_timestamp
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
> Pretty, minimal and fast ZSH prompt
|
> Pretty, minimal and fast ZSH prompt
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
@@ -16,6 +16,7 @@ Most prompts are cluttered, ugly and slow. I wanted something visually pleasing
|
|||||||
- Prompt character turns red if the last command didn't exit with 0.
|
- Prompt character turns red if the last command didn't exit with 0.
|
||||||
- Command execution time will be displayed if it exceeds the set threshold.
|
- Command execution time will be displayed if it exceeds the set threshold.
|
||||||
- Username and host is only displayed when in an SSH session.
|
- Username and host is only displayed when in an SSH session.
|
||||||
|
- Shows the current path in the title and the current directory and command when a process is running.
|
||||||
- Can easily be used as a starting point for your own custom prompt.
|
- Can easily be used as a starting point for your own custom prompt.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 42 KiB |
Reference in New Issue
Block a user