File tree 2 files changed +16
-4
lines changed
2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const App = (props: {
25
25
const [ triple , setTriple ] = createSignal ( "wasm32-wasip1" ) ;
26
26
27
27
return (
28
- < >
28
+ < div >
29
29
< MonacoEditor
30
30
language = "rust"
31
31
value = { default_value }
@@ -34,7 +34,9 @@ const App = (props: {
34
34
onChange = { handleEditorChange }
35
35
/>
36
36
{ /* <p class="text-4xl text-green-700 text-center">Hello tailwind!</p> */ }
37
- < SetupMyTerminal ctx = { props . ctx } callback = { props . callback } />
37
+ < div class = "flex" style = { { width : "100vw" } } >
38
+ < SetupMyTerminal ctx = { props . ctx } callback = { props . callback } />
39
+ </ div >
38
40
< div class = "flex" >
39
41
< div class = "p-4 text-white" >
40
42
< RunButton triple = { triple ( ) } />
@@ -59,7 +61,7 @@ const App = (props: {
59
61
< DownloadButton />
60
62
</ div >
61
63
</ div >
62
- </ >
64
+ </ div >
63
65
) ;
64
66
} ;
65
67
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ export const SetupMyTerminal = (props: {
24
24
} ) => {
25
25
let xterm : Terminal | undefined = undefined ;
26
26
27
+ const fit_addon = new FitAddon ( ) ;
28
+
27
29
const terminal_queue = [ ] ;
28
30
const write_terminal = ( str : string ) => {
29
31
if ( xterm ) {
@@ -53,6 +55,7 @@ export const SetupMyTerminal = (props: {
53
55
xterm . write ( terminal_queue . join ( "" ) ) ;
54
56
terminal_queue . length = 0 ;
55
57
get_ref ( terminal , props . callback ) ;
58
+ fit_addon . fit ( ) ;
56
59
return ( ) => {
57
60
console . log ( "Terminal unmounted." ) ;
58
61
} ;
@@ -107,7 +110,14 @@ export const SetupMyTerminal = (props: {
107
110
} ;
108
111
109
112
// You can pass either an ITerminalAddon constructor or an instance, depending on whether you need to access it later.
110
- return < XTerm onMount = { handleMount } onKey = { keydown } addons = { [ FitAddon ] } /> ;
113
+ return (
114
+ < XTerm
115
+ onMount = { handleMount }
116
+ onKey = { keydown }
117
+ addons = { [ fit_addon ] }
118
+ class = "w-full"
119
+ />
120
+ ) ;
111
121
} ;
112
122
113
123
const get_ref = ( term , callback ) => {
You can’t perform that action at this time.
0 commit comments