summaryrefslogtreecommitdiffstats
path: root/scripts/shell-integration/integration.ps1
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-03-02 08:07:06 +0000
committersigoden <sigoden@gmail.com>2024-03-02 08:07:06 +0000
commitd275c33632271bf9cdbc01ef005deb9ff851370b (patch)
treee2e924469ee752245acef4f965fca6b770ac6e03 /scripts/shell-integration/integration.ps1
parent6216b40f8c0eeaea7d47349148ede054ee4a5822 (diff)
downloadaichat-d275c33632271bf9cdbc01ef005deb9ff851370b.tar.gz
chore: move integration scripts
Diffstat (limited to 'scripts/shell-integration/integration.ps1')
-rw-r--r--scripts/shell-integration/integration.ps110
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