mirror of
https://github.com/Eugeny/tabby.git
synced 2025-10-05 22:44:55 +00:00
Cmder support (fixes #347)
This commit is contained in:
38
terminus-terminal/src/shells/cmder.ts
Normal file
38
terminus-terminal/src/shells/cmder.ts
Normal 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',
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user