File tree Expand file tree Collapse file tree 3 files changed +29
-5
lines changed Expand file tree Collapse file tree 3 files changed +29
-5
lines changed Original file line number Diff line number Diff line change 4
4
:class =" {
5
5
'vue-command': !invert,
6
6
'vue-command--invert': invert
7
- }" >
7
+ }"
8
+ :style =" font ? { 'font-family': font } : {}" >
8
9
<!-- Bar -->
9
10
<slot
10
11
v-if =" !hideBar"
@@ -270,6 +271,12 @@ const props = defineProps({
270
271
default: ' ' ,
271
272
required: false ,
272
273
type: String
274
+ },
275
+
276
+ font: {
277
+ default: undefined ,
278
+ required: false ,
279
+ type: String
273
280
}
274
281
})
275
282
@@ -299,7 +306,8 @@ const local = reactive({
299
306
historyPosition: props .historyPosition ,
300
307
isFullscreen: props .isFullscreen ,
301
308
prompt: props .prompt ,
302
- query: props .query
309
+ query: props .query ,
310
+ font: props .font
303
311
})
304
312
// Signals like SIGINT or SIGKILL
305
313
const signals = reactive (newEventBus ())
@@ -312,7 +320,8 @@ const terminal = computed(() => ({
312
320
invert: props .invert ,
313
321
isFullscreen: local .isFullscreen ,
314
322
prompt: local .prompt ,
315
- query: local .query
323
+ query: local .query ,
324
+ font: local .font
316
325
}))
317
326
318
327
// Provided commands as programs. It takes the keys of the commands object
Original file line number Diff line number Diff line change 18
18
autocapitalize =" none"
19
19
autocorrect =" off"
20
20
type =" text"
21
+ :style =" terminal.font ? { 'font': `1rem ${terminal.font}`} : {}"
21
22
@click =" setCursorPosition($refs.queryRef.selectionStart)"
22
23
@keydown.tab.exact.prevent =" autocompleteQuery"
23
24
@keydown.ctrl.r.exact.prevent =" showReverseISearch()"
@@ -500,7 +501,6 @@ defineExpose({
500
501
.vue-command__multiline-query--invert {
501
502
display : flex ;
502
503
503
- input ::placeholder ,
504
504
input {
505
505
font : 1rem Consolas,
506
506
Monaco,
Original file line number Diff line number Diff line change 29
29
:prompt =" prompt"
30
30
:options-resolver =" optionsResolver"
31
31
:show-help =" showHelp"
32
- :title =" title" />
32
+ :title =" title"
33
+ :font =" font" />
33
34
</div >
34
35
35
36
<div class =" table-responsive" >
@@ -202,6 +203,7 @@ export default {
202
203
const query = ref (' ' )
203
204
const showHelp = ref (true )
204
205
const title = ref (' bash - 720x350' )
206
+ const font = ref (' ' )
205
207
206
208
const optionsResolver = (program , parsedQuery , setQuery ) => {
207
209
const lastArgument = parsedQuery[parsedQuery .length - 1 ]
@@ -260,6 +262,18 @@ export default {
260
262
return createStdout (' Hello world' )
261
263
},
262
264
265
+ changefont : parsedQuery => {
266
+ const joinedQuery = parsedQuery .join (' ' )
267
+ const regex = / (["'] )(. *? )\1 /
268
+ const match = joinedQuery .match (regex)
269
+ if (match) {
270
+ font .value = match[2 ]
271
+ return createQuery ()
272
+ }
273
+
274
+ return createStdout (' No quotes found' )
275
+ },
276
+
263
277
history : () => {
264
278
const history = []
265
279
for (const [index , entry ] of [... dispatchedQueries .value ].entries ()) {
@@ -297,6 +311,7 @@ export default {
297
311
query,
298
312
showHelp,
299
313
title,
314
+ font,
300
315
301
316
optionsResolver
302
317
}
You can’t perform that action at this time.
0 commit comments