diff options
| author | sigoden <sigoden@gmail.com> | 2024-03-02 08:07:06 +0000 |
|---|---|---|
| committer | sigoden <sigoden@gmail.com> | 2024-03-02 08:07:06 +0000 |
| commit | d275c33632271bf9cdbc01ef005deb9ff851370b (patch) | |
| tree | e2e924469ee752245acef4f965fca6b770ac6e03 /scripts/shell-integration/integration.ps1 | |
| parent | 6216b40f8c0eeaea7d47349148ede054ee4a5822 (diff) | |
| download | aichat-d275c33632271bf9cdbc01ef005deb9ff851370b.tar.gz | |
chore: move integration scripts
Diffstat (limited to 'scripts/shell-integration/integration.ps1')
| -rw-r--r-- | scripts/shell-integration/integration.ps1 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/shell-integration/integration.ps1 b/scripts/shell-integration/integration.ps1 new file mode 100644 index 0000000..6a94189 --- /dev/null +++ b/scripts/shell-integration/integration.ps1 @@ -0,0 +1,10 @@ +Set-PSReadLineKeyHandler -Chord "alt+e" -ScriptBlock { + $_old = $null + [Microsoft.PowerShell.PSConsoleReadline]::GetBufferState([ref]$_old, [ref]$null) + if ($_old) { + [Microsoft.PowerShell.PSConsoleReadLine]::Insert('⌛') + $_new = (aichat -e $_old) + [Microsoft.PowerShell.PSConsoleReadLine]::DeleteLine() + [Microsoft.PowerShell.PSConsoleReadline]::Insert($_new) + } +}
\ No newline at end of file |
