mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-19 18:07:58 +00:00
refactoring, build fix
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,6 +6,8 @@ node_modules
|
|||||||
build/files.wxs
|
build/files.wxs
|
||||||
dist
|
dist
|
||||||
*/dist
|
*/dist
|
||||||
|
*/typings
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
*.xcworkspacedata
|
*.xcworkspacedata
|
||||||
*.xcuserstate
|
*.xcuserstate
|
||||||
|
@@ -16,6 +16,7 @@ jobs:
|
|||||||
- scripts/install-deps.js
|
- scripts/install-deps.js
|
||||||
script:
|
script:
|
||||||
- scripts/build-native.js
|
- scripts/build-native.js
|
||||||
|
- yarn run build:typings
|
||||||
- yarn run build
|
- yarn run build
|
||||||
- scripts/prepackage-plugins.js
|
- scripts/prepackage-plugins.js
|
||||||
- scripts/build-linux.js
|
- scripts/build-linux.js
|
||||||
|
@@ -18,6 +18,7 @@ install:
|
|||||||
- node scripts/build-native.js
|
- node scripts/build-native.js
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
|
- yarn run build:typings
|
||||||
- yarn run build
|
- yarn run build
|
||||||
- node scripts/prepackage-plugins.js
|
- node scripts/prepackage-plugins.js
|
||||||
- node scripts/build-windows.js
|
- node scripts/build-windows.js
|
||||||
|
@@ -126,6 +126,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --color --config app/webpack.main.config.js && webpack --color --config app/webpack.config.js && webpack --color --config terminus-core/webpack.config.js && webpack --color --config terminus-settings/webpack.config.js && webpack --color --config terminus-terminal/webpack.config.js && webpack --color --config terminus-settings/webpack.config.js && webpack --color --config terminus-plugin-manager/webpack.config.js && webpack --color --config terminus-community-color-schemes/webpack.config.js && webpack --color --config terminus-ssh/webpack.config.js",
|
"build": "webpack --color --config app/webpack.main.config.js && webpack --color --config app/webpack.config.js && webpack --color --config terminus-core/webpack.config.js && webpack --color --config terminus-settings/webpack.config.js && webpack --color --config terminus-terminal/webpack.config.js && webpack --color --config terminus-settings/webpack.config.js && webpack --color --config terminus-plugin-manager/webpack.config.js && webpack --color --config terminus-community-color-schemes/webpack.config.js && webpack --color --config terminus-ssh/webpack.config.js",
|
||||||
|
"build:typings": "tsc --project terminus-core/tsconfig.typings.json && tsc --project terminus-settings/tsconfig.typings.json && tsc --project terminus-terminal/tsconfig.typings.json && tsc --project terminus-plugin-manager/tsconfig.typings.json && tsc --project terminus-ssh/tsconfig.typings.json",
|
||||||
"watch": "cross-env TERMINUS_DEV=1 webpack --progress --color --watch",
|
"watch": "cross-env TERMINUS_DEV=1 webpack --progress --color --watch",
|
||||||
"start": "cross-env TERMINUS_DEV=1 electron app --debug",
|
"start": "cross-env TERMINUS_DEV=1 electron app --debug",
|
||||||
"prod": "cross-env TERMINUS_DEV=1 electron app",
|
"prod": "cross-env TERMINUS_DEV=1 electron app",
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
"terminus-builtin-plugin"
|
"terminus-builtin-plugin"
|
||||||
],
|
],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "typings/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --progress --color",
|
"build": "webpack --progress --color",
|
||||||
"watch": "webpack --progress --color --watch"
|
"watch": "webpack --progress --color --watch"
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
"extends": "../tsconfig.json",
|
"extends": "../tsconfig.json",
|
||||||
"exclude": ["node_modules", "dist"],
|
"exclude": ["node_modules", "dist"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "src",
|
"baseUrl": "src"
|
||||||
"declarationDir": "dist"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
"terminus-builtin-plugin"
|
"terminus-builtin-plugin"
|
||||||
],
|
],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "typings/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --progress --color --display-modules",
|
"build": "webpack --progress --color --display-modules",
|
||||||
"watch": "webpack --progress --color --watch"
|
"watch": "webpack --progress --color --watch"
|
||||||
|
@@ -91,7 +91,7 @@ export abstract class BaseTabComponent {
|
|||||||
}
|
}
|
||||||
this.progressClearTimeout = setTimeout(() => {
|
this.progressClearTimeout = setTimeout(() => {
|
||||||
this.setProgress(null)
|
this.setProgress(null)
|
||||||
}, 5000)
|
}, 5000) as any
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@ class CompletionObserver {
|
|||||||
private interval: number
|
private interval: number
|
||||||
|
|
||||||
constructor (private tab: BaseTabComponent) {
|
constructor (private tab: BaseTabComponent) {
|
||||||
this.interval = setInterval(() => this.tick(), 1000)
|
this.interval = setInterval(() => this.tick(), 1000) as any
|
||||||
this.tab.destroyed$.pipe(takeUntil(this.destroyed$)).subscribe(() => this.stop())
|
this.tab.destroyed$.pipe(takeUntil(this.destroyed$)).subscribe(() => this.stop())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3,6 +3,5 @@
|
|||||||
"exclude": ["node_modules", "dist"],
|
"exclude": ["node_modules", "dist"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "src",
|
"baseUrl": "src",
|
||||||
"declarationDir": "dist"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
14
terminus-core/tsconfig.typings.json
Normal file
14
terminus-core/tsconfig.typings.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"exclude": ["node_modules", "dist", "typings"],
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": "src",
|
||||||
|
"emitDeclarationOnly": true,
|
||||||
|
"declaration": true,
|
||||||
|
"declarationDir": "./typings",
|
||||||
|
"paths": {
|
||||||
|
"terminus-*": ["../../terminus-*"],
|
||||||
|
"*": ["../../app/node_modules/*"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -6,7 +6,7 @@
|
|||||||
"terminus-builtin-plugin"
|
"terminus-builtin-plugin"
|
||||||
],
|
],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "typings/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --progress --color --display-modules",
|
"build": "webpack --progress --color --display-modules",
|
||||||
"watch": "webpack --progress --color --watch"
|
"watch": "webpack --progress --color --watch"
|
||||||
|
@@ -3,6 +3,5 @@
|
|||||||
"exclude": ["node_modules", "dist"],
|
"exclude": ["node_modules", "dist"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "src",
|
"baseUrl": "src",
|
||||||
"declarationDir": "dist"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
14
terminus-plugin-manager/tsconfig.typings.json
Normal file
14
terminus-plugin-manager/tsconfig.typings.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"exclude": ["node_modules", "dist", "typings"],
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": "src",
|
||||||
|
"emitDeclarationOnly": true,
|
||||||
|
"declaration": true,
|
||||||
|
"declarationDir": "./typings",
|
||||||
|
"paths": {
|
||||||
|
"terminus-*": ["../../terminus-*"],
|
||||||
|
"*": ["../../app/node_modules/*"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -6,7 +6,7 @@
|
|||||||
"terminus-builtin-plugin"
|
"terminus-builtin-plugin"
|
||||||
],
|
],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/src/index.d.ts",
|
"typings": "typings/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --progress --color --display-modules",
|
"build": "webpack --progress --color --display-modules",
|
||||||
"watch": "webpack --progress --color --watch"
|
"watch": "webpack --progress --color --watch"
|
||||||
|
@@ -3,6 +3,5 @@
|
|||||||
"exclude": ["node_modules", "dist"],
|
"exclude": ["node_modules", "dist"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "src",
|
"baseUrl": "src",
|
||||||
"declarationDir": "dist"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
14
terminus-settings/tsconfig.typings.json
Normal file
14
terminus-settings/tsconfig.typings.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"exclude": ["node_modules", "dist", "typings"],
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": "src",
|
||||||
|
"emitDeclarationOnly": true,
|
||||||
|
"declaration": true,
|
||||||
|
"declarationDir": "./typings",
|
||||||
|
"paths": {
|
||||||
|
"terminus-*": ["../../terminus-*"],
|
||||||
|
"*": ["../../app/node_modules/*"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -6,7 +6,7 @@
|
|||||||
"terminus-builtin-plugin"
|
"terminus-builtin-plugin"
|
||||||
],
|
],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "typings/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --progress --color",
|
"build": "webpack --progress --color",
|
||||||
"watch": "webpack --progress --color --watch"
|
"watch": "webpack --progress --color --watch"
|
||||||
|
@@ -12,7 +12,7 @@ import { SSHConnection, SSHSession } from '../api'
|
|||||||
class="content"
|
class="content"
|
||||||
></div>
|
></div>
|
||||||
`,
|
`,
|
||||||
styles: [require('./sshTab.component.scss')],
|
styles: [require('./sshTab.component.scss'), ...BaseTerminalTabComponent.styles],
|
||||||
animations: BaseTerminalTabComponent.animations,
|
animations: BaseTerminalTabComponent.animations,
|
||||||
})
|
})
|
||||||
export class SSHTabComponent extends BaseTerminalTabComponent {
|
export class SSHTabComponent extends BaseTerminalTabComponent {
|
||||||
|
@@ -1,12 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../tsconfig.json",
|
"extends": "../tsconfig.json",
|
||||||
"exclude": ["node_modules", "dist"],
|
"exclude": ["node_modules", "dist", "typings"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "src",
|
"baseUrl": "src"
|
||||||
"declarationDir": "dist",
|
|
||||||
"paths": {
|
|
||||||
"terminus-*": ["terminus-*"],
|
|
||||||
"*": ["app/node_modules/*"]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
15
terminus-ssh/tsconfig.typings.json
Normal file
15
terminus-ssh/tsconfig.typings.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"exclude": ["node_modules", "dist", "typings"],
|
||||||
|
"include": ["src"],
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": "src",
|
||||||
|
"emitDeclarationOnly": true,
|
||||||
|
"declaration": true,
|
||||||
|
"declarationDir": "./typings",
|
||||||
|
"paths": {
|
||||||
|
"terminus-*": ["../../terminus-*"],
|
||||||
|
"*": ["../../app/node_modules/*"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -6,7 +6,7 @@
|
|||||||
"terminus-builtin-plugin"
|
"terminus-builtin-plugin"
|
||||||
],
|
],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/src/index.d.ts",
|
"typings": "typings/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --progress --color --display-modules",
|
"build": "webpack --progress --color --display-modules",
|
||||||
"watch": "webpack --progress --color --watch"
|
"watch": "webpack --progress --color --watch"
|
||||||
|
@@ -1,93 +0,0 @@
|
|||||||
import { SafeHtml } from '@angular/platform-browser'
|
|
||||||
import { BaseTerminalTabComponent } from './components/baseTerminalTab.component'
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Extend to automatically run actions on new terminals
|
|
||||||
*/
|
|
||||||
export abstract class TerminalDecorator {
|
|
||||||
/**
|
|
||||||
* Called when a new terminal tab starts
|
|
||||||
*/
|
|
||||||
attach (terminal: BaseTerminalTabComponent): void { } // tslint:disable-line no-empty
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called before a terminal tab is destroyed
|
|
||||||
*/
|
|
||||||
detach (terminal: BaseTerminalTabComponent): void { } // tslint:disable-line no-empty
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ResizeEvent {
|
|
||||||
columns: number
|
|
||||||
rows: number
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SessionOptions {
|
|
||||||
name?: string
|
|
||||||
command: string
|
|
||||||
args: string[]
|
|
||||||
cwd?: string
|
|
||||||
env?: {[id: string]: string}
|
|
||||||
width?: number
|
|
||||||
height?: number
|
|
||||||
pauseAfterExit?: boolean
|
|
||||||
runAsAdministrator?: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Profile {
|
|
||||||
name: string,
|
|
||||||
sessionOptions: SessionOptions,
|
|
||||||
isBuiltin?: boolean
|
|
||||||
icon?: SafeHtml
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ITerminalColorScheme {
|
|
||||||
name: string
|
|
||||||
foreground: string
|
|
||||||
background: string
|
|
||||||
cursor: string
|
|
||||||
colors: string[]
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Extend to add more terminal color schemes
|
|
||||||
*/
|
|
||||||
export abstract class TerminalColorSchemeProvider {
|
|
||||||
abstract async getSchemes (): Promise<ITerminalColorScheme[]>
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Extend to add more terminal context menu items
|
|
||||||
*/
|
|
||||||
export abstract class TerminalContextMenuItemProvider {
|
|
||||||
weight: number
|
|
||||||
|
|
||||||
abstract async getItems (tab: BaseTerminalTabComponent): Promise<Electron.MenuItemConstructorOptions[]>
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IShell {
|
|
||||||
id: string
|
|
||||||
name?: string
|
|
||||||
command: string
|
|
||||||
args?: string[]
|
|
||||||
env: {[id: string]: string}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Base path to which shell's internal FS is relative
|
|
||||||
* Currently used for WSL only
|
|
||||||
*/
|
|
||||||
fsBase?: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SVG icon
|
|
||||||
*/
|
|
||||||
icon?: SafeHtml
|
|
||||||
|
|
||||||
hidden?: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Extend to add support for more shells
|
|
||||||
*/
|
|
||||||
export abstract class ShellProvider {
|
|
||||||
abstract async provide (): Promise<IShell[]>
|
|
||||||
}
|
|
@@ -2,32 +2,32 @@ import { Observable, Subject, Subscription } from 'rxjs'
|
|||||||
import { first } from 'rxjs/operators'
|
import { first } from 'rxjs/operators'
|
||||||
import { ToastrService } from 'ngx-toastr'
|
import { ToastrService } from 'ngx-toastr'
|
||||||
import { NgZone, OnInit, OnDestroy, Inject, Injector, Optional, ViewChild, HostBinding, Input, ElementRef } from '@angular/core'
|
import { NgZone, OnInit, OnDestroy, Inject, Injector, Optional, ViewChild, HostBinding, Input, ElementRef } from '@angular/core'
|
||||||
import { trigger, transition, style, animate } from '@angular/animations'
|
import { trigger, transition, style, animate, AnimationTriggerMetadata } from '@angular/animations'
|
||||||
import { AppService, ConfigService, BaseTabComponent, ElectronService, HostAppService, HotkeysService, Platform, LogService, Logger } from 'terminus-core'
|
import { AppService, ConfigService, BaseTabComponent, ElectronService, HostAppService, HotkeysService, Platform, LogService, Logger } from 'terminus-core'
|
||||||
|
|
||||||
import { BaseSession, SessionsService } from '../services/sessions.service'
|
import { BaseSession, SessionsService } from '../services/sessions.service'
|
||||||
import { TerminalFrontendService } from '../services/terminalFrontend.service'
|
import { TerminalFrontendService } from '../services/terminalFrontend.service'
|
||||||
|
|
||||||
import { TerminalDecorator, ResizeEvent, TerminalContextMenuItemProvider } from '../api'
|
|
||||||
import { Frontend } from '../frontends/frontend'
|
import { Frontend } from '../frontends/frontend'
|
||||||
|
import { ResizeEvent } from './interfaces'
|
||||||
|
import { TerminalDecorator } from './decorator'
|
||||||
|
import { TerminalContextMenuItemProvider } from './contextMenuProvider'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class to base your custom terminal tabs on
|
* A class to base your custom terminal tabs on
|
||||||
*/
|
*/
|
||||||
export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit, OnDestroy {
|
export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit, OnDestroy {
|
||||||
static template = require('./baseTerminalTab.component.pug')
|
static template = require('../components/baseTerminalTab.component.pug')
|
||||||
static styles = [require('./terminalTab.component.scss')]
|
static styles = [require('../components/terminalTab.component.scss')]
|
||||||
static animations = [
|
static animations: AnimationTriggerMetadata[] = [trigger('slideInOut', [
|
||||||
trigger('slideInOut', [
|
transition(':enter', [
|
||||||
transition(':enter', [
|
style({ transform: 'translateY(-25%)' }),
|
||||||
style({ transform: 'translateY(-25%)' }),
|
animate('100ms ease-in-out', style({ transform: 'translateY(0%)' }))
|
||||||
animate('100ms ease-in-out', style({ transform: 'translateY(0%)' }))
|
]),
|
||||||
]),
|
transition(':leave', [
|
||||||
transition(':leave', [
|
animate('100ms ease-in-out', style({ transform: 'translateY(-25%)' }))
|
||||||
animate('100ms ease-in-out', style({ transform: 'translateY(-25%)' }))
|
|
||||||
])
|
|
||||||
])
|
])
|
||||||
]
|
])]
|
||||||
|
|
||||||
session: BaseSession
|
session: BaseSession
|
||||||
@Input() zoom = 0
|
@Input() zoom = 0
|
8
terminus-terminal/src/api/colorSchemeProvider.ts
Normal file
8
terminus-terminal/src/api/colorSchemeProvider.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { ITerminalColorScheme } from './interfaces'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extend to add more terminal color schemes
|
||||||
|
*/
|
||||||
|
export abstract class TerminalColorSchemeProvider {
|
||||||
|
abstract async getSchemes (): Promise<ITerminalColorScheme[]>
|
||||||
|
}
|
10
terminus-terminal/src/api/contextMenuProvider.ts
Normal file
10
terminus-terminal/src/api/contextMenuProvider.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { BaseTerminalTabComponent } from './baseTerminalTab.component'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extend to add more terminal context menu items
|
||||||
|
*/
|
||||||
|
export abstract class TerminalContextMenuItemProvider {
|
||||||
|
weight: number
|
||||||
|
|
||||||
|
abstract async getItems (tab: BaseTerminalTabComponent): Promise<Electron.MenuItemConstructorOptions[]>
|
||||||
|
}
|
16
terminus-terminal/src/api/decorator.ts
Normal file
16
terminus-terminal/src/api/decorator.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { BaseTerminalTabComponent } from './baseTerminalTab.component'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extend to automatically run actions on new terminals
|
||||||
|
*/
|
||||||
|
export abstract class TerminalDecorator {
|
||||||
|
/**
|
||||||
|
* Called when a new terminal tab starts
|
||||||
|
*/
|
||||||
|
attach (terminal: BaseTerminalTabComponent): void { } // tslint:disable-line no-empty
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called before a terminal tab is destroyed
|
||||||
|
*/
|
||||||
|
detach (terminal: BaseTerminalTabComponent): void { } // tslint:disable-line no-empty
|
||||||
|
}
|
54
terminus-terminal/src/api/interfaces.ts
Normal file
54
terminus-terminal/src/api/interfaces.ts
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
import { SafeHtml } from '@angular/platform-browser'
|
||||||
|
|
||||||
|
export interface ResizeEvent {
|
||||||
|
columns: number
|
||||||
|
rows: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SessionOptions {
|
||||||
|
name?: string
|
||||||
|
command: string
|
||||||
|
args: string[]
|
||||||
|
cwd?: string
|
||||||
|
env?: {[id: string]: string}
|
||||||
|
width?: number
|
||||||
|
height?: number
|
||||||
|
pauseAfterExit?: boolean
|
||||||
|
runAsAdministrator?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Profile {
|
||||||
|
name: string,
|
||||||
|
sessionOptions: SessionOptions,
|
||||||
|
isBuiltin?: boolean
|
||||||
|
icon?: SafeHtml
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ITerminalColorScheme {
|
||||||
|
name: string
|
||||||
|
foreground: string
|
||||||
|
background: string
|
||||||
|
cursor: string
|
||||||
|
colors: string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IShell {
|
||||||
|
id: string
|
||||||
|
name?: string
|
||||||
|
command: string
|
||||||
|
args?: string[]
|
||||||
|
env: {[id: string]: string}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base path to which shell's internal FS is relative
|
||||||
|
* Currently used for WSL only
|
||||||
|
*/
|
||||||
|
fsBase?: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SVG icon
|
||||||
|
*/
|
||||||
|
icon?: SafeHtml
|
||||||
|
|
||||||
|
hidden?: boolean
|
||||||
|
}
|
8
terminus-terminal/src/api/shellProvider.ts
Normal file
8
terminus-terminal/src/api/shellProvider.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { IShell } from './interfaces'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extend to add support for more shells
|
||||||
|
*/
|
||||||
|
export abstract class ShellProvider {
|
||||||
|
abstract async provide (): Promise<IShell[]>
|
||||||
|
}
|
@@ -1,7 +1,8 @@
|
|||||||
import * as fs from 'mz/fs'
|
import * as fs from 'mz/fs'
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { TerminalColorSchemeProvider, ITerminalColorScheme } from './api'
|
import { TerminalColorSchemeProvider } from './api/colorSchemeProvider'
|
||||||
|
import { ITerminalColorScheme } from './api/interfaces'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@@ -6,7 +6,8 @@ const fontManager = require('fontmanager-redux')
|
|||||||
|
|
||||||
import { Component, Inject } from '@angular/core'
|
import { Component, Inject } from '@angular/core'
|
||||||
import { ConfigService, HostAppService, Platform, ElectronService } from 'terminus-core'
|
import { ConfigService, HostAppService, Platform, ElectronService } from 'terminus-core'
|
||||||
import { TerminalColorSchemeProvider, ITerminalColorScheme } from '../api'
|
import { TerminalColorSchemeProvider } from '../api/colorSchemeProvider'
|
||||||
|
import { ITerminalColorScheme } from '../api/interfaces'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Component({
|
@Component({
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
|
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
|
||||||
import { UACService } from '../services/uac.service'
|
import { UACService } from '../services/uac.service'
|
||||||
import { Profile } from '../api'
|
import { Profile } from '../api/interfaces'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Component({
|
@Component({
|
||||||
|
@@ -4,7 +4,7 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
|||||||
import { Subscription } from 'rxjs'
|
import { Subscription } from 'rxjs'
|
||||||
import { ConfigService, ElectronService, HostAppService, Platform } from 'terminus-core'
|
import { ConfigService, ElectronService, HostAppService, Platform } from 'terminus-core'
|
||||||
import { EditProfileModalComponent } from './editProfileModal.component'
|
import { EditProfileModalComponent } from './editProfileModal.component'
|
||||||
import { IShell, Profile } from '../api'
|
import { IShell, Profile } from '../api/interfaces'
|
||||||
import { TerminalService } from '../services/terminal.service'
|
import { TerminalService } from '../services/terminal.service'
|
||||||
import { WIN_BUILD_CONPTY_SUPPORTED, WIN_BUILD_CONPTY_STABLE, isWindowsBuild } from '../utils'
|
import { WIN_BUILD_CONPTY_SUPPORTED, WIN_BUILD_CONPTY_STABLE, isWindowsBuild } from '../utils'
|
||||||
|
|
||||||
|
@@ -2,8 +2,8 @@ import { Component, Input } from '@angular/core'
|
|||||||
import { Subscription } from 'rxjs'
|
import { Subscription } from 'rxjs'
|
||||||
import { first } from 'rxjs/operators'
|
import { first } from 'rxjs/operators'
|
||||||
import { BaseTabProcess } from 'terminus-core'
|
import { BaseTabProcess } from 'terminus-core'
|
||||||
import { BaseTerminalTabComponent } from './baseTerminalTab.component'
|
import { BaseTerminalTabComponent } from '../api/baseTerminalTab.component'
|
||||||
import { SessionOptions } from '../api'
|
import { SessionOptions } from '../api/interfaces'
|
||||||
import { Session } from '../services/sessions.service'
|
import { Session } from '../services/sessions.service'
|
||||||
import { WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild } from '../utils'
|
import { WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild } from '../utils'
|
||||||
|
|
||||||
|
@@ -3,8 +3,8 @@ import { ToastrService } from 'ngx-toastr'
|
|||||||
import { ConfigService } from 'terminus-core'
|
import { ConfigService } from 'terminus-core'
|
||||||
import { UACService } from './services/uac.service'
|
import { UACService } from './services/uac.service'
|
||||||
import { TerminalService } from './services/terminal.service'
|
import { TerminalService } from './services/terminal.service'
|
||||||
import { BaseTerminalTabComponent } from './components/baseTerminalTab.component'
|
import { TerminalContextMenuItemProvider } from './api/contextMenuProvider'
|
||||||
import { TerminalContextMenuItemProvider } from './api'
|
import { BaseTerminalTabComponent } from './api/baseTerminalTab.component'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { Observable, Subject, AsyncSubject, ReplaySubject, BehaviorSubject } from 'rxjs'
|
import { Observable, Subject, AsyncSubject, ReplaySubject, BehaviorSubject } from 'rxjs'
|
||||||
import { ResizeEvent } from '../api'
|
import { ResizeEvent } from '../api/interfaces'
|
||||||
import { ConfigService, ThemesService, HotkeysService } from 'terminus-core'
|
import { ConfigService, ThemesService, HotkeysService } from 'terminus-core'
|
||||||
|
|
||||||
export interface ISearchOptions {
|
export interface ISearchOptions {
|
||||||
|
@@ -17,7 +17,6 @@ import { TerminalSettingsTabComponent } from './components/terminalSettingsTab.c
|
|||||||
import { ColorPickerComponent } from './components/colorPicker.component'
|
import { ColorPickerComponent } from './components/colorPicker.component'
|
||||||
import { EditProfileModalComponent } from './components/editProfileModal.component'
|
import { EditProfileModalComponent } from './components/editProfileModal.component'
|
||||||
import { EnvironmentEditorComponent } from './components/environmentEditor.component'
|
import { EnvironmentEditorComponent } from './components/environmentEditor.component'
|
||||||
import { BaseTerminalTabComponent } from './components/baseTerminalTab.component'
|
|
||||||
import { SearchPanelComponent } from './components/searchPanel.component'
|
import { SearchPanelComponent } from './components/searchPanel.component'
|
||||||
|
|
||||||
import { BaseSession } from './services/sessions.service'
|
import { BaseSession } from './services/sessions.service'
|
||||||
@@ -27,7 +26,10 @@ import { DockMenuService } from './services/dockMenu.service'
|
|||||||
|
|
||||||
import { ButtonProvider } from './buttonProvider'
|
import { ButtonProvider } from './buttonProvider'
|
||||||
import { RecoveryProvider } from './recoveryProvider'
|
import { RecoveryProvider } from './recoveryProvider'
|
||||||
import { TerminalColorSchemeProvider, TerminalDecorator, ShellProvider, TerminalContextMenuItemProvider } from './api'
|
import { TerminalDecorator } from './api/decorator'
|
||||||
|
import { TerminalContextMenuItemProvider } from './api/contextMenuProvider'
|
||||||
|
import { TerminalColorSchemeProvider } from './api/colorSchemeProvider'
|
||||||
|
import { ShellProvider } from './api/shellProvider'
|
||||||
import { TerminalSettingsTabProvider, AppearanceSettingsTabProvider, ShellSettingsTabProvider } from './settings'
|
import { TerminalSettingsTabProvider, AppearanceSettingsTabProvider, ShellSettingsTabProvider } from './settings'
|
||||||
import { PathDropDecorator } from './pathDrop'
|
import { PathDropDecorator } from './pathDrop'
|
||||||
import { TerminalConfigProvider } from './config'
|
import { TerminalConfigProvider } from './config'
|
||||||
@@ -216,6 +218,7 @@ export default class TerminalModule {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { TerminalService, BaseSession, TerminalTabComponent, TerminalFrontendService, BaseTerminalTabComponent }
|
export { TerminalService, BaseSession, TerminalTabComponent, TerminalFrontendService, TerminalDecorator, TerminalContextMenuItemProvider, TerminalColorSchemeProvider }
|
||||||
export { Frontend, XTermFrontend, XTermWebGLFrontend, HTermFrontend }
|
export { Frontend, XTermFrontend, XTermWebGLFrontend, HTermFrontend }
|
||||||
export * from './api'
|
export { BaseTerminalTabComponent } from './api/baseTerminalTab.component'
|
||||||
|
export * from './api/interfaces'
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { Subscription } from 'rxjs'
|
import { Subscription } from 'rxjs'
|
||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { TerminalDecorator } from './api'
|
import { TerminalDecorator } from './api/decorator'
|
||||||
import { TerminalTabComponent } from './components/terminalTab.component'
|
import { TerminalTabComponent } from './components/terminalTab.component'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
|
@@ -8,7 +8,7 @@ import { first } from 'rxjs/operators'
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { Logger, LogService, ConfigService } from 'terminus-core'
|
import { Logger, LogService, ConfigService } from 'terminus-core'
|
||||||
import { exec } from 'mz/child_process'
|
import { exec } from 'mz/child_process'
|
||||||
import { SessionOptions } from '../api'
|
import { SessionOptions } from '../api/interfaces'
|
||||||
import { WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild } from '../utils'
|
import { WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild } from '../utils'
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@@ -3,7 +3,8 @@ import slug from 'slug'
|
|||||||
import { Observable, AsyncSubject } from 'rxjs'
|
import { Observable, AsyncSubject } from 'rxjs'
|
||||||
import { Injectable, Inject } from '@angular/core'
|
import { Injectable, Inject } from '@angular/core'
|
||||||
import { AppService, Logger, LogService, ConfigService, SplitTabComponent } from 'terminus-core'
|
import { AppService, Logger, LogService, ConfigService, SplitTabComponent } from 'terminus-core'
|
||||||
import { IShell, ShellProvider, SessionOptions, Profile } from '../api'
|
import { ShellProvider } from '../api/shellProvider'
|
||||||
|
import { IShell, SessionOptions, Profile } from '../api/interfaces'
|
||||||
import { TerminalTabComponent } from '../components/terminalTab.component'
|
import { TerminalTabComponent } from '../components/terminalTab.component'
|
||||||
import { UACService } from './uac.service'
|
import { UACService } from './uac.service'
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { ElectronService } from 'terminus-core'
|
import { ElectronService } from 'terminus-core'
|
||||||
import { SessionOptions } from '../api'
|
import { SessionOptions } from '../api/interfaces'
|
||||||
|
|
||||||
import { WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild } from '../utils'
|
import { WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild } from '../utils'
|
||||||
|
|
||||||
|
@@ -3,7 +3,8 @@ import { Injectable } from '@angular/core'
|
|||||||
import { DomSanitizer } from '@angular/platform-browser'
|
import { DomSanitizer } from '@angular/platform-browser'
|
||||||
import { HostAppService, Platform } from 'terminus-core'
|
import { HostAppService, Platform } from 'terminus-core'
|
||||||
|
|
||||||
import { ShellProvider, IShell } from '../api'
|
import { ShellProvider } from '../api/shellProvider'
|
||||||
|
import { IShell } from '../api/interfaces'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { ConfigService } from 'terminus-core'
|
import { ConfigService } from 'terminus-core'
|
||||||
|
|
||||||
import { ShellProvider, IShell } from '../api'
|
import { ShellProvider } from '../api/shellProvider'
|
||||||
|
import { IShell } from '../api/interfaces'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@@ -3,7 +3,8 @@ import { Injectable } from '@angular/core'
|
|||||||
import { DomSanitizer } from '@angular/platform-browser'
|
import { DomSanitizer } from '@angular/platform-browser'
|
||||||
import { HostAppService, Platform } from 'terminus-core'
|
import { HostAppService, Platform } from 'terminus-core'
|
||||||
|
|
||||||
import { ShellProvider, IShell } from '../api'
|
import { ShellProvider } from '../api/shellProvider'
|
||||||
|
import { IShell } from '../api/interfaces'
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var wnr = require('windows-native-registry') // tslint:disable-line
|
var wnr = require('windows-native-registry') // tslint:disable-line
|
||||||
|
@@ -3,7 +3,8 @@ import { Injectable } from '@angular/core'
|
|||||||
import { DomSanitizer } from '@angular/platform-browser'
|
import { DomSanitizer } from '@angular/platform-browser'
|
||||||
import { HostAppService, Platform } from 'terminus-core'
|
import { HostAppService, Platform } from 'terminus-core'
|
||||||
|
|
||||||
import { ShellProvider, IShell } from '../api'
|
import { ShellProvider } from '../api/shellProvider'
|
||||||
|
import { IShell } from '../api/interfaces'
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var wnr = require('windows-native-registry') // tslint:disable-line
|
var wnr = require('windows-native-registry') // tslint:disable-line
|
||||||
|
@@ -3,7 +3,8 @@ import { Injectable } from '@angular/core'
|
|||||||
import { DomSanitizer } from '@angular/platform-browser'
|
import { DomSanitizer } from '@angular/platform-browser'
|
||||||
import { HostAppService, Platform } from 'terminus-core'
|
import { HostAppService, Platform } from 'terminus-core'
|
||||||
|
|
||||||
import { ShellProvider, IShell } from '../api'
|
import { ShellProvider } from '../api/shellProvider'
|
||||||
|
import { IShell } from '../api/interfaces'
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var wnr = require('windows-native-registry') // tslint:disable-line
|
var wnr = require('windows-native-registry') // tslint:disable-line
|
||||||
|
@@ -2,7 +2,8 @@ import * as fs from 'mz/fs'
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { HostAppService, Platform, LogService, Logger } from 'terminus-core'
|
import { HostAppService, Platform, LogService, Logger } from 'terminus-core'
|
||||||
|
|
||||||
import { ShellProvider, IShell } from '../api'
|
import { ShellProvider } from '../api/shellProvider'
|
||||||
|
import { IShell } from '../api/interfaces'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@@ -2,7 +2,8 @@ import { exec } from 'mz/child_process'
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { HostAppService, Platform } from 'terminus-core'
|
import { HostAppService, Platform } from 'terminus-core'
|
||||||
|
|
||||||
import { ShellProvider, IShell } from '../api'
|
import { ShellProvider } from '../api/shellProvider'
|
||||||
|
import { IShell } from '../api/interfaces'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@@ -3,7 +3,8 @@ import slug from 'slug'
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { HostAppService, Platform } from 'terminus-core'
|
import { HostAppService, Platform } from 'terminus-core'
|
||||||
|
|
||||||
import { ShellProvider, IShell } from '../api'
|
import { ShellProvider } from '../api/shellProvider'
|
||||||
|
import { IShell } from '../api/interfaces'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { DomSanitizer } from '@angular/platform-browser'
|
import { DomSanitizer } from '@angular/platform-browser'
|
||||||
import { HostAppService, Platform } from 'terminus-core'
|
import { HostAppService, Platform } from 'terminus-core'
|
||||||
import { ShellProvider, IShell } from '../api'
|
import { ShellProvider } from '../api/shellProvider'
|
||||||
|
import { IShell } from '../api/interfaces'
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var wnr = require('windows-native-registry') // tslint:disable-line
|
var wnr = require('windows-native-registry') // tslint:disable-line
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { HostAppService, Platform } from 'terminus-core'
|
import { HostAppService, Platform } from 'terminus-core'
|
||||||
|
|
||||||
import { ShellProvider, IShell } from '../api'
|
import { ShellProvider } from '../api/shellProvider'
|
||||||
|
import { IShell } from '../api/interfaces'
|
||||||
|
|
||||||
import { WSLShellProvider } from './wsl'
|
import { WSLShellProvider } from './wsl'
|
||||||
import { PowerShellCoreShellProvider } from './powershellCore'
|
import { PowerShellCoreShellProvider } from './powershellCore'
|
||||||
|
@@ -3,7 +3,8 @@ import { Injectable } from '@angular/core'
|
|||||||
import { DomSanitizer } from '@angular/platform-browser'
|
import { DomSanitizer } from '@angular/platform-browser'
|
||||||
import { HostAppService, Platform, ElectronService } from 'terminus-core'
|
import { HostAppService, Platform, ElectronService } from 'terminus-core'
|
||||||
|
|
||||||
import { ShellProvider, IShell } from '../api'
|
import { ShellProvider } from '../api/shellProvider'
|
||||||
|
import { IShell } from '../api/interfaces'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@@ -4,7 +4,8 @@ import slug from 'slug'
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { HostAppService, Platform } from 'terminus-core'
|
import { HostAppService, Platform } from 'terminus-core'
|
||||||
|
|
||||||
import { ShellProvider, IShell } from '../api'
|
import { ShellProvider } from '../api/shellProvider'
|
||||||
|
import { IShell } from '../api/interfaces'
|
||||||
import { isWindowsBuild, WIN_BUILD_WSL_EXE_DISTRO_FLAG } from '../utils'
|
import { isWindowsBuild, WIN_BUILD_WSL_EXE_DISTRO_FLAG } from '../utils'
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@@ -1,12 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../tsconfig.json",
|
"extends": "../tsconfig.json",
|
||||||
"exclude": ["node_modules", "dist"],
|
"exclude": ["node_modules", "dist", "typings"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "src",
|
"baseUrl": "src"
|
||||||
"declarationDir": "dist",
|
|
||||||
"paths": {
|
|
||||||
"terminus-*": ["terminus-*"],
|
|
||||||
"*": ["app/node_modules/*"]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
14
terminus-terminal/tsconfig.typings.json
Normal file
14
terminus-terminal/tsconfig.typings.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"exclude": ["node_modules", "dist", "typings"],
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": "src",
|
||||||
|
"emitDeclarationOnly": true,
|
||||||
|
"declaration": true,
|
||||||
|
"declarationDir": "./typings",
|
||||||
|
"paths": {
|
||||||
|
"terminus-*": ["../../terminus-*"],
|
||||||
|
"*": ["../../app/node_modules/*"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -11,7 +11,6 @@
|
|||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"declaration": true,
|
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
|
Reference in New Issue
Block a user