Skip to content

Commit 7e5dd15

Browse files
author
James Brundage
committed
Disable-AIShortCutKey: Disabling all OpenAICLI chords (re #58)
1 parent e6324b0 commit 7e5dd15

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

Public/Disable-AIShortCutKey.ps1

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
function Disable-AIShortCutKey {
22
<#
33
.SYNOPSIS
4-
Disable the Ctrl+g shortcut key for getting completions
5-
4+
Disable the shortcut key for getting completions
5+
.DESCRIPTION
6+
Disable the shortcut key for completing suggestions.
67
.EXAMPLE
7-
Disable-AIShortCutKey
8+
Disable-AIShortCutKey
9+
.LINK
10+
Enable-AIShortCutKey
811
#>
912

10-
Remove-PSReadLineKeyHandler -Chord Ctrl+g
13+
$chordsToRemove = Get-PSReadLineKeyHandler |
14+
Where-Object Function -eq OpenAICli |
15+
Select-Object -ExpandProperty Key
16+
17+
foreach ($chordToRemove in $chordsToRemove) {
18+
Remove-PSReadLineKeyHandler -Chord $chordToRemove
19+
}
1120
}

0 commit comments

Comments
 (0)