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 popupContextMenu (menu: MenuItemOptions[], event?: MouseEvent): void
|
||||
abstract showMessageBox (options: MessageBoxOptions): Promise<MessageBoxResult>
|
||||
abstract pickDirectory (): Promise<string>
|
||||
abstract quit (): void
|
||||
}
|
||||
|
||||
|
@ -16,8 +16,12 @@
|
||||
],
|
||||
"author": "Eugene Pankov",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"hasbin": "^1.2.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/core": "^9.1.9"
|
||||
"@angular/core": "^9.1.9",
|
||||
"tabby-local": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"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 { TerminalColorSchemeProvider } from 'tabby-terminal'
|
||||
import { SFTPContextMenuItemProvider, SSHProfileImporter, AutoPrivateKeyLocator } from 'tabby-ssh'
|
||||
import { ShellProvider, UACService } from 'tabby-local'
|
||||
import { auditTime } from 'rxjs'
|
||||
|
||||
import { HyperColorSchemes } from './colorSchemes'
|
||||
@ -14,10 +15,26 @@ import { ElectronHostWindow } from './services/hostWindow.service'
|
||||
import { ElectronFileProvider } from './services/fileProvider.service'
|
||||
import { ElectronHostAppService } from './services/hostApp.service'
|
||||
import { ElectronService } from './services/electron.service'
|
||||
import { DockMenuService } from './services/dockMenu.service'
|
||||
import { ElectronHotkeyProvider } from './hotkeys'
|
||||
import { ElectronConfigProvider } from './config'
|
||||
import { EditSFTPContextMenu } from './sftpContextMenu'
|
||||
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({
|
||||
providers: [
|
||||
@ -35,6 +52,27 @@ import { OpenSSHImporter, PrivateKeyLocator, StaticFileImporter } from './sshImp
|
||||
{ provide: SSHProfileImporter, useExisting: OpenSSHImporter, multi: true },
|
||||
{ provide: SSHProfileImporter, useExisting: StaticFileImporter, 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 {
|
||||
@ -47,6 +85,7 @@ export default class ElectronModule {
|
||||
docking: DockingService,
|
||||
themeService: ThemesService,
|
||||
app: AppService,
|
||||
dockMenu: DockMenuService,
|
||||
) {
|
||||
config.ready$.toPromise().then(() => {
|
||||
touchbar.update()
|
||||
@ -87,6 +126,10 @@ export default class ElectronModule {
|
||||
})
|
||||
|
||||
config.changed$.subscribe(() => this.updateVibrancy())
|
||||
|
||||
config.ready$.toPromise().then(() => {
|
||||
dockMenu.update()
|
||||
})
|
||||
}
|
||||
|
||||
private registerGlobalHotkey () {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { NgZone, Injectable } from '@angular/core'
|
||||
import { ConfigService, HostAppService, Platform, ProfilesService, TranslateService } from 'tabby-core'
|
||||
import { ElectronService } from 'tabby-electron'
|
||||
import { ElectronService } from './electron.service'
|
||||
|
||||
/** @hidden */
|
||||
@Injectable({ providedIn: 'root' })
|
@ -234,6 +234,15 @@ export class ElectronPlatformService extends PlatformService {
|
||||
handler(err)
|
||||
})
|
||||
}
|
||||
|
||||
async pickDirectory (): Promise<string> {
|
||||
return (await this.electron.dialog.showOpenDialog(
|
||||
this.hostWindow.getWindow(),
|
||||
{
|
||||
properties: ['openDirectory', 'showHiddenFiles'],
|
||||
},
|
||||
)).filePaths[0]
|
||||
}
|
||||
}
|
||||
|
||||
class ElectronFileUpload extends FileUpload {
|
||||
|
@ -1,17 +1,16 @@
|
||||
import * as path from 'path'
|
||||
import { Injectable } from '@angular/core'
|
||||
import * as path from 'path'
|
||||
import { WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild } from 'tabby-core'
|
||||
import { ElectronService } from 'tabby-electron'
|
||||
import { SessionOptions } from '../api'
|
||||
import { SessionOptions, UACService } from 'tabby-local'
|
||||
import { ElectronService } from './electron.service'
|
||||
|
||||
/** @hidden */
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class UACService {
|
||||
isAvailable = false
|
||||
|
||||
private constructor (
|
||||
@Injectable()
|
||||
export class ElectronUACService extends UACService {
|
||||
constructor (
|
||||
private electron: ElectronService,
|
||||
) {
|
||||
super()
|
||||
this.isAvailable = isWindowsBuild(WIN_BUILD_CONPTY_SUPPORTED)
|
||||
}
|
||||
|
||||
@ -37,5 +36,4 @@ export class UACService {
|
||||
options.command = helperPath
|
||||
return options
|
||||
}
|
||||
|
||||
}
|
@ -2,7 +2,7 @@ import * as path from 'path'
|
||||
import { Injectable } from '@angular/core'
|
||||
import { HostAppService, Platform } from 'tabby-core'
|
||||
|
||||
import { ShellProvider, Shell } from '../api'
|
||||
import { ShellProvider, Shell } from 'tabby-local'
|
||||
|
||||
/** @hidden */
|
||||
@Injectable()
|
@ -2,7 +2,7 @@ import * as path from 'path'
|
||||
import { Injectable } from '@angular/core'
|
||||
import { HostAppService, Platform } from 'tabby-core'
|
||||
|
||||
import { ShellProvider, Shell } from '../api'
|
||||
import { ShellProvider, Shell } from 'tabby-local'
|
||||
|
||||
/* eslint-disable block-scoped-var */
|
||||
|
@ -2,7 +2,7 @@ import * as path from 'path'
|
||||
import { Injectable } from '@angular/core'
|
||||
import { HostAppService, Platform } from 'tabby-core'
|
||||
|
||||
import { ShellProvider, Shell } from '../api'
|
||||
import { ShellProvider, Shell } from 'tabby-local'
|
||||
|
||||
/* eslint-disable block-scoped-var */
|
||||
|
@ -2,7 +2,7 @@ import * as path from 'path'
|
||||
import { Injectable } from '@angular/core'
|
||||
import { Platform, ConfigService, HostAppService } from 'tabby-core'
|
||||
|
||||
import { Shell } from '../api'
|
||||
import { Shell } from 'tabby-local'
|
||||
import { WindowsBaseShellProvider } from './windowsBase'
|
||||
|
||||
/* eslint-disable block-scoped-var */
|
@ -2,7 +2,7 @@ import * as fs from 'mz/fs'
|
||||
import { Injectable } from '@angular/core'
|
||||
import { HostAppService, Platform, LogService, Logger, TranslateService } from 'tabby-core'
|
||||
|
||||
import { ShellProvider, Shell } from '../api'
|
||||
import { ShellProvider, Shell } from 'tabby-local'
|
||||
|
||||
/** @hidden */
|
||||
@Injectable()
|
@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'
|
||||
import promiseIpc, { RendererProcessType } from 'electron-promise-ipc'
|
||||
import { HostAppService, Platform, TranslateService } from 'tabby-core'
|
||||
|
||||
import { ShellProvider, Shell } from '../api'
|
||||
import { ShellProvider, Shell } from 'tabby-local'
|
||||
|
||||
/** @hidden */
|
||||
@Injectable()
|
@ -3,7 +3,7 @@ import * as path from 'path'
|
||||
import { Injectable } from '@angular/core'
|
||||
import { HostAppService, Platform } from 'tabby-core'
|
||||
|
||||
import { ShellProvider, Shell } from '../api'
|
||||
import { ShellProvider, Shell } from 'tabby-local'
|
||||
|
||||
/** @hidden */
|
||||
@Injectable()
|
@ -3,7 +3,7 @@ import slugify from 'slugify'
|
||||
import { Injectable } from '@angular/core'
|
||||
import { HostAppService, Platform } from 'tabby-core'
|
||||
|
||||
import { ShellProvider, Shell } from '../api'
|
||||
import { ShellProvider, Shell } from 'tabby-local'
|
||||
|
||||
/** @hidden */
|
||||
@Injectable()
|
@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core'
|
||||
import { HostAppService, ConfigService, Platform } from 'tabby-core'
|
||||
|
||||
import { Shell } from '../api'
|
||||
import { Shell } from 'tabby-local'
|
||||
import { WindowsBaseShellProvider } from './windowsBase'
|
||||
|
||||
/* eslint-disable block-scoped-var */
|
@ -3,7 +3,7 @@ import * as fs from 'fs/promises'
|
||||
import { Injectable } from '@angular/core'
|
||||
import { HostAppService, Platform } from 'tabby-core'
|
||||
|
||||
import { ShellProvider, Shell } from '../api'
|
||||
import { ShellProvider, Shell } from 'tabby-local'
|
||||
|
||||
/* eslint-disable quote-props */
|
||||
const vsIconMap: Record<string, string> = {
|
@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core'
|
||||
import { HostAppService, Platform, TranslateService } from 'tabby-core'
|
||||
|
||||
import { ShellProvider, Shell } from '../api'
|
||||
import { ShellProvider, Shell } from 'tabby-local'
|
||||
|
||||
import { WSLShellProvider } from './wsl'
|
||||
import { PowerShellCoreShellProvider } from './powershellCore'
|
@ -1,6 +1,6 @@
|
||||
import { ConfigService, HostAppService } from 'tabby-core'
|
||||
|
||||
import { ShellProvider } from '../api'
|
||||
import { ShellProvider } from 'tabby-local'
|
||||
|
||||
export abstract class WindowsBaseShellProvider extends ShellProvider {
|
||||
constructor (
|
@ -3,9 +3,9 @@ import * as fs from 'fs/promises'
|
||||
import hasbin from 'hasbin'
|
||||
import { Injectable } from '@angular/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'
|
||||
|
||||
/** @hidden */
|
@ -4,7 +4,7 @@ import slugify from 'slugify'
|
||||
import { Injectable } from '@angular/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 */
|
||||
|
@ -21,6 +21,11 @@ async@^3.2.3:
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-3.2.3.tgz#ac53dafd3f4720ee9e8a160628f18ea91df196c9"
|
||||
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:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
||||
@ -199,6 +204,13 @@ has@^1.0.3:
|
||||
dependencies:
|
||||
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:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
|
@ -19,7 +19,6 @@
|
||||
"devDependencies": {
|
||||
"ansi-colors": "^4.1.1",
|
||||
"dataurl": "0.1.0",
|
||||
"hasbin": "^1.2.3",
|
||||
"ps-node": "^0.1.6",
|
||||
"runes": "^0.4.2"
|
||||
},
|
||||
|
@ -53,3 +53,9 @@ export interface ChildProcess {
|
||||
ppid: number
|
||||
command: string
|
||||
}
|
||||
|
||||
export abstract class UACService {
|
||||
isAvailable = false
|
||||
|
||||
abstract patchSessionOptionsForUAC (sessionOptions: SessionOptions): SessionOptions
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
command-line-editor([model]='profile.options')
|
||||
|
||||
.form-line(*ngIf='uac.isAvailable')
|
||||
.form-line(*ngIf='uac?.isAvailable')
|
||||
.header
|
||||
.title(translate) Run as administrator
|
||||
toggle(
|
||||
|
@ -1,9 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
import { Component } from '@angular/core'
|
||||
import { UACService } from '../services/uac.service'
|
||||
import { LocalProfile } from '../api'
|
||||
import { ElectronHostWindow, ElectronService } from 'tabby-electron'
|
||||
import { ProfileSettingsComponent } from 'tabby-core'
|
||||
import { Component, Inject, Optional } from '@angular/core'
|
||||
import { LocalProfile, UACService } from '../api'
|
||||
import { PlatformService, ProfileSettingsComponent } from 'tabby-core'
|
||||
|
||||
|
||||
/** @hidden */
|
||||
@ -14,9 +12,8 @@ export class LocalProfileSettingsComponent implements ProfileSettingsComponent<L
|
||||
profile: LocalProfile
|
||||
|
||||
constructor (
|
||||
public uac: UACService,
|
||||
private hostWindow: ElectronHostWindow,
|
||||
private electron: ElectronService,
|
||||
@Optional() @Inject(UACService) public uac: UACService|undefined,
|
||||
private platform: PlatformService,
|
||||
) { }
|
||||
|
||||
ngOnInit () {
|
||||
@ -30,14 +27,7 @@ export class LocalProfileSettingsComponent implements ProfileSettingsComponent<L
|
||||
// if (!shell) {
|
||||
// return
|
||||
// }
|
||||
const paths = (await this.electron.dialog.showOpenDialog(
|
||||
this.hostWindow.getWindow(),
|
||||
{
|
||||
// TODO
|
||||
// defaultPath: shell.fsBase,
|
||||
properties: ['openDirectory', 'showHiddenFiles'],
|
||||
},
|
||||
)).filePaths
|
||||
this.profile.options.cwd = paths[0]
|
||||
|
||||
this.profile.options.cwd = await this.platform.pickDirectory()
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,9 @@
|
||||
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 { BaseTerminalTabComponent } from 'tabby-terminal'
|
||||
import { LocalProfile, SessionOptions } from '../api'
|
||||
import { LocalProfile, SessionOptions, UACService } from '../api'
|
||||
import { Session } from '../session'
|
||||
import { UACService } from '../services/uac.service'
|
||||
|
||||
/** @hidden */
|
||||
@Component({
|
||||
@ -20,7 +19,7 @@ export class TerminalTabComponent extends BaseTerminalTabComponent<LocalProfile>
|
||||
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
||||
constructor (
|
||||
injector: Injector,
|
||||
private uac: UACService,
|
||||
@Optional() @Inject(UACService) private uac: UACService|undefined,
|
||||
) {
|
||||
super(injector)
|
||||
}
|
||||
@ -57,7 +56,7 @@ export class TerminalTabComponent extends BaseTerminalTabComponent<LocalProfile>
|
||||
}
|
||||
|
||||
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,
|
||||
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 TabbyTerminalModule from 'tabby-terminal'
|
||||
import TabbyElectronPlugin from 'tabby-electron'
|
||||
import { SettingsTabProvider } from 'tabby-settings'
|
||||
|
||||
import { TerminalTabComponent } from './components/terminalTab.component'
|
||||
@ -16,30 +15,14 @@ import { LocalProfileSettingsComponent } from './components/localProfileSettings
|
||||
import { CommandLineEditorComponent } from './components/commandLineEditor.component'
|
||||
|
||||
import { TerminalService } from './services/terminal.service'
|
||||
import { DockMenuService } from './services/dockMenu.service'
|
||||
|
||||
import { ButtonProvider } from './buttonProvider'
|
||||
import { RecoveryProvider } from './recoveryProvider'
|
||||
import { ShellProvider } from './api'
|
||||
import { ShellSettingsTabProvider } from './settings'
|
||||
import { TerminalConfigProvider } from './config'
|
||||
import { LocalTerminalHotkeyProvider } from './hotkeys'
|
||||
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 { LocalProfilesService } from './profiles'
|
||||
|
||||
@ -51,7 +34,6 @@ import { LocalProfilesService } from './profiles'
|
||||
NgbModule,
|
||||
ToastrModule,
|
||||
TabbyCorePlugin,
|
||||
TabbyElectronPlugin,
|
||||
TabbyTerminalModule,
|
||||
],
|
||||
providers: [
|
||||
@ -62,20 +44,6 @@ import { LocalProfilesService } from './profiles'
|
||||
{ provide: ConfigProvider, useClass: TerminalConfigProvider, 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: TabContextMenuItemProvider, useClass: NewTabContextMenu, multi: true },
|
||||
@ -84,11 +52,6 @@ import { LocalProfilesService } from './profiles'
|
||||
{ provide: CLIHandler, useClass: TerminalCLIHandler, multi: true },
|
||||
{ provide: CLIHandler, useClass: OpenPathCLIHandler, multi: true },
|
||||
{ provide: CLIHandler, useClass: AutoOpenTabCLIHandler, multi: true },
|
||||
|
||||
// For WindowsDefaultShellProvider
|
||||
PowerShellCoreShellProvider,
|
||||
WSLShellProvider,
|
||||
WindowsStockShellsProvider,
|
||||
],
|
||||
declarations: [
|
||||
TerminalTabComponent,
|
||||
@ -108,7 +71,6 @@ export default class LocalTerminalModule { // eslint-disable-line @typescript-es
|
||||
hotkeys: HotkeysService,
|
||||
terminal: TerminalService,
|
||||
hostApp: HostAppService,
|
||||
dockMenu: DockMenuService,
|
||||
config: ConfigService,
|
||||
) {
|
||||
hotkeys.hotkey$.subscribe(async (hotkey) => {
|
||||
@ -119,10 +81,6 @@ export default class LocalTerminalModule { // eslint-disable-line @typescript-es
|
||||
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 { ConfigService, BaseTabComponent, TabContextMenuItemProvider, NotificationsService, MenuItemOptions, ProfilesService, PromptModalComponent, TranslateService } from 'tabby-core'
|
||||
import { TerminalTabComponent } from './components/terminalTab.component'
|
||||
import { UACService } from './services/uac.service'
|
||||
import { TerminalService } from './services/terminal.service'
|
||||
import { LocalProfile } from './api'
|
||||
import { LocalProfile, UACService } from './api'
|
||||
|
||||
/** @hidden */
|
||||
@Injectable()
|
||||
@ -64,7 +63,7 @@ export class NewTabContextMenu extends TabContextMenuItemProvider {
|
||||
public config: ConfigService,
|
||||
private profilesService: ProfilesService,
|
||||
private terminalService: TerminalService,
|
||||
private uac: UACService,
|
||||
@Optional() @Inject(UACService) private uac: UACService|undefined,
|
||||
private translate: TranslateService,
|
||||
) {
|
||||
super()
|
||||
@ -99,7 +98,7 @@ export class NewTabContextMenu extends TabContextMenuItemProvider {
|
||||
},
|
||||
]
|
||||
|
||||
if (this.uac.isAvailable) {
|
||||
if (this.uac?.isAvailable) {
|
||||
items.push({
|
||||
label: this.translate.instant('New admin tab'),
|
||||
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
|
||||
items.push({
|
||||
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"
|
||||
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:
|
||||
version "1.0.0"
|
||||
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"
|
||||
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:
|
||||
version "0.1.6"
|
||||
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 {
|
||||
window.addEventListener('error', handler)
|
||||
}
|
||||
|
||||
async pickDirectory (): Promise<string> {
|
||||
throw new Error('Unsupported')
|
||||
}
|
||||
}
|
||||
|
||||
class HTMLFileDownload extends FileDownload {
|
||||
|