File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change 804
804
} ;
805
805
806
806
occEditor . open_terminal = function ( path , command ) {
807
+ function run_command ( command , delay ) {
808
+ console . log ( "sending command: " + command ) ;
809
+ setTimeout ( function ( ) {
810
+ occEditor . send_terminal_command ( command ) ;
811
+ } , delay ) ;
812
+ }
813
+
814
+ if ( is_terminal_open ) {
815
+ run_command ( command , 0 ) ;
816
+ return ;
817
+ }
818
+
807
819
Terminal . applyAddon ( fit ) ;
808
820
Terminal . applyAddon ( attach ) ;
809
821
814
826
815
827
var terminalContainer = document . getElementById ( 'editor-output' ) ; //,
816
828
817
- function run_command ( command ) {
818
- console . log ( "sending command: " + command ) ;
819
- term . send ( JSON . stringify ( { type : "input" , data : command } ) ) ;
820
- //occEditor.send_terminal_command(command);
821
- }
822
-
823
829
// Clean terminal
824
830
while ( terminalContainer . children . length ) {
825
831
terminalContainer . removeChild ( terminalContainer . children [ 0 ] ) ;
856
862
occEditor . show_editor_output ( ) ;
857
863
858
864
if ( command ) {
859
- terminal_socket . onopen = run_command . bind ( null , command ) ;
865
+ terminal_socket . onopen = run_command . bind ( null , command , 1500 ) ;
860
866
}
861
867
} ) ;
862
868
} , 0 ) ;
You can’t perform that action at this time.
0 commit comments