Cmder support (fixes #347)

This commit is contained in:
Eugene Pankov
2018-05-20 13:30:45 +02:00
parent 1d69082e6c
commit 5d605a4853
3 changed files with 42 additions and 2 deletions

View File

@@ -0,0 +1,38 @@
import * as path from 'path'
import { Injectable } from '@angular/core'
import { HostAppService, Platform } from 'terminus-core'
import { ShellProvider, IShell } from '../api'
@Injectable()
export class CmderShellProvider extends ShellProvider {
constructor (
private hostApp: HostAppService,
) {
super()
}
async provide (): Promise<IShell[]> {
if (this.hostApp.platform !== Platform.Windows) {
return []
}
if (!process.env.CMDER_ROOT) {
return []
}
return [{
id: 'cmder',
name: 'Cmder',
command: 'cmd.exe',
args: [
'/k',
path.join(process.env.CMDER_ROOT, 'vendor', 'init.bat'),
]
env: {
TERM: 'cygwin',
}
}]
}
}