diff --git a/Documents/PowerShell/Microsoft.PowerShell_profile.ps1 b/Documents/PowerShell/Microsoft.PowerShell_profile.ps1 index 963a8c5..e9a98dd 100644 --- a/Documents/PowerShell/Microsoft.PowerShell_profile.ps1 +++ b/Documents/PowerShell/Microsoft.PowerShell_profile.ps1 @@ -12,7 +12,6 @@ if (Test-Path -Path $ProfileDir) { Write-Warning "Failed to load profile module: $($Script.Name). Error: $($_.Exception.Message)" } } - } else { Write-Warning "Profile directory not found at: $ProfileDir" } diff --git a/Documents/PowerShell/Profile/04-PSReadLine.ps1 b/Documents/PowerShell/Profile/04-PSReadLine.ps1 index 85cc5be..e71a6a5 100644 --- a/Documents/PowerShell/Profile/04-PSReadLine.ps1 +++ b/Documents/PowerShell/Profile/04-PSReadLine.ps1 @@ -1,8 +1,9 @@ using namespace System.Management.Automation using namespace System.Management.Automation.Language -Import-Module PSReadLine -ErrorAction SilentlyContinue if (Get-Command Set-PSReadLineOption -ErrorAction SilentlyContinue) { + # Set EditMode Windows first to ensure all subsequent registrations target the correct keymap + Set-PSReadLineOption -EditMode Windows # Searching for commands with up/down arrow is really handy. Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward @@ -539,7 +540,6 @@ if (Get-Command Set-PSReadLineOption -ErrorAction SilentlyContinue) { Set-PSReadLineOption -PredictionSource History Set-PSReadLineOption -PredictionViewStyle ListView - Set-PSReadLineOption -EditMode Windows # dotnet build macro Set-PSReadLineKeyHandler -Key Ctrl+Shift+b `