mirror of
https://github.com/sigoden/aichat
synced 2024-11-16 06:15:26 +00:00
10 lines
407 B
PowerShell
10 lines
407 B
PowerShell
|
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)
|
||
|
}
|
||
|
}
|