mirror of
https://github.com/Eugeny/tabby.git
synced 2025-10-05 22:44:55 +00:00
clink
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import * as path from 'path'
|
||||
import { Injectable } from '@angular/core'
|
||||
import { HotkeysService, ToolbarButtonProvider, IToolbarButton, AppService, ConfigService } from 'terminus-core'
|
||||
import { HotkeysService, ToolbarButtonProvider, IToolbarButton, AppService, ConfigService, ElectronService } from 'terminus-core'
|
||||
|
||||
import { SessionsService } from './services/sessions.service'
|
||||
import { TerminalTabComponent } from './components/terminalTab.component'
|
||||
@@ -10,6 +11,7 @@ export class ButtonProvider extends ToolbarButtonProvider {
|
||||
private app: AppService,
|
||||
private sessions: SessionsService,
|
||||
private config: ConfigService,
|
||||
private electron: ElectronService,
|
||||
hotkeys: HotkeysService,
|
||||
) {
|
||||
super()
|
||||
@@ -26,9 +28,24 @@ export class ButtonProvider extends ToolbarButtonProvider {
|
||||
cwd = await this.app.activeTab.session.getWorkingDirectory()
|
||||
}
|
||||
let command = this.config.store.terminal.shell
|
||||
let args = []
|
||||
// TODO move this?
|
||||
if (command === '~clink~') {
|
||||
command = 'cmd.exe'
|
||||
args = [
|
||||
'/k',
|
||||
path.join(
|
||||
path.dirname(this.electron.app.getPath('exe')),
|
||||
(process.platform == 'darwin') ? '../Resources' : 'resources',
|
||||
'clink',
|
||||
`clink_${process.arch}.exe`,
|
||||
),
|
||||
'inject',
|
||||
]
|
||||
}
|
||||
this.app.openNewTab(
|
||||
TerminalTabComponent,
|
||||
{ session: await this.sessions.createNewSession({ command, cwd }) }
|
||||
{ session: await this.sessions.createNewSession({ command, args, cwd }) }
|
||||
)
|
||||
}
|
||||
|
||||
|
@@ -55,7 +55,8 @@ export class TerminalSettingsTabComponent {
|
||||
}
|
||||
if (this.hostApp.platform === Platform.Windows) {
|
||||
this.shells = [
|
||||
{ name: 'CMD', command: 'cmd.exe' },
|
||||
{ name: 'CMD (clink)', command: '~clink~' },
|
||||
{ name: 'CMD (stock)', command: 'cmd.exe' },
|
||||
{ name: 'PowerShell', command: 'powershell.exe' },
|
||||
]
|
||||
const wslPath = `${process.env.windir}\\system32\\bash.exe`
|
||||
|
@@ -36,7 +36,7 @@ export class TerminalConfigProvider extends ConfigProvider {
|
||||
[Platform.Windows]: {
|
||||
terminal: {
|
||||
font: 'Consolas',
|
||||
shell: 'cmd.exe',
|
||||
shell: '~clink~',
|
||||
},
|
||||
hotkeys: {
|
||||
'new-tab': [
|
||||
|
@@ -7,6 +7,8 @@ import { Injectable } from '@angular/core'
|
||||
import { Logger, LogService } from 'terminus-core'
|
||||
import { SessionOptions, SessionPersistenceProvider } from './api'
|
||||
|
||||
declare function delay(ms: number): Promise<void>
|
||||
|
||||
interface IChildProcess {
|
||||
pid: number
|
||||
ppid: number
|
||||
|
Reference in New Issue
Block a user