File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 2929 type =" text"
3030 @click =" setCursorPosition($refs.queryRef.selectionStart)"
3131 @input =" setQuery($event.target.value)"
32+ @keydown.ctrl.c.exact.prevent =" sigint"
3233 @keydown.tab.exact.prevent =" autocompleteQuery"
3334 @keydown.ctrl.r.exact.prevent =" reverseISearch"
3435 @keyup.arrow-left.exact =" setCursorPosition($refs.queryRef.selectionStart)"
@@ -54,6 +55,7 @@ import {
5455import {
5556 defaultParser ,
5657 createStdout ,
58+ createQuery ,
5759 listFormatter
5860} from ' @/library'
5961import head from ' lodash.head'
@@ -182,6 +184,12 @@ const showDelayedHelp = () => {
182184 unwatchIsOutdated ()
183185 })
184186}
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+ }
185193// Deactivates this query and dispatches it to execute the command
186194const submit = () => {
187195 isOutdated .value = true
@@ -222,7 +230,7 @@ onMounted(() => {
222230 focus ()
223231
224232 // Show eventually help as placeholder
225- showDelayedHelp ()
233+ showDelayedHelp ()
226234})
227235
228236defineExpose ({
You can’t perform that action at this time.
0 commit comments