mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2025-12-25 22:22:31 +01:00
make the POWERLEVEL9K_DIR_HYPERLINKs actually open in WSL. Add a setting POWERLEVEL9K_WSL_NETWORK_DRIVE to specify the wsl root, as well as recognizing /mnt/? and />/
This commit is contained in:
parent
9571fa1e75
commit
db7b18c5d3
5 changed files with 39 additions and 1 deletions
|
|
@ -2119,7 +2119,17 @@ prompt_dir() {
|
|||
|
||||
local content="${(pj.$sep.)parts}"
|
||||
if (( _POWERLEVEL9K_DIR_HYPERLINK && _p9k_term_has_href )) && [[ $_p9k__cwd == /* ]]; then
|
||||
_p9k_href $'file://'${${_p9k__cwd//\%/%%25}//'#'/%%23} $content $expand
|
||||
local dirpath=${${_p9k__cwd//\%/%%25}//'#'/%%23}
|
||||
|
||||
if (( $+commands[wslpath] )); then
|
||||
if [[ -n $_POWERLEVEL9K_WSL_NETWORK_DRIVE && $(wslpath -w ${_p9k__cwd}) == \\\\* ]]; then
|
||||
dirpath=$_POWERLEVEL9K_WSL_NETWORK_DRIVE$dirpath
|
||||
elif [[ $dirpath =~ '^(/(mnt/)*(.))/' ]]; then
|
||||
dirpath=$match[3]:${dirpath:${#match[1]}}
|
||||
fi
|
||||
fi
|
||||
|
||||
_p9k_href $'file://'$dirpath $content $expand
|
||||
content=$_p9k__ret
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue