File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @codebolt/codeboltjs" ,
3- "version" : " 1.1.16 " ,
3+ "version" : " 1.1.17 " ,
44 "description" : " " ,
55 "keywords" : [],
66 "author" : " " ,
Original file line number Diff line number Diff line change @@ -63,15 +63,34 @@ const cbterminal = {
6363 * @param {string } command - The command to be executed.
6464 * @returns {Promise<any> } A promise that resolves when an interruption signal is received during command execution.
6565 */
66- executeCommandRunUnitlIntrupt : async ( command : string ) : Promise < any > => {
66+ executeCommandRunUnitlInterrupt : async ( command : string ) : Promise < any > => {
6767 return new Promise ( ( resolve , reject ) => {
6868 cbws . getWebsocket . send ( JSON . stringify ( {
69- "type" : "executeCommandRunUnitlIntrupt " ,
69+ "type" : "executeCommandRunUnitlInterrupt " ,
7070 "message" : command ,
7171 } ) ) ;
7272 cbws . getWebsocket . on ( 'message' , ( data : string ) => {
7373 const response = JSON . parse ( data ) ;
74- if ( response . type === "terminalIntruptResponse" ) {
74+ if ( response . type === "terminalInterruptResponse" ) {
75+ resolve ( response ) ;
76+ }
77+ } ) ;
78+ } ) ;
79+ } ,
80+ /**
81+ * Sends a manual interrupt signal to the terminal.
82+ *
83+ * @returns {void }
84+ */
85+ sendManualInterrupt ( ) : Promise < any > {
86+
87+ return new Promise ( ( resolve , reject ) => {
88+ cbws . getWebsocket . send ( JSON . stringify ( {
89+ "type" : "sendInterruptToTerminal"
90+ } ) ) ;
91+ cbws . getWebsocket . on ( 'message' , ( data : string ) => {
92+ const response = JSON . parse ( data ) ;
93+ if ( response . type === "terminalInterrupted" ) {
7594 resolve ( response ) ;
7695 }
7796 } ) ;
You can’t perform that action at this time.
0 commit comments