diff --git a/AppData/Local/Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe/LocalState/settings.json b/AppData/Local/Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe/LocalState/settings.json index 5709577..7662838 100644 --- a/AppData/Local/Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe/LocalState/settings.json +++ b/AppData/Local/Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe/LocalState/settings.json @@ -15,6 +15,15 @@ "command": "paste", "id": "User.paste" }, + { + "command": + { + "action": "splitPane", + "split": "auto", + "splitMode": "duplicate" + }, + "id": "User.splitPane.A6751878" + }, { "command": { @@ -30,11 +39,10 @@ { "command": { - "action": "splitPane", - "split": "auto", - "splitMode": "duplicate" + "action": "moveFocus", + "direction": "left" }, - "id": "User.splitPane.A6751878" + "id": "User.moveFocus.left" }, { "command": "toggleFocusMode", @@ -44,17 +52,17 @@ "command": { "action": "moveFocus", - "direction": "left" + "direction": "down" }, - "id": "User.moveFocus.left" + "id": "User.moveFocus.down" }, { "command": { - "action": "moveFocus", - "direction": "down" + "action": "resizePane", + "direction": "right" }, - "id": "User.moveFocus.down" + "id": "User.resizePane.right" }, { "command": @@ -72,14 +80,6 @@ }, "id": "User.splitPane.right" }, - { - "command": - { - "action": "resizePane", - "direction": "right" - }, - "id": "User.resizePane.right" - }, { "command": { @@ -88,6 +88,14 @@ }, "id": "User.moveFocus.right" }, + { + "command": + { + "action": "resizePane", + "direction": "down" + }, + "id": "User.resizePane.down" + }, { "command": { @@ -100,14 +108,6 @@ "command": "closePane", "id": "User.closePane" }, - { - "command": - { - "action": "resizePane", - "direction": "down" - }, - "id": "User.resizePane.down" - }, { "command": { @@ -126,30 +126,30 @@ "defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", "keybindings": [ - { - "id": "User.copy.644BA8F2", - "keys": "ctrl+c" - }, { "id": "Terminal.ToggleFocusMode", "keys": "alt+z" }, { - "id": "User.paste", - "keys": "ctrl+v" + "id": "User.copy.644BA8F2", + "keys": "ctrl+c" }, { "id": "User.find", "keys": "ctrl+shift+f" }, { - "id": "User.splitPane.A6751878", - "keys": "alt+shift+d" + "id": "User.paste", + "keys": "ctrl+v" }, { "id": "User.moveFocus.up", "keys": "alt+k" }, + { + "id": "User.splitPane.A6751878", + "keys": "alt+shift+d" + }, { "id": "User.moveFocus.left", "keys": "alt+h" @@ -231,7 +231,8 @@ "name": "PowerShell", "opacity": 100, "padding": "7", - "source": "Windows.Terminal.PowershellCore" + "source": "Windows.Terminal.PowershellCore", + "tabTitle": "terminal" }, { "colorScheme": "One Half Dark", @@ -271,6 +272,7 @@ ] }, "schemes": [], + "searchWebDefaultQueryUrl": "https://www.google.com/search?q=%22%s%22", "themes": [], "useAcrylicInTabRow": true } \ No newline at end of file diff --git a/Documents/PowerShell/Microsoft.PowerShell_profile.ps1 b/Documents/PowerShell/Microsoft.PowerShell_profile.ps1 index e9a98dd..74c6080 100644 --- a/Documents/PowerShell/Microsoft.PowerShell_profile.ps1 +++ b/Documents/PowerShell/Microsoft.PowerShell_profile.ps1 @@ -2,16 +2,32 @@ $CurrentDir = if ($PSScriptRoot) { $PSScriptRoot } else { Split-Path -Parent $PR $ProfileDir = Join-Path -Path $CurrentDir -ChildPath "Profile" if (Test-Path -Path $ProfileDir) { - $ProfileScripts = Get-ChildItem -Path $ProfileDir -Filter "*.ps1" | Sort-Object Name - - foreach ($Script in $ProfileScripts) { - try { - . $Script.FullName + $mutexName = "Global\PowerShellProfileInit" + $mutex = [System.Threading.Mutex]::new($false, $mutexName) + $acquired = $false + + try { + $acquired = $mutex.WaitOne(10000) + if ($acquired) { + $ProfileScripts = Get-ChildItem -Path $ProfileDir -Filter "*.ps1" | Sort-Object Name + foreach ($Script in $ProfileScripts) { + try { + . $Script.FullName + } + catch { + Write-Warning "Failed to load profile module: $($Script.Name). Error: $($_.Exception.Message)" + } + } } - catch { - Write-Warning "Failed to load profile module: $($Script.Name). Error: $($_.Exception.Message)" + else { + Write-Warning "Profile initialization lock timed out — another terminal may be loading." } } -} else { + finally { + if ($acquired) { $mutex.ReleaseMutex() } + $mutex.Dispose() + } +} +else { Write-Warning "Profile directory not found at: $ProfileDir" }