1 parent
2f3c170d1b
commit
ac40dddfa1
3 files changed
+9
-3
No files matched your search
@@ -1565,15 +1565,17 @@ There is a special command 'on-cd' that runs a shell command when it is defined
|
||||
You can define it just as you would define any other command:
|
||||
|
||||
cmd on-cd &{{
|
||||
bash -c '
|
||||
# display git repository status in your prompt
|
||||
source /usr/share/git/completion/git-prompt.sh
|
||||
GIT_PS1_SHOWDIRTYSTATE=auto
|
||||
GIT_PS1_SHOWSTASHSTATE=auto
|
||||
GIT_PS1_SHOWUNTRACKEDFILES=auto
|
||||
GIT_PS1_SHOWUPSTREAM=auto
|
||||
git=$(__git_ps1 " (%s)") || true
|
||||
git=$(__git_ps1 " (%s)")
|
||||
fmt="\033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f$git\033[0m"
|
||||
lf -remote "send $id set promptfmt \"$fmt\""
|
||||
'
|
||||
}}
|
||||
|
||||
If you want to print escape sequences, you may redirect 'printf' output to '/dev/tty'.
|
||||
|
||||
+3
-1
@@ -1717,15 +1717,17 @@ and the directory is changed. You can define it just as you would define any
|
||||
other command:
|
||||
|
||||
cmd on-cd &{{
|
||||
bash -c '
|
||||
# display git repository status in your prompt
|
||||
source /usr/share/git/completion/git-prompt.sh
|
||||
GIT_PS1_SHOWDIRTYSTATE=auto
|
||||
GIT_PS1_SHOWSTASHSTATE=auto
|
||||
GIT_PS1_SHOWUNTRACKEDFILES=auto
|
||||
GIT_PS1_SHOWUPSTREAM=auto
|
||||
git=$(__git_ps1 " (%s)") || true
|
||||
git=$(__git_ps1 " (%s)")
|
||||
fmt="\033[32;1m%u@%h\033[0m:\033[34;1m%d\033[0m\033[1m%f$git\033[0m"
|
||||
lf -remote "send $id set promptfmt \"$fmt\""
|
||||
'
|
||||
}}
|
||||
|
||||
If you want to print escape sequences, you may redirect 'printf' output to
|
||||
|
||||
@@ -1760,15 +1760,17 @@ There is a special command 'on-cd' that runs a shell command when it is defined
|
||||
.PP
|
||||
.EX
|
||||
cmd on-cd &{{
|
||||
bash -c '
|
||||
# display git repository status in your prompt
|
||||
source /usr/share/git/completion/git-prompt.sh
|
||||
GIT_PS1_SHOWDIRTYSTATE=auto
|
||||
GIT_PS1_SHOWSTASHSTATE=auto
|
||||
GIT_PS1_SHOWUNTRACKEDFILES=auto
|
||||
GIT_PS1_SHOWUPSTREAM=auto
|
||||
git=$(__git_ps1 " (%s)") || true
|
||||
git=$(__git_ps1 " (%s)")
|
||||
fmt="\e033[32;1m%u@%h\e033[0m:\e033[34;1m%d\e033[0m\e033[1m%f$git\e033[0m"
|
||||
lf -remote "send $id set promptfmt \e"$fmt\e""
|
||||
'
|
||||
}}
|
||||
.EE
|
||||
.PP
|
||||
|
||||
Reference in new issue
Block a user