Skip to content

Commit 7a3b156

Browse files
committed
Don't focus chat input when opening from chat sessions view
Fixes microsoft#264650 This matches how opening files from the explorer works. Using the `Open chat editor` command still should focus the input
1 parent 151a19f commit 7a3b156

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/vs/workbench/contrib/chat/browser/chatSessions.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,15 +1620,16 @@ class SessionsViewPane extends ViewPane {
16201620
pinned: true,
16211621
// Add a marker to indicate this session was opened from history
16221622
ignoreInView: true,
1623+
preserveFocus: true,
16231624
};
16241625
await this.editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options });
16251626
} else {
16261627
// For external provider sessions, use ChatSessionUri approach
16271628
const providerType = sessionWithProvider.provider.chatSessionType;
16281629
const options: IChatEditorOptions = {
16291630
pinned: true,
1630-
preferredTitle: truncate(element.label, 20)
1631-
1631+
preferredTitle: truncate(element.label, 20),
1632+
preserveFocus: true,
16321633
};
16331634
await this.editorService.openEditor({
16341635
resource: ChatSessionUri.forSession(providerType, sessionId),
@@ -1663,6 +1664,7 @@ class SessionsViewPane extends ViewPane {
16631664
pinned: true,
16641665
ignoreInView: true,
16651666
preferredTitle: truncate(element.label, 20),
1667+
preserveFocus: true,
16661668
};
16671669
await this.editorService.openEditor({
16681670
resource: ChatSessionUri.forSession(providerType, sessionId),

0 commit comments

Comments
 (0)