Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public CompletableFuture<String> executeCommand(String command, boolean isBackgr

synchronized (lock) {
if (!isBackground && this.persistentTerminalViewControl != null) {
bringTerminalViewAndCopilotConsoleToFront();
revealTerminal();
this.persistentTerminalViewControl.pasteString(finalCommand);
return this.resultFuture;
}
Expand All @@ -122,7 +122,7 @@ public CompletableFuture<String> executeCommand(String command, boolean isBackgr

if (!isBackground) {
this.persistentTerminalViewControl = terminalViewControl;
bringTerminalViewAndCopilotConsoleToFront();
revealTerminal();
}
terminalViewControl.pasteString(finalCommand);
} else {
Expand Down Expand Up @@ -205,7 +205,7 @@ private ITerminalControl getTerminalControl(String terminalTitle, boolean isBack
try {
IWorkbenchPage page = getActivePage();
if (page != null) {
IViewPart view = page.showView(IUIConstants.ID);
IViewPart view = page.showView(IUIConstants.ID, null, IWorkbenchPage.VIEW_VISIBLE);
if (view != null) {
tabFolder = view.getAdapter(CTabFolder.class);
if (tabFolder != null) {
Expand Down Expand Up @@ -360,13 +360,13 @@ private DisposeListener buildDisposeListener(String executionId, boolean isBackg
};
}

private void bringTerminalViewAndCopilotConsoleToFront() {
private void revealTerminal() {
if (tabFolder != null && copilotTabItem != null) {
Display.getDefault().syncExec(() -> {
try {
IWorkbenchPage page = getActivePage();
if (page != null) {
IViewPart view = page.showView(IUIConstants.ID);
IViewPart view = page.showView(IUIConstants.ID, null, IWorkbenchPage.VIEW_VISIBLE);
if (tabFolder.isDisposed() && view != null) {
tabFolder = view.getAdapter(CTabFolder.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public CompletableFuture<String> executeCommand(String command, boolean isBackgr

synchronized (lock) {
if (!isBackground && this.persistentTerminalViewControl != null) {
bringTerminalViewAndCopilotConsoleToFront();
revealTerminal();
this.persistentTerminalViewControl.pasteString(finalCommand);
return this.resultFuture;
}
Expand All @@ -124,7 +124,7 @@ public CompletableFuture<String> executeCommand(String command, boolean isBackgr

if (!isBackground) {
this.persistentTerminalViewControl = terminalViewControl;
bringTerminalViewAndCopilotConsoleToFront();
revealTerminal();
}
terminalViewControl.pasteString(finalCommand);
} else {
Expand Down Expand Up @@ -208,7 +208,7 @@ private ITerminalControl getTerminalControl(String terminalTitle, boolean isBack
try {
IWorkbenchPage page = getActivePage();
if (page != null) {
IViewPart view = page.showView(IUIConstants.ID);
IViewPart view = page.showView(IUIConstants.ID, null, IWorkbenchPage.VIEW_VISIBLE);
if (view != null) {
tabFolder = view.getAdapter(CTabFolder.class);
if (tabFolder != null) {
Expand Down Expand Up @@ -360,13 +360,13 @@ private DisposeListener buildDisposeListener(String executionId, boolean isBackg
};
}

private void bringTerminalViewAndCopilotConsoleToFront() {
private void revealTerminal() {
if (tabFolder != null && copilotTabItem != null) {
Display.getDefault().syncExec(() -> {
try {
IWorkbenchPage page = getActivePage();
if (page != null) {
IViewPart view = page.showView(IUIConstants.ID);
IViewPart view = page.showView(IUIConstants.ID, null, IWorkbenchPage.VIEW_VISIBLE);
if (tabFolder.isDisposed() && view != null) {
tabFolder = view.getAdapter(CTabFolder.class);
}
Expand Down
Loading