chpwd.sh(檔案已創建)
| @@ -0,0 +1,14 @@ | |||
| 1 | + | # Auto-set wezterm tab title based on directory | |
| 2 | + | chpwd() { | |
| 3 | + | if [[ -d .git ]]; then | |
| 4 | + | # Use git repo name | |
| 5 | + | local repo=$(basename $(git rev-parse --show-toplevel 2>/dev/null)) | |
| 6 | + | wezterm cli set-tab-title "$repo" 2>/dev/null | |
| 7 | + | elif [[ $(pwd) =~ "/home/sajenim/.repositories/personal/([^/]+)" ]]; then | |
| 8 | + | # Use directory name for project dirs | |
| 9 | + | wezterm cli set-tab-title "''${match[1]}" 2>/dev/null | |
| 10 | + | fi | |
| 11 | + | } | |
| 12 | + | ||
| 13 | + | # Run once on shell startup | |
| 14 | + | chpwd | |
上一頁
下一頁