@@ -12,11 +12,12 @@ export class Terminal {
12
12
constructor (
13
13
private id : number ,
14
14
private emulator : any ,
15
+ private options : { font ?: string }
15
16
) { }
16
17
17
18
attach ( div : HTMLElement ) {
18
19
let term = new XTerm ( {
19
- fontFamily : "Iosevka Nerd Font ",
20
+ fontFamily : this . options . font || "monospace ",
20
21
} )
21
22
term . open ( div )
22
23
term . onKey ( ( key ) => {
@@ -162,22 +163,23 @@ export class LinuxBrowserShell {
162
163
}
163
164
164
165
constructor (
165
- paths : {
166
+ settings : {
166
167
wasm : string
167
168
bios : string
168
169
vga_bios : string
169
170
cdrom : string
170
171
initial_state ?: string
172
+ font ?: string
171
173
} ,
172
174
screen ?: HTMLDivElement ,
173
175
) {
174
- this . config [ "wasm_path" ] = paths . wasm
175
- this . config [ "bios" ] = { url : paths . bios }
176
- this . config [ "vga_bios" ] = { url : paths . vga_bios }
177
- this . config [ "cdrom" ] = { url : paths . cdrom }
176
+ this . config [ "wasm_path" ] = settings . wasm
177
+ this . config [ "bios" ] = { url : settings . bios }
178
+ this . config [ "vga_bios" ] = { url : settings . vga_bios }
179
+ this . config [ "cdrom" ] = { url : settings . cdrom }
178
180
179
- if ( typeof paths . initial_state !== "undefined" ) {
180
- this . config [ "initial_state" ] = { url : paths . initial_state }
181
+ if ( typeof settings . initial_state !== "undefined" ) {
182
+ this . config [ "initial_state" ] = { url : settings . initial_state }
181
183
}
182
184
183
185
if ( screen ) {
@@ -202,10 +204,10 @@ export class LinuxBrowserShell {
202
204
this . emulator = new V86Starter ( this . config )
203
205
204
206
this . terminals = [
205
- new Terminal ( 0 , this . emulator ) ,
206
- new Terminal ( 1 , this . emulator ) ,
207
- new Terminal ( 2 , this . emulator ) ,
208
- new Terminal ( 3 , this . emulator ) ,
207
+ new Terminal ( 0 , this . emulator , { font : settings . font } ) ,
208
+ new Terminal ( 1 , this . emulator , { font : settings . font } ) ,
209
+ new Terminal ( 2 , this . emulator , { font : settings . font } ) ,
210
+ new Terminal ( 3 , this . emulator , { font : settings . font } ) ,
209
211
]
210
212
}
211
213
0 commit comments