File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 29
29
type =" text"
30
30
@click =" setCursorPosition($refs.queryRef.selectionStart)"
31
31
@input =" setQuery($event.target.value)"
32
+ @keydown.ctrl.c.exact.prevent =" sigint"
32
33
@keydown.tab.exact.prevent =" autocompleteQuery"
33
34
@keydown.ctrl.r.exact.prevent =" reverseISearch"
34
35
@keyup.arrow-left.exact =" setCursorPosition($refs.queryRef.selectionStart)"
@@ -54,6 +55,7 @@ import {
54
55
import {
55
56
defaultParser ,
56
57
createStdout ,
58
+ createQuery ,
57
59
listFormatter
58
60
} from ' @/library'
59
61
import head from ' lodash.head'
@@ -182,6 +184,12 @@ const showDelayedHelp = () => {
182
184
unwatchIsOutdated ()
183
185
})
184
186
}
187
+ // Cancels the current query and creates a new one
188
+ const sigint = () => {
189
+ isOutdated .value = true
190
+ local .query = ` ${ local .query } ^C`
191
+ appendToHistory (createQuery ())
192
+ }
185
193
// Deactivates this query and dispatches it to execute the command
186
194
const submit = () => {
187
195
isOutdated .value = true
@@ -222,7 +230,7 @@ onMounted(() => {
222
230
focus ()
223
231
224
232
// Show eventually help as placeholder
225
- showDelayedHelp ()
233
+ showDelayedHelp ()
226
234
})
227
235
228
236
defineExpose ({
You can’t perform that action at this time.
0 commit comments