psmux 설치로 윈도우 tmux 대치
This commit is contained in:
1 parent
ea6f515e19
commit
f0e448139a
2 files changed
+22
-12
No files matched your search
+16
-8
@@ -93,8 +93,8 @@ if ($tmuxCmd) {
|
||||
ErrExit "winget is required. Install it from the Microsoft Store or https://learn.microsoft.com/en-us/windows/package-manager/winget/"
|
||||
}
|
||||
|
||||
winget install --id arndawg.tmux-windows --accept-package-agreements --accept-source-agreements 2>&1 | Out-Null
|
||||
Success "tmux installed via winget"
|
||||
winget install psmux --accept-package-agreements --accept-source-agreements 2>&1 | Out-Null
|
||||
Success "tmux (psmux) installed via winget"
|
||||
}
|
||||
|
||||
# ────────────────────────────────────────────
|
||||
@@ -117,25 +117,33 @@ if (-not $tmuxBin) {
|
||||
}
|
||||
}
|
||||
|
||||
# 3) Search common locations where winget installs tmux-windows
|
||||
# 3) Search common locations where winget installs tmux / psmux
|
||||
if (-not $tmuxBin) {
|
||||
$searchDirs = @(
|
||||
(Join-Path $env:LOCALAPPDATA 'Microsoft\WinGet\Links'),
|
||||
(Join-Path $env:LOCALAPPDATA 'Programs\psmux'),
|
||||
(Join-Path $env:LOCALAPPDATA 'Programs\tmux-windows'),
|
||||
'C:\Program Files\psmux',
|
||||
'C:\Program Files\tmux-windows',
|
||||
'C:\Program Files (x86)\psmux',
|
||||
'C:\Program Files (x86)\tmux-windows'
|
||||
)
|
||||
foreach ($dir in $searchDirs) {
|
||||
if (Test-Path $dir) {
|
||||
$candidate = Join-Path $dir 'tmux.exe'
|
||||
if (Test-Path $candidate) { $tmuxBin = $candidate; break }
|
||||
foreach ($exe in @('tmux.exe', 'psmux.exe')) {
|
||||
$candidate = Join-Path $dir $exe
|
||||
if (Test-Path $candidate) { $tmuxBin = $candidate; break }
|
||||
}
|
||||
}
|
||||
if ($tmuxBin) { break }
|
||||
}
|
||||
|
||||
# Recurse under WinGet/Packages for tmux
|
||||
# Recurse under WinGet/Packages for tmux or psmux
|
||||
if (-not $tmuxBin -and (Test-Path (Join-Path $env:LOCALAPPDATA 'Microsoft\WinGet\Packages'))) {
|
||||
$found = Get-ChildItem -Path (Join-Path $env:LOCALAPPDATA 'Microsoft\WinGet\Packages') -Recurse -Filter 'tmux.exe' -ErrorAction SilentlyContinue | Select-Object -First 1
|
||||
if ($found) { $tmuxBin = $found.FullName }
|
||||
foreach ($filter in @('tmux.exe', 'psmux.exe')) {
|
||||
$found = Get-ChildItem -Path (Join-Path $env:LOCALAPPDATA 'Microsoft\WinGet\Packages') -Recurse -Filter $filter -ErrorAction SilentlyContinue | Select-Object -First 1
|
||||
if ($found) { $tmuxBin = $found.FullName; break }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user