@@ -27,7 +27,7 @@ import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from '../../../../platform/accessi
27
27
import { Action2 , IAction2Options , MenuId , registerAction2 } from '../../../../platform/actions/common/actions.js' ;
28
28
import { ICommandService } from '../../../../platform/commands/common/commands.js' ;
29
29
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js' ;
30
- import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js' ;
30
+ import { ContextKeyExpr , IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js' ;
31
31
import { FileKind } from '../../../../platform/files/common/files.js' ;
32
32
import { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js' ;
33
33
import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js' ;
@@ -55,6 +55,7 @@ import { accessibleViewCurrentProviderId, accessibleViewIsShown, accessibleViewO
55
55
import { IRemoteTerminalAttachTarget , ITerminalProfileResolverService , ITerminalProfileService , TERMINAL_VIEW_ID , TerminalCommandId } from '../common/terminal.js' ;
56
56
import { TerminalContextKeys } from '../common/terminalContextKey.js' ;
57
57
import { terminalStrings } from '../common/terminalStrings.js' ;
58
+ import { IsAuxiliaryWindowContext } from '../../../common/contextkeys.js' ;
58
59
import { Direction , ICreateTerminalOptions , IDetachedTerminalInstance , ITerminalConfigurationService , ITerminalEditorService , ITerminalGroupService , ITerminalInstance , ITerminalInstanceService , ITerminalService , IXtermTerminal } from './terminal.js' ;
59
60
import { InstanceContext } from './terminalContextMenu.js' ;
60
61
import { getColorClass , getIconId , getUriClasses } from './terminalIcon.js' ;
@@ -1178,15 +1179,25 @@ export function registerTerminalActions() {
1178
1179
let eventOrOptions = isObject ( args ) ? args as MouseEvent | ICreateTerminalOptions : undefined ;
1179
1180
const workspaceContextService = accessor . get ( IWorkspaceContextService ) ;
1180
1181
const commandService = accessor . get ( ICommandService ) ;
1182
+ const contextKeyService = accessor . get ( IContextKeyService ) ;
1183
+ const editorGroupsService = accessor . get ( IEditorGroupsService ) ;
1181
1184
const folders = workspaceContextService . getWorkspace ( ) . folders ;
1182
1185
if ( eventOrOptions && isMouseEvent ( eventOrOptions ) && ( eventOrOptions . altKey || eventOrOptions . ctrlKey ) ) {
1183
1186
await c . service . createTerminal ( { location : { splitActiveTerminal : true } } ) ;
1184
1187
return ;
1185
1188
}
1186
1189
1190
+ // Check if we're in an auxiliary window and need to create the terminal there
1191
+ const isAuxiliaryWindow = contextKeyService . getContextKeyValue ( IsAuxiliaryWindowContext . key ) ;
1192
+
1187
1193
if ( c . service . isProcessSupportRegistered ) {
1188
1194
eventOrOptions = ! eventOrOptions || isMouseEvent ( eventOrOptions ) ? { } : eventOrOptions ;
1189
1195
1196
+ // If we're in an auxiliary window, create the terminal in the current window's editor area
1197
+ if ( isAuxiliaryWindow && ! eventOrOptions . location ) {
1198
+ eventOrOptions . location = { viewColumn : editorGroupToColumn ( editorGroupsService , editorGroupsService . activeGroup ) } ;
1199
+ }
1200
+
1190
1201
let instance : ITerminalInstance | undefined ;
1191
1202
if ( folders . length <= 1 ) {
1192
1203
// Allow terminal service to handle the path when there is only a
0 commit comments