Skip to content

Commit c314fb1

Browse files
changes in terminal
1 parent 30d727d commit c314fb1

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
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.60",
3+
"version": "1.1.61",
44
"description": "",
55
"keywords": [],
66
"author": "",

src/modules/terminal.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ const cbterminal = {
1919
* @param {string} command - The command to be executed.
2020
* @returns {Promise<CommandOutput|CommandError>} A promise that resolves with the command's output, error, or finish signal.
2121
*/
22-
executeCommand: async (command: string): Promise<CommandOutput|CommandError> => {
22+
executeCommand: async (command: string,executeInMain=false): Promise<CommandOutput|CommandError> => {
2323
return new Promise((resolve, reject) => {
2424
cbws.getWebsocket.send(JSON.stringify({
2525
"type": "executeCommand",
2626
"message": command,
27+
executeInMain
2728
}));
2829
cbws.getWebsocket.on('message', (data: string) => {
2930
const response = JSON.parse(data);
@@ -41,11 +42,12 @@ const cbterminal = {
4142
* @param {string} command - The command to be executed.
4243
* @returns {Promise<CommandError>} A promise that resolves when an error occurs during command execution.
4344
*/
44-
executeCommandRunUntilError: async (command: string): Promise<CommandError> => {
45+
executeCommandRunUntilError: async (command: string,executeInMain=false): Promise<CommandError> => {
4546
return new Promise((resolve, reject) => {
4647
cbws.getWebsocket.send(JSON.stringify({
4748
"type": "executeCommandRunUntilError",
4849
"message": command,
50+
executeInMain
4951
}));
5052
cbws.getWebsocket.on('message', (data: string) => {
5153
const response = JSON.parse(data);
@@ -84,11 +86,12 @@ const cbterminal = {
8486
* @param {string} command - The command to be executed.
8587
* @returns {EventEmitter} A promise that streams the output data during command execution.
8688
*/
87-
executeCommandWithStream(command: string):EventEmitter {
89+
executeCommandWithStream(command: string,executeInMain=false):EventEmitter {
8890
// Send the process started message
8991
cbws.getWebsocket.send(JSON.stringify({
9092
"type": "executeCommandWithStream",
91-
"message": command,
93+
"message": command
94+
,executeInMain
9295
}));
9396
// Register event listener for WebSocket messages
9497
cbws.getWebsocket.on('message', (data: string) => {

0 commit comments

Comments
 (0)