1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-12-22 18:11:43 +03:00

msys2: set correct starting directory - fixes #6079

This commit is contained in:
Eugene Pankov 2022-04-02 17:46:34 +02:00
parent 3a012878d0
commit 94b3212afb
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
3 changed files with 11 additions and 0 deletions

View File

@ -13,6 +13,8 @@ export interface Shell {
*/ */
fsBase?: string fsBase?: string
cwd?: string
/** /**
* SVG icon * SVG icon
*/ */

View File

@ -80,6 +80,7 @@ export class LocalProfilesService extends ProfileProvider<LocalProfile> {
command: shell.command, command: shell.command,
args: shell.args ?? [], args: shell.args ?? [],
env: shell.env, env: shell.env,
cwd: shell.cwd,
} }
} }

View File

@ -26,6 +26,13 @@ export class MSYS2ShellProvider extends ShellProvider {
return [] return []
} }
let homePath: string|undefined = path.resolve(msys2Path, 'home', process.env.USERNAME!)
try {
await fs.access(msys2Path)
} catch {
homePath = undefined
}
const environments = ['msys', 'mingw64', 'clang64', 'ucrt64'] const environments = ['msys', 'mingw64', 'clang64', 'ucrt64']
return environments.map(e => ({ return environments.map(e => ({
@ -35,6 +42,7 @@ export class MSYS2ShellProvider extends ShellProvider {
args: ['-defterm', '-here', '-no-start', '-' + e], args: ['-defterm', '-here', '-no-start', '-' + e],
icon: require('../icons/msys2.svg'), icon: require('../icons/msys2.svg'),
env: {}, env: {},
cwd: homePath,
})) }))
} }
} }