/
githubmirror
/
tabby
Обзор
Документация
Войти
/
githubmirror
/
tabby
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tabby-electron/src/shells/msys2.ts
49 строк
1 KB
Eugene
Merge commit from fork
17 май 2026, 12:58
Не верифицирован
17 май 2026, 12:58
e151472
Код
Авторство
О чём код?
import * as fs from 'fs/promises' import * as path from 'path' import { Injectable } from '@angular/core' import { HostAppService, Platform } from 'tabby-core' import { ShellProvider, Shell } from 'tabby-local' /** @hidden */ @Injectable() export class MSYS2ShellProvider extends ShellProvider { constructor ( private hostApp: HostAppService, ) { super() } async provide (): Promise<Shell[]> { if (this.hostApp.platform !== Platform.Windows) { return [] } const msys2Path = path.resolve(process.env.SystemRoot ?? 'C:\\Windows', '../msys64') try { await fs.access(msys2Path) } catch { 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'] return environments.map(e => ({ id: `msys2-${e}`, name: `MSYS2 (${e.toUpperCase()})`, command: path.join(msys2Path, 'msys2_shell.cmd'), args: ['-defterm', '-here', '-no-start', '-' + e], icon: require('../icons/msys2.svg'), env: {}, cwd: homePath, shellType: 'unix', })) } }