@@ -34,6 +34,7 @@ import { IChatDetail, IChatService } from 'vs/workbench/contrib/chat/common/chat
34
34
import { IChatWidgetHistoryService } from 'vs/workbench/contrib/chat/common/chatWidgetHistoryService' ;
35
35
import { IEditorService } from 'vs/workbench/services/editor/common/editorService' ;
36
36
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle' ;
37
+ import { IsLinuxContext , IsWindowsContext } from 'vs/platform/contextkey/common/contextkeys' ;
37
38
38
39
export const CHAT_CATEGORY = localize2 ( 'chat.category' , 'Chat' ) ;
39
40
export const CHAT_OPEN_ACTION_ID = 'workbench.action.chat.open' ;
@@ -192,13 +193,22 @@ export function registerChatActions() {
192
193
super ( {
193
194
id : 'chat.action.focus' ,
194
195
title : localize2 ( 'actions.interactiveSession.focus' , 'Focus Chat List' ) ,
195
- precondition : ContextKeyExpr . and ( CONTEXT_IN_CHAT_INPUT , CONTEXT_CHAT_INPUT_CURSOR_AT_TOP ) ,
196
+ precondition : CONTEXT_IN_CHAT_INPUT ,
196
197
category : CHAT_CATEGORY ,
197
- keybinding : {
198
- when : EditorContextKeys . textInputFocus ,
199
- primary : KeyMod . CtrlCmd | KeyCode . UpArrow ,
200
- weight : KeybindingWeight . EditorContrib
201
- }
198
+ keybinding : [
199
+ // On mac, require that the cursor is at the top of the input, to avoid stealing cmd+up to move the cursor to the top
200
+ {
201
+ when : CONTEXT_CHAT_INPUT_CURSOR_AT_TOP ,
202
+ primary : KeyMod . CtrlCmd | KeyCode . UpArrow ,
203
+ weight : KeybindingWeight . EditorContrib ,
204
+ } ,
205
+ // On win/linux, ctrl+up can always focus the chat list
206
+ {
207
+ when : ContextKeyExpr . or ( IsWindowsContext , IsLinuxContext ) ,
208
+ primary : KeyMod . CtrlCmd | KeyCode . UpArrow ,
209
+ weight : KeybindingWeight . EditorContrib ,
210
+ }
211
+ ]
202
212
} ) ;
203
213
}
204
214
0 commit comments