Files
tabby/tabby-electron/src/shells/cygwin32.ts
T
EugeneandGitHub e151472b95 Merge commit from fork
* improve quoting of dropped paths

* Update pathDrop.ts
2026-05-17 11:58:55 +02:00

46 lines
1.2 KiB
TypeScript

import * as path from 'path'
import { Injectable } from '@angular/core'
import { HostAppService, Platform } from 'tabby-core'
import { ShellProvider, Shell } from 'tabby-local'
/* eslint-disable block-scoped-var */
try {
var wnr = require('windows-native-registry') // eslint-disable-line @typescript-eslint/no-var-requires, no-var
} catch { }
/** @hidden */
@Injectable()
export class Cygwin32ShellProvider extends ShellProvider {
constructor (
private hostApp: HostAppService,
) {
super()
}
async provide (): Promise<Shell[]> {
if (this.hostApp.platform !== Platform.Windows) {
return []
}
const cygwinPath = wnr.getRegistryValue(wnr.HK.LM, 'Software\\WOW6432Node\\Cygwin\\setup', 'rootdir')
if (!cygwinPath) {
return []
}
return [{
id: 'cygwin32',
name: 'Cygwin (32 bit)',
command: path.join(cygwinPath, 'bin', 'bash.exe'),
args: ['--login', '-i'],
icon: require('../icons/cygwin.svg'),
env: {
TERM: 'cygwin',
},
shellType: 'unix',
}]
}
}