feat(zsh): WSL 下让 Windows Terminal 新标签继承当前目录

This commit is contained in:
2026-04-08 13:34:57 +08:00
parent e9a77f907e
commit e34d7da3ea
+8 -1
View File
@@ -84,10 +84,17 @@ function yy() {
command rm -f -- "$tmp"
}
# ── WSL 剪贴板 ──
# ── WSL 集成 ──
if [[ -n "$WSL_DISTRO_NAME" ]]; then
# 剪贴板互通
alias pbcopy="clip.exe"
alias pbpaste="powershell.exe -noprofile -c Get-Clipboard"
# Windows Terminal: 新标签/窗格继承当前目录(OSC 9;9 序列)
keep_current_path() {
printf "\e]9;9;%s\e\\" "$(wslpath -w "$PWD")"
}
precmd_functions+=(keep_current_path)
fi
# ── Local ──