mirror of
https://github.com/Eugeny/tabby.git
synced 2024-11-24 06:04:04 +03:00
parent
6f8f83d178
commit
b640abd85d
@ -1,7 +1,7 @@
|
||||
import * as fs from 'mz/fs'
|
||||
import * as path from 'path'
|
||||
import { Injectable } from '@angular/core'
|
||||
import { HotkeysService, ToolbarButtonProvider, IToolbarButton, AppService, ConfigService, HostAppService, ElectronService } from 'terminus-core'
|
||||
import { HotkeysService, ToolbarButtonProvider, IToolbarButton, AppService, ConfigService, HostAppService, Platform, ElectronService } from 'terminus-core'
|
||||
|
||||
import { SessionsService } from './services/sessions.service'
|
||||
import { ShellsService } from './services/shells.service'
|
||||
@ -14,8 +14,8 @@ export class ButtonProvider extends ToolbarButtonProvider {
|
||||
private sessions: SessionsService,
|
||||
private config: ConfigService,
|
||||
private shells: ShellsService,
|
||||
private hostApp: HostAppService,
|
||||
electron: ElectronService,
|
||||
hostApp: HostAppService,
|
||||
hotkeys: HotkeysService,
|
||||
) {
|
||||
super()
|
||||
@ -51,14 +51,23 @@ export class ButtonProvider extends ToolbarButtonProvider {
|
||||
cwd = await this.app.activeTab.session.getWorkingDirectory()
|
||||
}
|
||||
let command = this.config.store.terminal.shell
|
||||
let args = []
|
||||
let env: any = {}
|
||||
let args: string[] = []
|
||||
if (command === '~clink~') {
|
||||
({ command, args } = this.shells.getClinkOptions())
|
||||
}
|
||||
if (command === '~default-shell~') {
|
||||
command = await this.shells.getDefaultShell()
|
||||
}
|
||||
let sessionOptions = await this.sessions.prepareNewSession({ command, args, cwd })
|
||||
if (this.hostApp.platform === Platform.Windows) {
|
||||
env.TERM = 'cygwin'
|
||||
}
|
||||
let sessionOptions = await this.sessions.prepareNewSession({
|
||||
command,
|
||||
args,
|
||||
cwd,
|
||||
env,
|
||||
})
|
||||
this.app.openNewTab(
|
||||
TerminalTabComponent,
|
||||
{ sessionOptions }
|
||||
|
@ -25,8 +25,8 @@ export class Session {
|
||||
|
||||
let env = {
|
||||
...process.env,
|
||||
...options.env,
|
||||
TERM: 'xterm-256color',
|
||||
...options.env,
|
||||
}
|
||||
|
||||
if (process.platform === 'darwin' && !process.env.LC_ALL) {
|
||||
|
Loading…
Reference in New Issue
Block a user