Skip to content

Commit e80d898

Browse files
1.1.17 added
1 parent cb723ca commit e80d898

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codebolt/codeboltjs",
3-
"version": "1.1.16",
3+
"version": "1.1.17",
44
"description": "",
55
"keywords": [],
66
"author": "",

src/modules/terminal.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)