diff options
| author | sigoden <sigoden@gmail.com> | 2024-02-26 11:28:25 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-26 11:28:25 +0800 |
| commit | ff0ec15e065957a0da197711f6e3adfb9992325a (patch) | |
| tree | 9d0d588d8365b6c850072dd69532995c63b001e7 /scripts/integration.ps1 | |
| parent | aec1b707afb1cf80ff4eb8591e1cd050fffe47b0 (diff) | |
| download | aichat-ff0ec15e065957a0da197711f6e3adfb9992325a.tar.gz | |
feat: add shell integration (#323)
Diffstat (limited to 'scripts/integration.ps1')
| -rw-r--r-- | scripts/integration.ps1 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/integration.ps1 b/scripts/integration.ps1 new file mode 100644 index 0000000..6a94189 --- /dev/null +++ b/scripts/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 |
