File tree Expand file tree Collapse file tree 4 files changed +12
-3
lines changed Expand file tree Collapse file tree 4 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1
- import LinuxBrowserShell from "linux-browser-shell"
1
+ import { LinuxBrowserShell } from "linux-browser-shell"
2
2
3
3
const shell = new LinuxBrowserShell (
4
4
{
@@ -21,6 +21,15 @@ shell.boot().then(() => {
21
21
console . log ( "Booted" )
22
22
} )
23
23
24
+ // Save state of the VM. You can then later load it using the `initial_state` setting.
24
25
document . getElementById ( "save" ) . onclick = async function ( ) {
25
26
shell . downloadState ( )
26
27
}
28
+
29
+ // Demonstrate how to send commands to a Terminal.
30
+ // You can use this in the developer console, using `run("uname -a")` for example.
31
+ window . run = ( cmd ) => {
32
+ tty0 . run ( cmd ) . then ( ( res ) => {
33
+ console . log ( res )
34
+ } )
35
+ }
Original file line number Diff line number Diff line change 24
24
],
25
25
"scripts" : {
26
26
"prepare" : " vite build" ,
27
- "test" : " vitest --browser=chrome "
27
+ "test" : " vitest"
28
28
},
29
29
"dependencies" : {
30
30
"async-mutex" : " ^0.4.0" ,
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import {Mutex} from "async-mutex"
5
5
import { Terminal as XTerm } from "xterm"
6
6
7
7
export class Terminal {
8
- private prompt = "/ # "
8
+ private prompt = "# "
9
9
private mutex = new Mutex ( )
10
10
private mutex2 = new Mutex ( )
11
11
You can’t perform that action at this time.
0 commit comments