1
0
Fork 0

lf: fix prompt at root

This commit is contained in:
Luca Bilke 2024-08-06 14:46:58 +02:00
parent bf6c2a5562
commit 1fe17d2082
Signed by: luca
GPG Key ID: F6E11C9BAA7C82F5
4 changed files with 6 additions and 8 deletions

View File

@ -72,8 +72,8 @@ cmd link &{{
cmd bulkrename $vidir
cmd on-cd &{{
lf -remote "send $id set promptfmt \"$(zsh -c 'source $ZDOTDIR/configs/prompt; source $ZDOTDIR/configs/hashes; print -P $LF_PROMPT')\""
printf "%b" "\033]0;$(zsh -c 'source $ZDOTDIR/configs/prompt; source $ZDOTDIR/configs/hashes; print -P $LF_TITLE')\007" > /dev/tty
lf -remote "send $id set promptfmt \"$(${HOME}/.local/libexec/lf_prompt)\""
printf "%b" "\033]0;$(zsh -c 'print -P %n@%m [%3~] ')\007" > /dev/tty
}}
cmd on-quit &printf "\033]0; $(echo $PWD | sed "s|$HOME|~|")\007" > /dev/tty

View File

@ -19,7 +19,7 @@ function lfwrap() {
LF_DIRFILE="$(mktemp -u)"
env lfX -last-dir-path="$LF_DIRFILE" \
-command "set promptfmt \"$(zsh -c 'source $ZDOTDIR/configs/prompt; source $ZDOTDIR/configs/hashes; print -P $LF_PROMPT')\""
-command "set promptfmt \"$(${HOME}/.local/libexec/lf_prompt)\""
dir="$(cat "$LF_DIRFILE")"
rm "$LF_DIRFILE" &>/dev/null

View File

@ -1,5 +1,8 @@
#!/bin/zsh
export PROMPT='%B%F{blue}%n%F{cyan}@%F{blue}%m %F{magenta}[%F{white}%3~%F{magenta}] %(?.%F{green}.%F{red})»%f%b '
export RPROMPT='%(?..%F{red}%?) $(venv_prompt)'
[ ! -f $XDG_DATA_HOME/zsh/history ] && mkdir -p $XDG_DATA_HOME/zsh && touch $XDG_DATA_HOME/zsh/history
fpath=($XDG_CONFIG_HOME/zsh/completions $fpath)

View File

@ -1,5 +0,0 @@
export PROMPT='%B%F{blue}%n%F{cyan}@%F{blue}%m %F{magenta}[%F{white}%3~%F{magenta}] %(?.%F{green}.%F{red})»%f%b '
export RPROMPT='%(?..%F{red}%?) $(venv_prompt)'
export LF_PROMPT='%B%F{blue}%n%F{cyan}@%F{blue}%m %F{magenta}[%F{white}%3~/%F{yellow}%%f%f%F{magenta}]'
export LF_TITLE='%n@%m [%3~] '