@@ -166,6 +166,12 @@ const props = defineProps({
166166 type: Array
167167 },
168168
169+ font: {
170+ default: ' ' ,
171+ required: false ,
172+ type: String
173+ },
174+
169175 helpText: {
170176 default: null ,
171177 required: false ,
@@ -271,12 +277,6 @@ const props = defineProps({
271277 default: ' ' ,
272278 required: false ,
273279 type: String
274- },
275-
276- font: {
277- default: undefined ,
278- required: false ,
279- type: String
280280 }
281281})
282282
@@ -306,22 +306,21 @@ const local = reactive({
306306 historyPosition: props .historyPosition ,
307307 isFullscreen: props .isFullscreen ,
308308 prompt: props .prompt ,
309- query: props .query ,
310- font: props .font
309+ query: props .query
311310})
312311// Signals like SIGINT or SIGKILL
313312const signals = reactive (newEventBus ())
314313// Reactive terminal state
315314const terminal = computed (() => ({
316315 cursorPosition: local .cursorPosition ,
317316 dispatchedQueries: local .dispatchedQueries ,
317+ font: props .font ,
318318 history: local .history ,
319319 historyPosition: local .historyPosition ,
320320 invert: props .invert ,
321321 isFullscreen: local .isFullscreen ,
322322 prompt: local .prompt ,
323- query: local .query ,
324- font: local .font
323+ query: local .query
325324}))
326325
327326// Provided commands as programs. It takes the keys of the commands object
@@ -378,7 +377,7 @@ const appendToHistory = (...components) => {
378377// Parses the query, looks for a user given command and appends the resulting
379378// component to the history
380379const dispatch = async query => {
381- // Call given interpreter to execute arbitrary code, if given
380+ // Call optional interpreter to execute arbitrary code
382381 if (isFunction (props .interpreter )) {
383382 props .interpreter (query)
384383 return
@@ -413,7 +412,7 @@ const dispatch = async query => {
413412 // instantly to history
414413 // TODO Find a better way to find out the name
415414 if (eq (get (command, ' __name' ), ' VueCommandQuery' )) {
416- appendToHistory (command )
415+ exit ( )
417416 return
418417 }
419418
@@ -435,9 +434,9 @@ const dispatch = async query => {
435434 })
436435 appendToHistory (markRaw (component))
437436}
438- // Tear down component and execute final steps
437+ // Tear down component, execute final steps and return a new query
439438const exit = () => {
440- // TODO Does order matter?
439+ // TODO: Does order matter?
441440 appendToHistory (createQuery ())
442441 setCursorPosition (0 )
443442 setFullscreen (false )
@@ -522,7 +521,7 @@ onMounted(() => {
522521
523522 // Scroll to bottom if history changes
524523 const resizeObsever = new ResizeObserver (() => {
525- // TODO Only scroll to bottom if user scrolled to bottom before
524+ // TODO: Only scroll to bottom if user scrolled to bottom before
526525 vueCommandHistoryRef .value .scrollTop = vueCommandHistoryRef .value .scrollHeight
527526 })
528527 for (const vueCommandHistoryEntry of vueCommandHistoryRef .value .children ) {
0 commit comments