@@ -1836,8 +1836,6 @@ export function registerTerminalActions() {
1836
1836
const terminalGroupService = accessor . get ( ITerminalGroupService ) ;
1837
1837
const workspaceContextService = accessor . get ( IWorkspaceContextService ) ;
1838
1838
const commandService = accessor . get ( ICommandService ) ;
1839
- const configurationService = accessor . get ( IConfigurationService ) ;
1840
- const configurationResolverService = accessor . get ( IConfigurationResolverService ) ;
1841
1839
const folders = workspaceContextService . getWorkspace ( ) . folders ;
1842
1840
if ( eventOrOptions && eventOrOptions instanceof MouseEvent && ( eventOrOptions . altKey || eventOrOptions . ctrlKey ) ) {
1843
1841
await terminalService . createTerminal ( { location : { splitActiveTerminal : true } } ) ;
@@ -1853,27 +1851,12 @@ export function registerTerminalActions() {
1853
1851
// single root
1854
1852
instance = await terminalService . createTerminal ( eventOrOptions ) ;
1855
1853
} 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 ) {
1861
1856
// Don't create the instance if the workspace picker was canceled
1862
1857
return ;
1863
1858
}
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 ;
1877
1860
instance = await terminalService . createTerminal ( eventOrOptions ) ;
1878
1861
}
1879
1862
terminalService . setActiveInstance ( instance ) ;
0 commit comments