@@ -1836,8 +1836,6 @@ export function registerTerminalActions() {
18361836 const terminalGroupService = accessor . get ( ITerminalGroupService ) ;
18371837 const workspaceContextService = accessor . get ( IWorkspaceContextService ) ;
18381838 const commandService = accessor . get ( ICommandService ) ;
1839- const configurationService = accessor . get ( IConfigurationService ) ;
1840- const configurationResolverService = accessor . get ( IConfigurationResolverService ) ;
18411839 const folders = workspaceContextService . getWorkspace ( ) . folders ;
18421840 if ( eventOrOptions && eventOrOptions instanceof MouseEvent && ( eventOrOptions . altKey || eventOrOptions . ctrlKey ) ) {
18431841 await terminalService . createTerminal ( { location : { splitActiveTerminal : true } } ) ;
@@ -1853,27 +1851,12 @@ export function registerTerminalActions() {
18531851 // single root
18541852 instance = await terminalService . createTerminal ( eventOrOptions ) ;
18551853 } else {
1856- const options : IPickOptions < IQuickPickItem > = {
1857- placeHolder : localize ( 'workbench.action.terminal.newWorkspacePlaceholder' , "Select current working directory for new terminal" )
1858- } ;
1859- const workspace = await commandService . executeCommand < IWorkspaceFolder > ( PICK_WORKSPACE_FOLDER_COMMAND_ID , [ options ] ) ;
1860- if ( ! workspace ) {
1854+ const cwd = ( await pickTerminalCwd ( accessor ) ) ?. cwd ;
1855+ if ( ! cwd ) {
18611856 // Don't create the instance if the workspace picker was canceled
18621857 return ;
18631858 }
1864- eventOrOptions . cwd = workspace . uri ;
1865- const cwdConfig = configurationService . getValue ( TerminalSettingId . Cwd , { resource : workspace . uri } ) ;
1866- if ( typeof cwdConfig === 'string' && cwdConfig . length > 0 ) {
1867- const resolvedCwdConfig = await configurationResolverService . resolveAsync ( workspace , cwdConfig ) ;
1868- if ( isAbsolute ( resolvedCwdConfig ) || resolvedCwdConfig . startsWith ( AbstractVariableResolverService . VARIABLE_LHS ) ) {
1869- eventOrOptions . cwd = URI . from ( {
1870- scheme : workspace . uri . scheme ,
1871- path : resolvedCwdConfig
1872- } ) ;
1873- } else {
1874- eventOrOptions . cwd = URI . joinPath ( workspace . uri , resolvedCwdConfig ) ;
1875- }
1876- }
1859+ eventOrOptions . cwd = cwd ;
18771860 instance = await terminalService . createTerminal ( eventOrOptions ) ;
18781861 }
18791862 terminalService . setActiveInstance ( instance ) ;
0 commit comments