1
+ <!doctype html>
2
+ <!--
3
+ * Created on June 25 2023
4
+ *
5
+ * Copyright (c) 2023 - Daniel Hajnal
6
+
7
+ * This file is part of the Shellminator project.
8
+ * Modified 2022.06.25
9
+
10
+ MIT License
11
+
12
+ Copyright (c) 2022 Daniel Hajnal
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+ -->
32
+
33
+ < html >
34
+
35
+ < style >
36
+
37
+ .terminal-container {
38
+ overflow : hidden;
39
+ margin : 0 ;
40
+ position : absolute;
41
+ top : 50% ;
42
+ left : 50% ;
43
+ transform : translate ( -50% , -50% );
44
+ box-shadow : 0px 0px 20px # 34495E ;
45
+ }
46
+
47
+ </ style >
48
+
49
+ < head >
50
+ < title > Argumentbasic</ title >
51
+ < link rel ="
stylesheet "
href ="
https://cdn.jsdelivr.net/npm/[email protected] /css/xterm.css "
>
52
+ </ head >
53
+ < body >
54
+ < div class ="terminal-container " id ="terminal ">
55
+ < script src ="
https://cdn.jsdelivr.net/npm/[email protected] /lib/xterm.min.js "
> </ script >
56
+ < script >
57
+
58
+ let inputText = "" ;
59
+ let stdinBuffer = [ ] ;
60
+ let stdinBufferPtr = 0 ;
61
+
62
+ /* Create a new xTerm object */
63
+ const term = new Terminal ( {
64
+ cursorBliknk : "true" ,
65
+ cursorStyle : "bar" ,
66
+ } ) ;
67
+
68
+ term . onData ( data => {
69
+
70
+ //inputChar = data;
71
+ inputText = data ;
72
+ for ( const c of data ) {
73
+ stdinBuffer . push ( c . charCodeAt ( 0 ) ) ;
74
+ }
75
+
76
+ console . log ( stdinBuffer ) ;
77
+
78
+ } ) ;
79
+
80
+ term . open ( document . getElementById ( "terminal" ) ) ;
81
+
82
+ var Module ;
83
+
84
+
85
+ </ script >
86
+ < script src =./Argumentbasic.js > </ script >
87
+ </ body >
88
+ </ html >
0 commit comments