2
0
mirror of https://github.com/Eugeny/tabby.git synced 2025-04-24 16:30:55 +08:00

set Terminus as COMSPEC inside shells - fixes

This commit is contained in:
Eugene Pankov 2021-05-16 19:40:54 +02:00
parent 2f865e70c5
commit 7398d776be
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
10 changed files with 25 additions and 8 deletions

@ -1,3 +1,4 @@
export interface BootstrapData {
config: Record<string, any>
executable: string
}

@ -10,7 +10,7 @@ export function parseArgs (argv: string[], cwd: string): any {
.command('open [directory]', 'open a shell in a directory', {
directory: { type: 'string', 'default': cwd },
})
.command('run [command...]', 'run a command in the terminal', {
.command(['run [command...]', '/k'], 'run a command in the terminal', {
command: { type: 'string' },
})
.command('profile [profileName]', 'open a tab with specified profile', {

@ -296,6 +296,7 @@ export class Window {
}
this.window.webContents.send('start', {
config: this.configStore,
executable: app.getPath('exe'),
})
})

@ -54,6 +54,8 @@ async function bootstrap (plugins: PluginInfo[], bootstrapData: BootstrapData, s
ipcRenderer.once('start', async (_$event, bootstrapData: BootstrapData) => {
console.log('Window bootstrap data:', bootstrapData)
;(window as any).bootstrapData = bootstrapData
let plugins = await findPlugins()
if (bootstrapData.config.pluginBlacklist) {
plugins = plugins.filter(x => !bootstrapData.config.pluginBlacklist.includes(x.name))

@ -17,8 +17,8 @@ if (exports.version.includes('-c')) {
exports.builtinPlugins = [
'terminus-core',
'terminus-settings',
'terminus-local',
'terminus-terminal',
'terminus-local',
'terminus-community-color-schemes',
'terminus-plugin-manager',
'terminus-ssh',

@ -10,6 +10,7 @@ export { Theme } from './theme'
export { TabContextMenuItemProvider } from './tabContextMenuProvider'
export { SelectorOption } from './selector'
export { CLIHandler, CLIEvent } from './cli'
export { BootstrapData } from './main-process'
export { AppService } from '../services/app.service'
export { ConfigService } from '../services/config.service'

@ -0,0 +1,4 @@
export interface BootstrapData {
config: Record<string, any>
executable: string
}

@ -0,0 +1,4 @@
export interface BootstrapData {
config: Record<string, any>
executable: string
}

@ -24,12 +24,7 @@ import { WelcomeTabComponent } from './components/welcomeTab.component'
import { AutofocusDirective } from './directives/autofocus.directive'
import { FastHtmlBindDirective } from './directives/fastHtmlBind.directive'
import { HotkeyProvider } from './api/hotkeyProvider'
import { ConfigProvider } from './api/configProvider'
import { Theme } from './api/theme'
import { CLIHandler } from './api/cli'
import { TabContextMenuItemProvider } from './api/tabContextMenuProvider'
import { TabRecoveryProvider } from './api/tabRecovery'
import { Theme, CLIHandler, BootstrapData, TabContextMenuItemProvider, TabRecoveryProvider, HotkeyProvider, ConfigProvider } from './api'
import { AppService } from './services/app.service'
import { ConfigService } from './services/config.service'
@ -115,6 +110,10 @@ export default class AppModule { // eslint-disable-line @typescript-eslint/no-ex
}
}
export function getBootstrapData (): BootstrapData {
return (window as any).bootstrapData
}
export { AppRootComponent as bootstrap }
export * from './api'

@ -1,6 +1,7 @@
import * as psNode from 'ps-node'
import * as fs from 'mz/fs'
import * as os from 'os'
import { getBootstrapData } from 'terminus-core'
import { BaseSession } from 'terminus-terminal'
import { ipcRenderer } from 'electron'
import { getWorkingDirectoryFromPID } from 'native-process-working-directory'
@ -115,6 +116,10 @@ export class Session extends BaseSession {
...this.config.store.terminal.environment || {},
}
if (process.platform === 'win32') {
env.COMSPEC = getBootstrapData().executable
}
delete env['']
if (process.platform === 'darwin' && !process.env.LC_ALL) {