@@ -96,6 +96,9 @@ <h2 class="center white-text">Loading Python Interpreter</h2>
9696 < a class ="btn-floating btn-small waves-effect waves-light zoom-button "
9797 onclick ="terminal.terminal.clear() "> < i
9898 class ="material-icons "> delete</ i > </ a >
99+ < a class ="btn-floating btn-small waves-effect waves-light zoom-button "
100+ onclick ="restart_toplevel() "> < i
101+ class ="material-icons "> refresh</ i > </ a >
99102</ div >
100103
101104<!-- Quick execute and clean console on mobile -->
@@ -162,6 +165,9 @@ <h4>Configuration</h4>
162165 class ="material-icons "> remove</ i > </ a >
163166 </ div >
164167 </ div >
168+ < a class ="waves-effect waves-light btn config-element " onclick ="restart_toplevel() "> < i
169+ class ="material-icons right "> refresh</ i > Reset
170+ Python Interpreter</ a >
165171 < h4 > Help</ h4 >
166172 < a href ="#shortcut " class ="waves-effect waves-light btn shortcut-button modal-trigger "> < i
167173 class ="material-icons right "> code</ i > Shortcuts</ a >
@@ -336,8 +342,11 @@ <h4>Graphics main window</h4>
336342
337343 addEventListener ( "mpy:ready" , ( ) => {
338344 // show running for an instance
345+ console . log ( "Python interpreter ready" )
339346 $ ( '#loader-wrapper' ) . addClass ( "tester" )
340- terminal . terminal . loadAddon ( terminalFitter ) ;
347+ // check if the terminal is ready
348+ let local_terminal = document . querySelector ( "#toplevel-terminal" ) ;
349+ local_terminal . terminal . loadAddon ( terminalFitter ) ;
341350 terminalFitter . fit ( ) ;
342351 change_font_size ( "toplevel" , 0 ) ;
343352 } ) ;
0 commit comments