From e34d7da3ea953841ac948a49bf7e86d7cc6a7c93 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Wed, 8 Apr 2026 13:34:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(zsh):=20WSL=20=E4=B8=8B=E8=AE=A9=20Windows?= =?UTF-8?q?=20Terminal=20=E6=96=B0=E6=A0=87=E7=AD=BE=E7=BB=A7=E6=89=BF?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- home/.zshrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/home/.zshrc b/home/.zshrc index 9a5611a..e8b3c38 100644 --- a/home/.zshrc +++ b/home/.zshrc @@ -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 ──