@@ -44,7 +44,7 @@ function getDirectory(vaultBasePath: string, file: TAbstractFile): string {
4444function openInDefaultTerminal ( directory : string , settings : OpenTermSettings ) : void {
4545 if ( Platform . isWin ) {
4646 const exe = settings . windowsDefaultExe || "cmd.exe" ;
47- execFile ( "cmd.exe" , [ "/c" , "start" , exe , "/k ", `cd /d " ${ directory } "` ] ) ;
47+ execFile ( "cmd.exe" , [ "/c" , "start" , "/D ", directory , exe ] ) ;
4848 } else if ( Platform . isMacOS ) {
4949 const app = settings . macTerminalApp || "Terminal" ;
5050 execFile ( "open" , [ "-a" , app , directory ] ) ;
@@ -77,7 +77,7 @@ function openInPowerShell(directory: string, settings: OpenTermSettings): void {
7777
7878function openInCmd ( directory : string , settings : OpenTermSettings ) : void {
7979 const exe = settings . cmdExe || "cmd.exe" ;
80- execFile ( "cmd.exe" , [ "/c" , "start" , exe , "/k ", `cd /d " ${ directory } "` ] ) ;
80+ execFile ( "cmd.exe" , [ "/c" , "start" , "/D ", directory , exe ] ) ;
8181}
8282
8383export default class OpenTermPlugin extends Plugin {
0 commit comments