@@ -1742,6 +1742,7 @@ export function registerTerminalActions() {
1742
1742
const workspaceContextService = accessor . get ( IWorkspaceContextService ) ;
1743
1743
const commandService = accessor . get ( ICommandService ) ;
1744
1744
const configurationService = accessor . get ( IConfigurationService ) ;
1745
+ const configurationResolverService = accessor . get ( IConfigurationResolverService ) ;
1745
1746
const folders = workspaceContextService . getWorkspace ( ) . folders ;
1746
1747
if ( eventOrOptions && eventOrOptions instanceof MouseEvent && ( eventOrOptions . altKey || eventOrOptions . ctrlKey ) ) {
1747
1748
await terminalService . createTerminal ( { location : { splitActiveTerminal : true } } ) ;
@@ -1768,13 +1769,14 @@ export function registerTerminalActions() {
1768
1769
eventOrOptions . cwd = workspace . uri ;
1769
1770
const cwdConfig = configurationService . getValue ( TerminalSettingId . Cwd , { resource : workspace . uri } ) ;
1770
1771
if ( typeof cwdConfig === 'string' && cwdConfig . length > 0 ) {
1771
- if ( isAbsolute ( cwdConfig ) || cwdConfig . startsWith ( AbstractVariableResolverService . VARIABLE_LHS ) ) {
1772
+ const resolvedCwdConfig = await configurationResolverService . resolveAsync ( workspace , cwdConfig ) ;
1773
+ if ( isAbsolute ( resolvedCwdConfig ) || resolvedCwdConfig . startsWith ( AbstractVariableResolverService . VARIABLE_LHS ) ) {
1772
1774
eventOrOptions . cwd = URI . from ( {
1773
1775
scheme : workspace . uri . scheme ,
1774
- path : cwdConfig
1776
+ path : resolvedCwdConfig
1775
1777
} ) ;
1776
1778
} else {
1777
- eventOrOptions . cwd = URI . joinPath ( workspace . uri , cwdConfig ) ;
1779
+ eventOrOptions . cwd = URI . joinPath ( workspace . uri , resolvedCwdConfig ) ;
1778
1780
}
1779
1781
}
1780
1782
instance = await terminalService . createTerminal ( eventOrOptions ) ;
0 commit comments