forked from microsoft/copilot-for-eclipse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIRunInTerminalTool.java
More file actions
48 lines (39 loc) · 1.6 KB
/
Copy pathIRunInTerminalTool.java
File metadata and controls
48 lines (39 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package com.microsoft.copilot.eclipse.terminal.api;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import org.eclipse.jface.resource.ImageDescriptor;
/**
* Interface for terminal tool implementations that can execute commands in a terminal. This interface is used by the
* SPI to allow different terminal tools to be plugged in.
*/
public interface IRunInTerminalTool {
/**
* Executes a command in the terminal.
*
* @param command The command to execute.
* @param isBackground Whether the command should run in the background.
* @return A CompletableFuture that resolves to the output of the command.
*/
public CompletableFuture<String> executeCommand(String command, boolean isBackground);
/**
* Prepares terminal properties for the command execution.
*
* @param runInBackground Whether the command should run in the background.
* @param executionId The unique identifier for the execution.
* @return A map containing terminal properties.
*/
public Map<String, Object> prepareTerminalProperties(boolean runInBackground, String executionId);
/**
* Retrieves the output of a background command execution.
*
* @param executionId The unique identifier for the background execution.
* @return A StringBuilder containing the output of the command.
*/
public StringBuilder getBackgroundCommandOutput(String executionId);
/**
* Sets the terminal icon descriptor for the tool.
*/
public void setTerminalIconDescriptor(ImageDescriptor terminalIconDescriptor);
}