moved electron-specific parts of tabby-local into tabby-electron
@ -176,6 +176,7 @@ export abstract class PlatformService {
|
|||||||
abstract setErrorHandler (handler: (_: any) => void): void
|
abstract setErrorHandler (handler: (_: any) => void): void
|
||||||
abstract popupContextMenu (menu: MenuItemOptions[], event?: MouseEvent): void
|
abstract popupContextMenu (menu: MenuItemOptions[], event?: MouseEvent): void
|
||||||
abstract showMessageBox (options: MessageBoxOptions): Promise<MessageBoxResult>
|
abstract showMessageBox (options: MessageBoxOptions): Promise<MessageBoxResult>
|
||||||
|
abstract pickDirectory (): Promise<string>
|
||||||
abstract quit (): void
|
abstract quit (): void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,8 +16,12 @@
|
|||||||
],
|
],
|
||||||
"author": "Eugene Pankov",
|
"author": "Eugene Pankov",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"hasbin": "^1.2.3"
|
||||||
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@angular/core": "^9.1.9"
|
"@angular/core": "^9.1.9",
|
||||||
|
"tabby-local": "*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"electron-promise-ipc": "^2.2.4",
|
"electron-promise-ipc": "^2.2.4",
|
||||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 392 B After Width: | Height: | Size: 392 B |
Before Width: | Height: | Size: 392 B After Width: | Height: | Size: 392 B |
Before Width: | Height: | Size: 567 B After Width: | Height: | Size: 567 B |
Before Width: | Height: | Size: 570 B After Width: | Height: | Size: 570 B |
Before Width: | Height: | Size: 315 B After Width: | Height: | Size: 315 B |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 205 KiB After Width: | Height: | Size: 205 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 287 B After Width: | Height: | Size: 287 B |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 551 B After Width: | Height: | Size: 551 B |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
@ -2,6 +2,7 @@ import { NgModule } from '@angular/core'
|
|||||||
import { PlatformService, LogService, UpdaterService, DockingService, HostAppService, ThemesService, Platform, AppService, ConfigService, WIN_BUILD_FLUENT_BG_SUPPORTED, isWindowsBuild, HostWindowService, HotkeyProvider, ConfigProvider, FileProvider } from 'tabby-core'
|
import { PlatformService, LogService, UpdaterService, DockingService, HostAppService, ThemesService, Platform, AppService, ConfigService, WIN_BUILD_FLUENT_BG_SUPPORTED, isWindowsBuild, HostWindowService, HotkeyProvider, ConfigProvider, FileProvider } from 'tabby-core'
|
||||||
import { TerminalColorSchemeProvider } from 'tabby-terminal'
|
import { TerminalColorSchemeProvider } from 'tabby-terminal'
|
||||||
import { SFTPContextMenuItemProvider, SSHProfileImporter, AutoPrivateKeyLocator } from 'tabby-ssh'
|
import { SFTPContextMenuItemProvider, SSHProfileImporter, AutoPrivateKeyLocator } from 'tabby-ssh'
|
||||||
|
import { ShellProvider, UACService } from 'tabby-local'
|
||||||
import { auditTime } from 'rxjs'
|
import { auditTime } from 'rxjs'
|
||||||
|
|
||||||
import { HyperColorSchemes } from './colorSchemes'
|
import { HyperColorSchemes } from './colorSchemes'
|
||||||
@ -14,10 +15,26 @@ import { ElectronHostWindow } from './services/hostWindow.service'
|
|||||||
import { ElectronFileProvider } from './services/fileProvider.service'
|
import { ElectronFileProvider } from './services/fileProvider.service'
|
||||||
import { ElectronHostAppService } from './services/hostApp.service'
|
import { ElectronHostAppService } from './services/hostApp.service'
|
||||||
import { ElectronService } from './services/electron.service'
|
import { ElectronService } from './services/electron.service'
|
||||||
|
import { DockMenuService } from './services/dockMenu.service'
|
||||||
import { ElectronHotkeyProvider } from './hotkeys'
|
import { ElectronHotkeyProvider } from './hotkeys'
|
||||||
import { ElectronConfigProvider } from './config'
|
import { ElectronConfigProvider } from './config'
|
||||||
import { EditSFTPContextMenu } from './sftpContextMenu'
|
import { EditSFTPContextMenu } from './sftpContextMenu'
|
||||||
import { OpenSSHImporter, PrivateKeyLocator, StaticFileImporter } from './sshImporters'
|
import { OpenSSHImporter, PrivateKeyLocator, StaticFileImporter } from './sshImporters'
|
||||||
|
import { ElectronUACService } from './services/uac.service'
|
||||||
|
|
||||||
|
import { CmderShellProvider } from './shells/cmder'
|
||||||
|
import { Cygwin32ShellProvider } from './shells/cygwin32'
|
||||||
|
import { Cygwin64ShellProvider } from './shells/cygwin64'
|
||||||
|
import { GitBashShellProvider } from './shells/gitBash'
|
||||||
|
import { LinuxDefaultShellProvider } from './shells/linuxDefault'
|
||||||
|
import { MacOSDefaultShellProvider } from './shells/macDefault'
|
||||||
|
import { MSYS2ShellProvider } from './shells/msys2'
|
||||||
|
import { POSIXShellsProvider } from './shells/posix'
|
||||||
|
import { PowerShellCoreShellProvider } from './shells/powershellCore'
|
||||||
|
import { WindowsDefaultShellProvider } from './shells/winDefault'
|
||||||
|
import { WindowsStockShellsProvider } from './shells/windowsStock'
|
||||||
|
import { WSLShellProvider } from './shells/wsl'
|
||||||
|
import { VSDevToolsProvider } from './shells/vs'
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
providers: [
|
providers: [
|
||||||
@ -35,6 +52,27 @@ import { OpenSSHImporter, PrivateKeyLocator, StaticFileImporter } from './sshImp
|
|||||||
{ provide: SSHProfileImporter, useExisting: OpenSSHImporter, multi: true },
|
{ provide: SSHProfileImporter, useExisting: OpenSSHImporter, multi: true },
|
||||||
{ provide: SSHProfileImporter, useExisting: StaticFileImporter, multi: true },
|
{ provide: SSHProfileImporter, useExisting: StaticFileImporter, multi: true },
|
||||||
{ provide: AutoPrivateKeyLocator, useExisting: PrivateKeyLocator, multi: true },
|
{ provide: AutoPrivateKeyLocator, useExisting: PrivateKeyLocator, multi: true },
|
||||||
|
|
||||||
|
{ provide: ShellProvider, useClass: WindowsDefaultShellProvider, multi: true },
|
||||||
|
{ provide: ShellProvider, useClass: MacOSDefaultShellProvider, multi: true },
|
||||||
|
{ provide: ShellProvider, useClass: LinuxDefaultShellProvider, multi: true },
|
||||||
|
{ provide: ShellProvider, useClass: WindowsStockShellsProvider, multi: true },
|
||||||
|
{ provide: ShellProvider, useClass: PowerShellCoreShellProvider, multi: true },
|
||||||
|
{ provide: ShellProvider, useClass: CmderShellProvider, multi: true },
|
||||||
|
{ provide: ShellProvider, useClass: Cygwin32ShellProvider, multi: true },
|
||||||
|
{ provide: ShellProvider, useClass: Cygwin64ShellProvider, multi: true },
|
||||||
|
{ provide: ShellProvider, useClass: GitBashShellProvider, multi: true },
|
||||||
|
{ provide: ShellProvider, useClass: POSIXShellsProvider, multi: true },
|
||||||
|
{ provide: ShellProvider, useClass: MSYS2ShellProvider, multi: true },
|
||||||
|
{ provide: ShellProvider, useClass: WSLShellProvider, multi: true },
|
||||||
|
{ provide: ShellProvider, useClass: VSDevToolsProvider, multi: true },
|
||||||
|
|
||||||
|
{ provide: UACService, useClass: ElectronUACService },
|
||||||
|
|
||||||
|
// For WindowsDefaultShellProvider
|
||||||
|
PowerShellCoreShellProvider,
|
||||||
|
WSLShellProvider,
|
||||||
|
WindowsStockShellsProvider,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export default class ElectronModule {
|
export default class ElectronModule {
|
||||||
@ -47,6 +85,7 @@ export default class ElectronModule {
|
|||||||
docking: DockingService,
|
docking: DockingService,
|
||||||
themeService: ThemesService,
|
themeService: ThemesService,
|
||||||
app: AppService,
|
app: AppService,
|
||||||
|
dockMenu: DockMenuService,
|
||||||
) {
|
) {
|
||||||
config.ready$.toPromise().then(() => {
|
config.ready$.toPromise().then(() => {
|
||||||
touchbar.update()
|
touchbar.update()
|
||||||
@ -87,6 +126,10 @@ export default class ElectronModule {
|
|||||||
})
|
})
|
||||||
|
|
||||||
config.changed$.subscribe(() => this.updateVibrancy())
|
config.changed$.subscribe(() => this.updateVibrancy())
|
||||||
|
|
||||||
|
config.ready$.toPromise().then(() => {
|
||||||
|
dockMenu.update()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private registerGlobalHotkey () {
|
private registerGlobalHotkey () {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { NgZone, Injectable } from '@angular/core'
|
import { NgZone, Injectable } from '@angular/core'
|
||||||
import { ConfigService, HostAppService, Platform, ProfilesService, TranslateService } from 'tabby-core'
|
import { ConfigService, HostAppService, Platform, ProfilesService, TranslateService } from 'tabby-core'
|
||||||
import { ElectronService } from 'tabby-electron'
|
import { ElectronService } from './electron.service'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
@ -234,6 +234,15 @@ export class ElectronPlatformService extends PlatformService {
|
|||||||
handler(err)
|
handler(err)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async pickDirectory (): Promise<string> {
|
||||||
|
return (await this.electron.dialog.showOpenDialog(
|
||||||
|
this.hostWindow.getWindow(),
|
||||||
|
{
|
||||||
|
properties: ['openDirectory', 'showHiddenFiles'],
|
||||||
|
},
|
||||||
|
)).filePaths[0]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ElectronFileUpload extends FileUpload {
|
class ElectronFileUpload extends FileUpload {
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
import * as path from 'path'
|
|
||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
|
import * as path from 'path'
|
||||||
import { WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild } from 'tabby-core'
|
import { WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild } from 'tabby-core'
|
||||||
import { ElectronService } from 'tabby-electron'
|
import { SessionOptions, UACService } from 'tabby-local'
|
||||||
import { SessionOptions } from '../api'
|
import { ElectronService } from './electron.service'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable()
|
||||||
export class UACService {
|
export class ElectronUACService extends UACService {
|
||||||
isAvailable = false
|
constructor (
|
||||||
|
|
||||||
private constructor (
|
|
||||||
private electron: ElectronService,
|
private electron: ElectronService,
|
||||||
) {
|
) {
|
||||||
|
super()
|
||||||
this.isAvailable = isWindowsBuild(WIN_BUILD_CONPTY_SUPPORTED)
|
this.isAvailable = isWindowsBuild(WIN_BUILD_CONPTY_SUPPORTED)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,5 +36,4 @@ export class UACService {
|
|||||||
options.command = helperPath
|
options.command = helperPath
|
||||||
return options
|
return options
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -2,7 +2,7 @@ import * as path from 'path'
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { HostAppService, Platform } from 'tabby-core'
|
import { HostAppService, Platform } from 'tabby-core'
|
||||||
|
|
||||||
import { ShellProvider, Shell } from '../api'
|
import { ShellProvider, Shell } from 'tabby-local'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable()
|
@Injectable()
|
@ -2,7 +2,7 @@ import * as path from 'path'
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { HostAppService, Platform } from 'tabby-core'
|
import { HostAppService, Platform } from 'tabby-core'
|
||||||
|
|
||||||
import { ShellProvider, Shell } from '../api'
|
import { ShellProvider, Shell } from 'tabby-local'
|
||||||
|
|
||||||
/* eslint-disable block-scoped-var */
|
/* eslint-disable block-scoped-var */
|
||||||
|
|
@ -2,7 +2,7 @@ import * as path from 'path'
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { HostAppService, Platform } from 'tabby-core'
|
import { HostAppService, Platform } from 'tabby-core'
|
||||||
|
|
||||||
import { ShellProvider, Shell } from '../api'
|
import { ShellProvider, Shell } from 'tabby-local'
|
||||||
|
|
||||||
/* eslint-disable block-scoped-var */
|
/* eslint-disable block-scoped-var */
|
||||||
|
|
@ -2,7 +2,7 @@ import * as path from 'path'
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { Platform, ConfigService, HostAppService } from 'tabby-core'
|
import { Platform, ConfigService, HostAppService } from 'tabby-core'
|
||||||
|
|
||||||
import { Shell } from '../api'
|
import { Shell } from 'tabby-local'
|
||||||
import { WindowsBaseShellProvider } from './windowsBase'
|
import { WindowsBaseShellProvider } from './windowsBase'
|
||||||
|
|
||||||
/* eslint-disable block-scoped-var */
|
/* eslint-disable block-scoped-var */
|
@ -2,7 +2,7 @@ import * as fs from 'mz/fs'
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { HostAppService, Platform, LogService, Logger, TranslateService } from 'tabby-core'
|
import { HostAppService, Platform, LogService, Logger, TranslateService } from 'tabby-core'
|
||||||
|
|
||||||
import { ShellProvider, Shell } from '../api'
|
import { ShellProvider, Shell } from 'tabby-local'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable()
|
@Injectable()
|
@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'
|
|||||||
import promiseIpc, { RendererProcessType } from 'electron-promise-ipc'
|
import promiseIpc, { RendererProcessType } from 'electron-promise-ipc'
|
||||||
import { HostAppService, Platform, TranslateService } from 'tabby-core'
|
import { HostAppService, Platform, TranslateService } from 'tabby-core'
|
||||||
|
|
||||||
import { ShellProvider, Shell } from '../api'
|
import { ShellProvider, Shell } from 'tabby-local'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable()
|
@Injectable()
|
@ -3,7 +3,7 @@ import * as path from 'path'
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { HostAppService, Platform } from 'tabby-core'
|
import { HostAppService, Platform } from 'tabby-core'
|
||||||
|
|
||||||
import { ShellProvider, Shell } from '../api'
|
import { ShellProvider, Shell } from 'tabby-local'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable()
|
@Injectable()
|
@ -3,7 +3,7 @@ import slugify from 'slugify'
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { HostAppService, Platform } from 'tabby-core'
|
import { HostAppService, Platform } from 'tabby-core'
|
||||||
|
|
||||||
import { ShellProvider, Shell } from '../api'
|
import { ShellProvider, Shell } from 'tabby-local'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable()
|
@Injectable()
|
@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { HostAppService, ConfigService, Platform } from 'tabby-core'
|
import { HostAppService, ConfigService, Platform } from 'tabby-core'
|
||||||
|
|
||||||
import { Shell } from '../api'
|
import { Shell } from 'tabby-local'
|
||||||
import { WindowsBaseShellProvider } from './windowsBase'
|
import { WindowsBaseShellProvider } from './windowsBase'
|
||||||
|
|
||||||
/* eslint-disable block-scoped-var */
|
/* eslint-disable block-scoped-var */
|
@ -3,7 +3,7 @@ import * as fs from 'fs/promises'
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { HostAppService, Platform } from 'tabby-core'
|
import { HostAppService, Platform } from 'tabby-core'
|
||||||
|
|
||||||
import { ShellProvider, Shell } from '../api'
|
import { ShellProvider, Shell } from 'tabby-local'
|
||||||
|
|
||||||
/* eslint-disable quote-props */
|
/* eslint-disable quote-props */
|
||||||
const vsIconMap: Record<string, string> = {
|
const vsIconMap: Record<string, string> = {
|
@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { HostAppService, Platform, TranslateService } from 'tabby-core'
|
import { HostAppService, Platform, TranslateService } from 'tabby-core'
|
||||||
|
|
||||||
import { ShellProvider, Shell } from '../api'
|
import { ShellProvider, Shell } from 'tabby-local'
|
||||||
|
|
||||||
import { WSLShellProvider } from './wsl'
|
import { WSLShellProvider } from './wsl'
|
||||||
import { PowerShellCoreShellProvider } from './powershellCore'
|
import { PowerShellCoreShellProvider } from './powershellCore'
|
@ -1,6 +1,6 @@
|
|||||||
import { ConfigService, HostAppService } from 'tabby-core'
|
import { ConfigService, HostAppService } from 'tabby-core'
|
||||||
|
|
||||||
import { ShellProvider } from '../api'
|
import { ShellProvider } from 'tabby-local'
|
||||||
|
|
||||||
export abstract class WindowsBaseShellProvider extends ShellProvider {
|
export abstract class WindowsBaseShellProvider extends ShellProvider {
|
||||||
constructor (
|
constructor (
|
@ -3,9 +3,9 @@ import * as fs from 'fs/promises'
|
|||||||
import hasbin from 'hasbin'
|
import hasbin from 'hasbin'
|
||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { HostAppService, Platform, ConfigService } from 'tabby-core'
|
import { HostAppService, Platform, ConfigService } from 'tabby-core'
|
||||||
import { ElectronService } from 'tabby-electron'
|
import { ElectronService } from '../services/electron.service'
|
||||||
|
|
||||||
import { Shell } from '../api'
|
import { Shell } from 'tabby-local'
|
||||||
import { WindowsBaseShellProvider } from './windowsBase'
|
import { WindowsBaseShellProvider } from './windowsBase'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
@ -4,7 +4,7 @@ import slugify from 'slugify'
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { HostAppService, Platform, isWindowsBuild, WIN_BUILD_WSL_EXE_DISTRO_FLAG } from 'tabby-core'
|
import { HostAppService, Platform, isWindowsBuild, WIN_BUILD_WSL_EXE_DISTRO_FLAG } from 'tabby-core'
|
||||||
|
|
||||||
import { ShellProvider, Shell } from '../api'
|
import { ShellProvider, Shell } from 'tabby-local'
|
||||||
|
|
||||||
/* eslint-disable block-scoped-var */
|
/* eslint-disable block-scoped-var */
|
||||||
|
|
@ -21,6 +21,11 @@ async@^3.2.3:
|
|||||||
resolved "https://registry.yarnpkg.com/async/-/async-3.2.3.tgz#ac53dafd3f4720ee9e8a160628f18ea91df196c9"
|
resolved "https://registry.yarnpkg.com/async/-/async-3.2.3.tgz#ac53dafd3f4720ee9e8a160628f18ea91df196c9"
|
||||||
integrity sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==
|
integrity sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==
|
||||||
|
|
||||||
|
async@~1.5:
|
||||||
|
version "1.5.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
|
||||||
|
integrity sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==
|
||||||
|
|
||||||
balanced-match@^1.0.0:
|
balanced-match@^1.0.0:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
||||||
@ -199,6 +204,13 @@ has@^1.0.3:
|
|||||||
dependencies:
|
dependencies:
|
||||||
function-bind "^1.1.1"
|
function-bind "^1.1.1"
|
||||||
|
|
||||||
|
hasbin@^1.2.3:
|
||||||
|
version "1.2.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/hasbin/-/hasbin-1.2.3.tgz#78c5926893c80215c2b568ae1fd3fcab7a2696b0"
|
||||||
|
integrity sha512-CCd8e/w2w28G8DyZvKgiHnQJ/5XXDz6qiUHnthvtag/6T5acUeN5lqq+HMoBqcmgWueWDhiCplrw0Kb1zDACRg==
|
||||||
|
dependencies:
|
||||||
|
async "~1.5"
|
||||||
|
|
||||||
inflight@^1.0.4:
|
inflight@^1.0.4:
|
||||||
version "1.0.6"
|
version "1.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"ansi-colors": "^4.1.1",
|
"ansi-colors": "^4.1.1",
|
||||||
"dataurl": "0.1.0",
|
"dataurl": "0.1.0",
|
||||||
"hasbin": "^1.2.3",
|
|
||||||
"ps-node": "^0.1.6",
|
"ps-node": "^0.1.6",
|
||||||
"runes": "^0.4.2"
|
"runes": "^0.4.2"
|
||||||
},
|
},
|
||||||
|
@ -53,3 +53,9 @@ export interface ChildProcess {
|
|||||||
ppid: number
|
ppid: number
|
||||||
command: string
|
command: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export abstract class UACService {
|
||||||
|
isAvailable = false
|
||||||
|
|
||||||
|
abstract patchSessionOptionsForUAC (sessionOptions: SessionOptions): SessionOptions
|
||||||
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
command-line-editor([model]='profile.options')
|
command-line-editor([model]='profile.options')
|
||||||
|
|
||||||
.form-line(*ngIf='uac.isAvailable')
|
.form-line(*ngIf='uac?.isAvailable')
|
||||||
.header
|
.header
|
||||||
.title(translate) Run as administrator
|
.title(translate) Run as administrator
|
||||||
toggle(
|
toggle(
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||||
import { Component } from '@angular/core'
|
import { Component, Inject, Optional } from '@angular/core'
|
||||||
import { UACService } from '../services/uac.service'
|
import { LocalProfile, UACService } from '../api'
|
||||||
import { LocalProfile } from '../api'
|
import { PlatformService, ProfileSettingsComponent } from 'tabby-core'
|
||||||
import { ElectronHostWindow, ElectronService } from 'tabby-electron'
|
|
||||||
import { ProfileSettingsComponent } from 'tabby-core'
|
|
||||||
|
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@ -14,9 +12,8 @@ export class LocalProfileSettingsComponent implements ProfileSettingsComponent<L
|
|||||||
profile: LocalProfile
|
profile: LocalProfile
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
public uac: UACService,
|
@Optional() @Inject(UACService) public uac: UACService|undefined,
|
||||||
private hostWindow: ElectronHostWindow,
|
private platform: PlatformService,
|
||||||
private electron: ElectronService,
|
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
@ -30,14 +27,7 @@ export class LocalProfileSettingsComponent implements ProfileSettingsComponent<L
|
|||||||
// if (!shell) {
|
// if (!shell) {
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
const paths = (await this.electron.dialog.showOpenDialog(
|
|
||||||
this.hostWindow.getWindow(),
|
this.profile.options.cwd = await this.platform.pickDirectory()
|
||||||
{
|
|
||||||
// TODO
|
|
||||||
// defaultPath: shell.fsBase,
|
|
||||||
properties: ['openDirectory', 'showHiddenFiles'],
|
|
||||||
},
|
|
||||||
)).filePaths
|
|
||||||
this.profile.options.cwd = paths[0]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'
|
||||||
import { Component, Input, Injector } from '@angular/core'
|
import { Component, Input, Injector, Inject, Optional } from '@angular/core'
|
||||||
import { BaseTabProcess, WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild, GetRecoveryTokenOptions } from 'tabby-core'
|
import { BaseTabProcess, WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild, GetRecoveryTokenOptions } from 'tabby-core'
|
||||||
import { BaseTerminalTabComponent } from 'tabby-terminal'
|
import { BaseTerminalTabComponent } from 'tabby-terminal'
|
||||||
import { LocalProfile, SessionOptions } from '../api'
|
import { LocalProfile, SessionOptions, UACService } from '../api'
|
||||||
import { Session } from '../session'
|
import { Session } from '../session'
|
||||||
import { UACService } from '../services/uac.service'
|
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Component({
|
@Component({
|
||||||
@ -20,7 +19,7 @@ export class TerminalTabComponent extends BaseTerminalTabComponent<LocalProfile>
|
|||||||
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
||||||
constructor (
|
constructor (
|
||||||
injector: Injector,
|
injector: Injector,
|
||||||
private uac: UACService,
|
@Optional() @Inject(UACService) private uac: UACService|undefined,
|
||||||
) {
|
) {
|
||||||
super(injector)
|
super(injector)
|
||||||
}
|
}
|
||||||
@ -57,7 +56,7 @@ export class TerminalTabComponent extends BaseTerminalTabComponent<LocalProfile>
|
|||||||
}
|
}
|
||||||
|
|
||||||
initializeSession (columns: number, rows: number): void {
|
initializeSession (columns: number, rows: number): void {
|
||||||
if (this.profile.options.runAsAdministrator && this.uac.isAvailable) {
|
if (this.profile.options.runAsAdministrator && this.uac?.isAvailable) {
|
||||||
this.profile = {
|
this.profile = {
|
||||||
...this.profile,
|
...this.profile,
|
||||||
options: this.uac.patchSessionOptionsForUAC(this.profile.options),
|
options: this.uac.patchSessionOptionsForUAC(this.profile.options),
|
||||||
|
@ -6,7 +6,6 @@ import { ToastrModule } from 'ngx-toastr'
|
|||||||
|
|
||||||
import TabbyCorePlugin, { HostAppService, ToolbarButtonProvider, TabRecoveryProvider, ConfigProvider, HotkeysService, HotkeyProvider, TabContextMenuItemProvider, CLIHandler, ConfigService, ProfileProvider } from 'tabby-core'
|
import TabbyCorePlugin, { HostAppService, ToolbarButtonProvider, TabRecoveryProvider, ConfigProvider, HotkeysService, HotkeyProvider, TabContextMenuItemProvider, CLIHandler, ConfigService, ProfileProvider } from 'tabby-core'
|
||||||
import TabbyTerminalModule from 'tabby-terminal'
|
import TabbyTerminalModule from 'tabby-terminal'
|
||||||
import TabbyElectronPlugin from 'tabby-electron'
|
|
||||||
import { SettingsTabProvider } from 'tabby-settings'
|
import { SettingsTabProvider } from 'tabby-settings'
|
||||||
|
|
||||||
import { TerminalTabComponent } from './components/terminalTab.component'
|
import { TerminalTabComponent } from './components/terminalTab.component'
|
||||||
@ -16,30 +15,14 @@ import { LocalProfileSettingsComponent } from './components/localProfileSettings
|
|||||||
import { CommandLineEditorComponent } from './components/commandLineEditor.component'
|
import { CommandLineEditorComponent } from './components/commandLineEditor.component'
|
||||||
|
|
||||||
import { TerminalService } from './services/terminal.service'
|
import { TerminalService } from './services/terminal.service'
|
||||||
import { DockMenuService } from './services/dockMenu.service'
|
|
||||||
|
|
||||||
import { ButtonProvider } from './buttonProvider'
|
import { ButtonProvider } from './buttonProvider'
|
||||||
import { RecoveryProvider } from './recoveryProvider'
|
import { RecoveryProvider } from './recoveryProvider'
|
||||||
import { ShellProvider } from './api'
|
|
||||||
import { ShellSettingsTabProvider } from './settings'
|
import { ShellSettingsTabProvider } from './settings'
|
||||||
import { TerminalConfigProvider } from './config'
|
import { TerminalConfigProvider } from './config'
|
||||||
import { LocalTerminalHotkeyProvider } from './hotkeys'
|
import { LocalTerminalHotkeyProvider } from './hotkeys'
|
||||||
import { NewTabContextMenu, SaveAsProfileContextMenu } from './tabContextMenu'
|
import { NewTabContextMenu, SaveAsProfileContextMenu } from './tabContextMenu'
|
||||||
|
|
||||||
import { CmderShellProvider } from './shells/cmder'
|
|
||||||
import { Cygwin32ShellProvider } from './shells/cygwin32'
|
|
||||||
import { Cygwin64ShellProvider } from './shells/cygwin64'
|
|
||||||
import { GitBashShellProvider } from './shells/gitBash'
|
|
||||||
import { LinuxDefaultShellProvider } from './shells/linuxDefault'
|
|
||||||
import { MacOSDefaultShellProvider } from './shells/macDefault'
|
|
||||||
import { MSYS2ShellProvider } from './shells/msys2'
|
|
||||||
import { POSIXShellsProvider } from './shells/posix'
|
|
||||||
import { PowerShellCoreShellProvider } from './shells/powershellCore'
|
|
||||||
import { WindowsDefaultShellProvider } from './shells/winDefault'
|
|
||||||
import { WindowsStockShellsProvider } from './shells/windowsStock'
|
|
||||||
import { WSLShellProvider } from './shells/wsl'
|
|
||||||
import { VSDevToolsProvider } from './shells/vs'
|
|
||||||
|
|
||||||
import { AutoOpenTabCLIHandler, OpenPathCLIHandler, TerminalCLIHandler } from './cli'
|
import { AutoOpenTabCLIHandler, OpenPathCLIHandler, TerminalCLIHandler } from './cli'
|
||||||
import { LocalProfilesService } from './profiles'
|
import { LocalProfilesService } from './profiles'
|
||||||
|
|
||||||
@ -51,7 +34,6 @@ import { LocalProfilesService } from './profiles'
|
|||||||
NgbModule,
|
NgbModule,
|
||||||
ToastrModule,
|
ToastrModule,
|
||||||
TabbyCorePlugin,
|
TabbyCorePlugin,
|
||||||
TabbyElectronPlugin,
|
|
||||||
TabbyTerminalModule,
|
TabbyTerminalModule,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
@ -62,20 +44,6 @@ import { LocalProfilesService } from './profiles'
|
|||||||
{ provide: ConfigProvider, useClass: TerminalConfigProvider, multi: true },
|
{ provide: ConfigProvider, useClass: TerminalConfigProvider, multi: true },
|
||||||
{ provide: HotkeyProvider, useClass: LocalTerminalHotkeyProvider, multi: true },
|
{ provide: HotkeyProvider, useClass: LocalTerminalHotkeyProvider, multi: true },
|
||||||
|
|
||||||
{ provide: ShellProvider, useClass: WindowsDefaultShellProvider, multi: true },
|
|
||||||
{ provide: ShellProvider, useClass: MacOSDefaultShellProvider, multi: true },
|
|
||||||
{ provide: ShellProvider, useClass: LinuxDefaultShellProvider, multi: true },
|
|
||||||
{ provide: ShellProvider, useClass: WindowsStockShellsProvider, multi: true },
|
|
||||||
{ provide: ShellProvider, useClass: PowerShellCoreShellProvider, multi: true },
|
|
||||||
{ provide: ShellProvider, useClass: CmderShellProvider, multi: true },
|
|
||||||
{ provide: ShellProvider, useClass: Cygwin32ShellProvider, multi: true },
|
|
||||||
{ provide: ShellProvider, useClass: Cygwin64ShellProvider, multi: true },
|
|
||||||
{ provide: ShellProvider, useClass: GitBashShellProvider, multi: true },
|
|
||||||
{ provide: ShellProvider, useClass: POSIXShellsProvider, multi: true },
|
|
||||||
{ provide: ShellProvider, useClass: MSYS2ShellProvider, multi: true },
|
|
||||||
{ provide: ShellProvider, useClass: WSLShellProvider, multi: true },
|
|
||||||
{ provide: ShellProvider, useClass: VSDevToolsProvider, multi: true },
|
|
||||||
|
|
||||||
{ provide: ProfileProvider, useClass: LocalProfilesService, multi: true },
|
{ provide: ProfileProvider, useClass: LocalProfilesService, multi: true },
|
||||||
|
|
||||||
{ provide: TabContextMenuItemProvider, useClass: NewTabContextMenu, multi: true },
|
{ provide: TabContextMenuItemProvider, useClass: NewTabContextMenu, multi: true },
|
||||||
@ -84,11 +52,6 @@ import { LocalProfilesService } from './profiles'
|
|||||||
{ provide: CLIHandler, useClass: TerminalCLIHandler, multi: true },
|
{ provide: CLIHandler, useClass: TerminalCLIHandler, multi: true },
|
||||||
{ provide: CLIHandler, useClass: OpenPathCLIHandler, multi: true },
|
{ provide: CLIHandler, useClass: OpenPathCLIHandler, multi: true },
|
||||||
{ provide: CLIHandler, useClass: AutoOpenTabCLIHandler, multi: true },
|
{ provide: CLIHandler, useClass: AutoOpenTabCLIHandler, multi: true },
|
||||||
|
|
||||||
// For WindowsDefaultShellProvider
|
|
||||||
PowerShellCoreShellProvider,
|
|
||||||
WSLShellProvider,
|
|
||||||
WindowsStockShellsProvider,
|
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
TerminalTabComponent,
|
TerminalTabComponent,
|
||||||
@ -108,7 +71,6 @@ export default class LocalTerminalModule { // eslint-disable-line @typescript-es
|
|||||||
hotkeys: HotkeysService,
|
hotkeys: HotkeysService,
|
||||||
terminal: TerminalService,
|
terminal: TerminalService,
|
||||||
hostApp: HostAppService,
|
hostApp: HostAppService,
|
||||||
dockMenu: DockMenuService,
|
|
||||||
config: ConfigService,
|
config: ConfigService,
|
||||||
) {
|
) {
|
||||||
hotkeys.hotkey$.subscribe(async (hotkey) => {
|
hotkeys.hotkey$.subscribe(async (hotkey) => {
|
||||||
@ -119,10 +81,6 @@ export default class LocalTerminalModule { // eslint-disable-line @typescript-es
|
|||||||
hostApp.newWindow()
|
hostApp.newWindow()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
config.ready$.toPromise().then(() => {
|
|
||||||
dockMenu.update()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Inject, Injectable, Optional } from '@angular/core'
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
||||||
import { ConfigService, BaseTabComponent, TabContextMenuItemProvider, NotificationsService, MenuItemOptions, ProfilesService, PromptModalComponent, TranslateService } from 'tabby-core'
|
import { ConfigService, BaseTabComponent, TabContextMenuItemProvider, NotificationsService, MenuItemOptions, ProfilesService, PromptModalComponent, TranslateService } from 'tabby-core'
|
||||||
import { TerminalTabComponent } from './components/terminalTab.component'
|
import { TerminalTabComponent } from './components/terminalTab.component'
|
||||||
import { UACService } from './services/uac.service'
|
|
||||||
import { TerminalService } from './services/terminal.service'
|
import { TerminalService } from './services/terminal.service'
|
||||||
import { LocalProfile } from './api'
|
import { LocalProfile, UACService } from './api'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@ -64,7 +63,7 @@ export class NewTabContextMenu extends TabContextMenuItemProvider {
|
|||||||
public config: ConfigService,
|
public config: ConfigService,
|
||||||
private profilesService: ProfilesService,
|
private profilesService: ProfilesService,
|
||||||
private terminalService: TerminalService,
|
private terminalService: TerminalService,
|
||||||
private uac: UACService,
|
@Optional() @Inject(UACService) private uac: UACService|undefined,
|
||||||
private translate: TranslateService,
|
private translate: TranslateService,
|
||||||
) {
|
) {
|
||||||
super()
|
super()
|
||||||
@ -99,7 +98,7 @@ export class NewTabContextMenu extends TabContextMenuItemProvider {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
if (this.uac.isAvailable) {
|
if (this.uac?.isAvailable) {
|
||||||
items.push({
|
items.push({
|
||||||
label: this.translate.instant('New admin tab'),
|
label: this.translate.instant('New admin tab'),
|
||||||
submenu: profiles.map(profile => ({
|
submenu: profiles.map(profile => ({
|
||||||
@ -117,7 +116,7 @@ export class NewTabContextMenu extends TabContextMenuItemProvider {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tab instanceof TerminalTabComponent && tabHeader && this.uac.isAvailable) {
|
if (tab instanceof TerminalTabComponent && tabHeader && this.uac?.isAvailable) {
|
||||||
const terminalTab = tab
|
const terminalTab = tab
|
||||||
items.push({
|
items.push({
|
||||||
label: this.translate.instant('Duplicate as administrator'),
|
label: this.translate.instant('Duplicate as administrator'),
|
||||||
|
@ -7,11 +7,6 @@ ansi-colors@^4.1.1:
|
|||||||
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348"
|
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348"
|
||||||
integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==
|
integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==
|
||||||
|
|
||||||
async@~1.5:
|
|
||||||
version "1.5.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
|
|
||||||
integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=
|
|
||||||
|
|
||||||
connected-domain@^1.0.0:
|
connected-domain@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/connected-domain/-/connected-domain-1.0.0.tgz#bfe77238c74be453a79f0cb6058deeb4f2358e93"
|
resolved "https://registry.yarnpkg.com/connected-domain/-/connected-domain-1.0.0.tgz#bfe77238c74be453a79f0cb6058deeb4f2358e93"
|
||||||
@ -22,13 +17,6 @@ dataurl@0.1.0:
|
|||||||
resolved "https://registry.yarnpkg.com/dataurl/-/dataurl-0.1.0.tgz#1f4734feddec05ffe445747978d86759c4b33199"
|
resolved "https://registry.yarnpkg.com/dataurl/-/dataurl-0.1.0.tgz#1f4734feddec05ffe445747978d86759c4b33199"
|
||||||
integrity sha1-H0c0/t3sBf/kRXR5eNhnWcSzMZk=
|
integrity sha1-H0c0/t3sBf/kRXR5eNhnWcSzMZk=
|
||||||
|
|
||||||
hasbin@^1.2.3:
|
|
||||||
version "1.2.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/hasbin/-/hasbin-1.2.3.tgz#78c5926893c80215c2b568ae1fd3fcab7a2696b0"
|
|
||||||
integrity sha1-eMWSaJPIAhXCtWiuH9P8q3omlrA=
|
|
||||||
dependencies:
|
|
||||||
async "~1.5"
|
|
||||||
|
|
||||||
ps-node@^0.1.6:
|
ps-node@^0.1.6:
|
||||||
version "0.1.6"
|
version "0.1.6"
|
||||||
resolved "https://registry.yarnpkg.com/ps-node/-/ps-node-0.1.6.tgz#9af67a99d7b1d0132e51a503099d38a8d2ace2c3"
|
resolved "https://registry.yarnpkg.com/ps-node/-/ps-node-0.1.6.tgz#9af67a99d7b1d0132e51a503099d38a8d2ace2c3"
|
||||||
|
@ -138,6 +138,10 @@ export class WebPlatformService extends PlatformService {
|
|||||||
setErrorHandler (handler: (_: any) => void): void {
|
setErrorHandler (handler: (_: any) => void): void {
|
||||||
window.addEventListener('error', handler)
|
window.addEventListener('error', handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async pickDirectory (): Promise<string> {
|
||||||
|
throw new Error('Unsupported')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class HTMLFileDownload extends FileDownload {
|
class HTMLFileDownload extends FileDownload {
|
||||||
|