mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-20 07:06:04 +00:00
Compare commits
8 Commits
v1.0.0-alp
...
v1.0.0-alp
Author | SHA1 | Date | |
---|---|---|---|
![]() |
11f188f1e8 | ||
![]() |
9a9db28054 | ||
![]() |
47d57d08ee | ||
![]() |
39e2c386f0 | ||
![]() |
c73d39026b | ||
![]() |
89dff969b1 | ||
![]() |
e1eb1beb87 | ||
![]() |
8d12d6a547 |
@@ -115,7 +115,7 @@ export async function findPlugins (): Promise<IPluginInfo[]> {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
let info = JSON.parse(await fs.readFile(infoPath, {encoding: 'utf-8'}))
|
let info = JSON.parse(await fs.readFile(infoPath, {encoding: 'utf-8'}))
|
||||||
if (!info.keywords || info.keywords.indexOf('terminus-plugin') === -1) {
|
if (!info.keywords || !(info.keywords.includes('terminus-plugin') || info.keywords.includes('terminus-builtin-plugin'))) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
let author = info.author
|
let author = info.author
|
||||||
|
@@ -58,3 +58,7 @@
|
|||||||
color: #842fe0;
|
color: #842fe0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.modal-dialog {
|
||||||
|
-webkit-app-region: no-drag;
|
||||||
|
}
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "terminus-community-color-schemes",
|
"name": "terminus-community-color-schemes",
|
||||||
"version": "1.0.0-alpha.24",
|
"version": "1.0.0-alpha.35",
|
||||||
"description": "Community color schemes for Terminus",
|
"description": "Community color schemes for Terminus",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"terminus-plugin"
|
"terminus-builtin-plugin"
|
||||||
],
|
],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "terminus-core",
|
"name": "terminus-core",
|
||||||
"version": "1.0.0-alpha.24",
|
"version": "1.0.0-alpha.35.1",
|
||||||
"description": "Terminus core",
|
"description": "Terminus core",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"terminus-plugin"
|
"terminus-builtin-plugin"
|
||||||
],
|
],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
"@types/js-yaml": "^3.9.0",
|
"@types/js-yaml": "^3.9.0",
|
||||||
"@types/node": "^7.0.37",
|
"@types/node": "^7.0.37",
|
||||||
"@types/webpack-env": "^1.13.0",
|
"@types/webpack-env": "^1.13.0",
|
||||||
|
"@types/winston": "^2.3.6",
|
||||||
"axios": "0.16.2",
|
"axios": "0.16.2",
|
||||||
"bootstrap": "4.0.0-alpha.6",
|
"bootstrap": "4.0.0-alpha.6",
|
||||||
"core-js": "^2.4.1",
|
"core-js": "^2.4.1",
|
||||||
@@ -39,7 +40,8 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"deepmerge": "^1.5.0",
|
"deepmerge": "^1.5.0",
|
||||||
"js-yaml": "^3.9.0"
|
"js-yaml": "^3.9.0",
|
||||||
|
"winston": "^2.4.0"
|
||||||
},
|
},
|
||||||
"false": {}
|
"false": {}
|
||||||
}
|
}
|
||||||
|
@@ -1,12 +1,47 @@
|
|||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
|
import { ElectronService } from './electron.service'
|
||||||
|
import * as winston from 'winston'
|
||||||
|
import * as fs from 'fs'
|
||||||
|
import * as path from 'path'
|
||||||
|
|
||||||
|
const initializeWinston = (electron: ElectronService) => {
|
||||||
|
const logDirectory = electron.app.getPath('userData')
|
||||||
|
|
||||||
|
if (!fs.existsSync(logDirectory)) {
|
||||||
|
fs.mkdirSync(logDirectory)
|
||||||
|
}
|
||||||
|
|
||||||
|
return new winston.Logger({
|
||||||
|
transports: [
|
||||||
|
new winston.transports.File({
|
||||||
|
level: 'info',
|
||||||
|
filename: path.join(logDirectory, 'log.txt'),
|
||||||
|
handleExceptions: false,
|
||||||
|
json: false,
|
||||||
|
maxsize: 5242880,
|
||||||
|
maxFiles: 5,
|
||||||
|
colorize: false
|
||||||
|
}),
|
||||||
|
new winston.transports.Console({
|
||||||
|
level: 'info',
|
||||||
|
handleExceptions: false,
|
||||||
|
json: false,
|
||||||
|
colorize: true
|
||||||
|
})
|
||||||
|
],
|
||||||
|
exitOnError: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export class Logger {
|
export class Logger {
|
||||||
constructor (
|
constructor (
|
||||||
|
private winstonLogger: any,
|
||||||
private name: string,
|
private name: string,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
doLog (level: string, ...args: any[]) {
|
doLog (level: string, ...args: any[]) {
|
||||||
console[level](`%c[${this.name}]`, 'color: #aaa', ...args)
|
console[level](`%c[${this.name}]`, 'color: #aaa', ...args)
|
||||||
|
this.winstonLogger[level](...args)
|
||||||
}
|
}
|
||||||
|
|
||||||
debug (...args: any[]) { this.doLog('debug', ...args) }
|
debug (...args: any[]) { this.doLog('debug', ...args) }
|
||||||
@@ -18,7 +53,13 @@ export class Logger {
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class LogService {
|
export class LogService {
|
||||||
|
private log: any
|
||||||
|
|
||||||
|
constructor (electron: ElectronService) {
|
||||||
|
this.log = initializeWinston(electron)
|
||||||
|
}
|
||||||
|
|
||||||
create (name: string): Logger {
|
create (name: string): Logger {
|
||||||
return new Logger(name)
|
return new Logger(this.log, name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -45,6 +45,7 @@ module.exports = {
|
|||||||
'path',
|
'path',
|
||||||
'deepmerge',
|
'deepmerge',
|
||||||
'untildify',
|
'untildify',
|
||||||
|
'winston',
|
||||||
'js-yaml',
|
'js-yaml',
|
||||||
/^rxjs/,
|
/^rxjs/,
|
||||||
/^@angular/,
|
/^@angular/,
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
version "3.9.1"
|
version "3.9.1"
|
||||||
resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-3.9.1.tgz#2f3c142771bb345829ce690c5838760b6b9ba553"
|
resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-3.9.1.tgz#2f3c142771bb345829ce690c5838760b6b9ba553"
|
||||||
|
|
||||||
"@types/node@^7.0.37":
|
"@types/node@*", "@types/node@^7.0.37":
|
||||||
version "7.0.43"
|
version "7.0.43"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c"
|
||||||
|
|
||||||
@@ -14,12 +14,22 @@
|
|||||||
version "1.13.1"
|
version "1.13.1"
|
||||||
resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.13.1.tgz#b45c222e24301bd006e3edfc762cc6b51bda236a"
|
resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.13.1.tgz#b45c222e24301bd006e3edfc762cc6b51bda236a"
|
||||||
|
|
||||||
|
"@types/winston@^2.3.6":
|
||||||
|
version "2.3.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/winston/-/winston-2.3.6.tgz#0f0954b9e16abd40598dc6e9cc2ea43044237997"
|
||||||
|
dependencies:
|
||||||
|
"@types/node" "*"
|
||||||
|
|
||||||
argparse@^1.0.7:
|
argparse@^1.0.7:
|
||||||
version "1.0.9"
|
version "1.0.9"
|
||||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86"
|
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86"
|
||||||
dependencies:
|
dependencies:
|
||||||
sprintf-js "~1.0.2"
|
sprintf-js "~1.0.2"
|
||||||
|
|
||||||
|
async@~1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/async/-/async-1.0.0.tgz#f8fc04ca3a13784ade9e1641af98578cfbd647a9"
|
||||||
|
|
||||||
axios@0.16.2:
|
axios@0.16.2:
|
||||||
version "0.16.2"
|
version "0.16.2"
|
||||||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.16.2.tgz#ba4f92f17167dfbab40983785454b9ac149c3c6d"
|
resolved "https://registry.yarnpkg.com/axios/-/axios-0.16.2.tgz#ba4f92f17167dfbab40983785454b9ac149c3c6d"
|
||||||
@@ -44,10 +54,18 @@ bootstrap@4.0.0-alpha.6:
|
|||||||
jquery ">=1.9.1"
|
jquery ">=1.9.1"
|
||||||
tether "^1.4.0"
|
tether "^1.4.0"
|
||||||
|
|
||||||
|
colors@1.0.x:
|
||||||
|
version "1.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b"
|
||||||
|
|
||||||
core-js@^2.4.1:
|
core-js@^2.4.1:
|
||||||
version "2.5.1"
|
version "2.5.1"
|
||||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.1.tgz#ae6874dc66937789b80754ff5428df66819ca50b"
|
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.1.tgz#ae6874dc66937789b80754ff5428df66819ca50b"
|
||||||
|
|
||||||
|
cycle@1.0.x:
|
||||||
|
version "1.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/cycle/-/cycle-1.0.3.tgz#21e80b2be8580f98b468f379430662b046c34ad2"
|
||||||
|
|
||||||
debug@^2.4.5:
|
debug@^2.4.5:
|
||||||
version "2.6.8"
|
version "2.6.8"
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc"
|
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc"
|
||||||
@@ -97,6 +115,10 @@ esprima@^4.0.0:
|
|||||||
version "4.0.0"
|
version "4.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804"
|
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804"
|
||||||
|
|
||||||
|
eyes@0.1.x:
|
||||||
|
version "0.1.8"
|
||||||
|
resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0"
|
||||||
|
|
||||||
follow-redirects@^1.2.3:
|
follow-redirects@^1.2.3:
|
||||||
version "1.2.4"
|
version "1.2.4"
|
||||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.2.4.tgz#355e8f4d16876b43f577b0d5ce2668b9723214ea"
|
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.2.4.tgz#355e8f4d16876b43f577b0d5ce2668b9723214ea"
|
||||||
@@ -126,6 +148,10 @@ is-buffer@^1.1.5:
|
|||||||
version "1.1.5"
|
version "1.1.5"
|
||||||
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc"
|
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc"
|
||||||
|
|
||||||
|
isstream@0.1.x:
|
||||||
|
version "0.1.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
|
||||||
|
|
||||||
jquery@>=1.9.1:
|
jquery@>=1.9.1:
|
||||||
version "3.2.1"
|
version "3.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.2.1.tgz#5c4d9de652af6cd0a770154a631bba12b015c787"
|
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.2.1.tgz#5c4d9de652af6cd0a770154a631bba12b015c787"
|
||||||
@@ -191,6 +217,10 @@ sprintf-js@~1.0.2:
|
|||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
|
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
|
||||||
|
|
||||||
|
stack-trace@0.0.x:
|
||||||
|
version "0.0.10"
|
||||||
|
resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0"
|
||||||
|
|
||||||
tether@^1.4.0:
|
tether@^1.4.0:
|
||||||
version "1.4.0"
|
version "1.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/tether/-/tether-1.4.0.tgz#0f9fa171f75bf58485d8149e94799d7ae74d1c1a"
|
resolved "https://registry.yarnpkg.com/tether/-/tether-1.4.0.tgz#0f9fa171f75bf58485d8149e94799d7ae74d1c1a"
|
||||||
@@ -209,6 +239,17 @@ uuid-1345@^0.99.6:
|
|||||||
dependencies:
|
dependencies:
|
||||||
macaddress "^0.2.7"
|
macaddress "^0.2.7"
|
||||||
|
|
||||||
|
winston@^2.4.0:
|
||||||
|
version "2.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/winston/-/winston-2.4.0.tgz#808050b93d52661ed9fb6c26b3f0c826708b0aee"
|
||||||
|
dependencies:
|
||||||
|
async "~1.0.0"
|
||||||
|
colors "1.0.x"
|
||||||
|
cycle "1.0.x"
|
||||||
|
eyes "0.1.x"
|
||||||
|
isstream "0.1.x"
|
||||||
|
stack-trace "0.0.x"
|
||||||
|
|
||||||
xelement@^1.0.16:
|
xelement@^1.0.16:
|
||||||
version "1.0.16"
|
version "1.0.16"
|
||||||
resolved "https://registry.yarnpkg.com/xelement/-/xelement-1.0.16.tgz#900bb46c20fc2dffadff778a9d2dc36699d0ff7e"
|
resolved "https://registry.yarnpkg.com/xelement/-/xelement-1.0.16.tgz#900bb46c20fc2dffadff778a9d2dc36699d0ff7e"
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "terminus-plugin-manager",
|
"name": "terminus-plugin-manager",
|
||||||
"version": "1.0.0-alpha.24",
|
"version": "1.0.0-alpha.35.1",
|
||||||
"description": "Terminus' plugin manager",
|
"description": "Terminus' plugin manager",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"terminus-plugin"
|
"terminus-builtin-plugin"
|
||||||
],
|
],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
|
@@ -5,6 +5,7 @@ import { PluginsSettingsTabComponent } from './components/pluginsSettingsTab.com
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class PluginsSettingsTabProvider extends SettingsTabProvider {
|
export class PluginsSettingsTabProvider extends SettingsTabProvider {
|
||||||
|
id = 'plugins'
|
||||||
title = 'Plugins'
|
title = 'Plugins'
|
||||||
|
|
||||||
getComponentType (): ComponentType {
|
getComponentType (): ComponentType {
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "terminus-settings",
|
"name": "terminus-settings",
|
||||||
"version": "1.0.0-alpha.24",
|
"version": "1.0.0-alpha.35.3",
|
||||||
"description": "Terminus terminal settings page",
|
"description": "Terminus terminal settings page",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"terminus-plugin"
|
"terminus-builtin-plugin"
|
||||||
],
|
],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
|
@@ -3,6 +3,7 @@ import { Component } from '@angular/core'
|
|||||||
export declare type ComponentType = new (...args: any[]) => Component
|
export declare type ComponentType = new (...args: any[]) => Component
|
||||||
|
|
||||||
export abstract class SettingsTabProvider {
|
export abstract class SettingsTabProvider {
|
||||||
|
id: string
|
||||||
title: string
|
title: string
|
||||||
|
|
||||||
getComponentType (): ComponentType {
|
getComponentType (): ComponentType {
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
button.btn.btn-outline-warning.btn-block(*ngIf='config.restartRequested', '(click)'='restartApp()') Restart the app to apply changes
|
button.btn.btn-outline-warning.btn-block(*ngIf='config.restartRequested', '(click)'='restartApp()') Restart the app to apply changes
|
||||||
|
|
||||||
ngb-tabset.vertical(type='tabs')
|
ngb-tabset.vertical(type='tabs', [activeId]='activeTab')
|
||||||
ngb-tab
|
ngb-tab(id='application')
|
||||||
ng-template(ngbTabTitle)
|
ng-template(ngbTabTitle)
|
||||||
| Application
|
| Application
|
||||||
ng-template(ngbTabContent)
|
ng-template(ngbTabContent)
|
||||||
@@ -164,7 +164,7 @@ ngb-tabset.vertical(type='tabs')
|
|||||||
'(ngModelChange)'='config.save()',
|
'(ngModelChange)'='config.save()',
|
||||||
)
|
)
|
||||||
|
|
||||||
ngb-tab
|
ngb-tab(id='hotkeys')
|
||||||
ng-template(ngbTabTitle)
|
ng-template(ngbTabTitle)
|
||||||
| Hotkeys
|
| Hotkeys
|
||||||
ng-template(ngbTabContent)
|
ng-template(ngbTabContent)
|
||||||
@@ -184,7 +184,7 @@ ngb-tabset.vertical(type='tabs')
|
|||||||
'(modelChange)'='config.save(); docking.dock()'
|
'(modelChange)'='config.save(); docking.dock()'
|
||||||
)
|
)
|
||||||
|
|
||||||
ngb-tab(*ngFor='let provider of settingsProviders')
|
ngb-tab(*ngFor='let provider of settingsProviders', [id]='provider.id')
|
||||||
ng-template(ngbTabTitle)
|
ng-template(ngbTabTitle)
|
||||||
| {{provider.title}}
|
| {{provider.title}}
|
||||||
ng-template(ngbTabContent)
|
ng-template(ngbTabContent)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Component, Inject } from '@angular/core'
|
import { Component, Inject, Input } from '@angular/core'
|
||||||
import { ElectronService, DockingService, ConfigService, IHotkeyDescription, HotkeyProvider, BaseTabComponent, Theme, HostAppService } from 'terminus-core'
|
import { ElectronService, DockingService, ConfigService, IHotkeyDescription, HotkeyProvider, BaseTabComponent, Theme, HostAppService } from 'terminus-core'
|
||||||
|
|
||||||
import { SettingsTabProvider } from '../api'
|
import { SettingsTabProvider } from '../api'
|
||||||
@@ -12,6 +12,7 @@ import { SettingsTabProvider } from '../api'
|
|||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class SettingsTabComponent extends BaseTabComponent {
|
export class SettingsTabComponent extends BaseTabComponent {
|
||||||
|
@Input() activeTab: string
|
||||||
hotkeyFilter = ''
|
hotkeyFilter = ''
|
||||||
private hotkeyDescriptions: IHotkeyDescription[]
|
private hotkeyDescriptions: IHotkeyDescription[]
|
||||||
private screens
|
private screens
|
||||||
|
@@ -40,3 +40,4 @@ export default class SettingsModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export * from './api'
|
export * from './api'
|
||||||
|
export { SettingsTabComponent }
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "terminus-terminal",
|
"name": "terminus-terminal",
|
||||||
"version": "1.0.0-alpha.24",
|
"version": "1.0.0-alpha.35.1",
|
||||||
"description": "Terminus' terminal emulation core",
|
"description": "Terminus' terminal emulation core",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"terminus-plugin"
|
"terminus-builtin-plugin"
|
||||||
],
|
],
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
|
h3.mb-2 Appearance
|
||||||
.row
|
.row
|
||||||
.col-md-6
|
.col-md-6
|
||||||
.form-group
|
.form-group
|
||||||
label Preview
|
|
||||||
.appearance-preview(
|
.appearance-preview(
|
||||||
[style.font-family]='config.store.terminal.font',
|
[style.font-family]='config.store.terminal.font',
|
||||||
[style.font-size]='config.store.terminal.fontSize + "px"',
|
[style.font-size]='config.store.terminal.fontSize + "px"',
|
||||||
@@ -60,23 +60,6 @@
|
|||||||
span([style.color]='config.store.terminal.colorScheme.colors[15]') W
|
span([style.color]='config.store.terminal.colorScheme.colors[15]') W
|
||||||
div
|
div
|
||||||
span
|
span
|
||||||
div
|
|
||||||
span john@doe-pc
|
|
||||||
span([style.color]='config.store.terminal.colorScheme.colors[1]') $
|
|
||||||
span webpack
|
|
||||||
div
|
|
||||||
span Asset Size
|
|
||||||
div
|
|
||||||
span([style.color]='config.store.terminal.colorScheme.colors[2]') main.js
|
|
||||||
span 234 kB
|
|
||||||
span([style.color]='config.store.terminal.colorScheme.colors[2]') [emitted]
|
|
||||||
div
|
|
||||||
span([style.color]='config.store.terminal.colorScheme.colors[3]') big.js
|
|
||||||
span([style.color]='config.store.terminal.colorScheme.colors[3]') 1.2 MB
|
|
||||||
span([style.color]='config.store.terminal.colorScheme.colors[2]') [emitted]
|
|
||||||
span([style.color]='config.store.terminal.colorScheme.colors[3]') [big]
|
|
||||||
div
|
|
||||||
span
|
|
||||||
div
|
div
|
||||||
span john@doe-pc
|
span john@doe-pc
|
||||||
span([style.color]='config.store.terminal.colorScheme.colors[1]') $
|
span([style.color]='config.store.terminal.colorScheme.colors[1]') $
|
||||||
@@ -228,16 +211,33 @@
|
|||||||
)
|
)
|
||||||
| ▁
|
| ▁
|
||||||
|
|
||||||
.form-group
|
h3.mt-2.mb-2 Behaviour
|
||||||
label Shell
|
|
||||||
select.form-control(
|
.row
|
||||||
'[(ngModel)]'='config.store.terminal.shell',
|
.col-md-6
|
||||||
(ngModelChange)='config.save()',
|
.d-flex
|
||||||
)
|
.form-group.mr-3
|
||||||
option(
|
label Shell
|
||||||
*ngFor='let shell of shells',
|
select.form-control(
|
||||||
[ngValue]='shell.id'
|
'[(ngModel)]'='config.store.terminal.shell',
|
||||||
) {{shell.name}}
|
(ngModelChange)='config.save()',
|
||||||
|
)
|
||||||
|
option(
|
||||||
|
*ngFor='let shell of shells',
|
||||||
|
[ngValue]='shell.id'
|
||||||
|
) {{shell.name}}
|
||||||
|
|
||||||
|
.form-group
|
||||||
|
label Session persistence
|
||||||
|
select.form-control(
|
||||||
|
'[(ngModel)]'='config.store.terminal.persistence',
|
||||||
|
(ngModelChange)='config.save()',
|
||||||
|
)
|
||||||
|
option([ngValue]='null') Off
|
||||||
|
option(
|
||||||
|
*ngFor='let provider of persistenceProviders',
|
||||||
|
[ngValue]='provider.id'
|
||||||
|
) {{provider.displayName}}
|
||||||
|
|
||||||
.form-group(*ngIf='config.store.terminal.shell == "custom"')
|
.form-group(*ngIf='config.store.terminal.shell == "custom"')
|
||||||
label Custom shell
|
label Custom shell
|
||||||
@@ -247,6 +247,39 @@
|
|||||||
(ngModelChange)='config.save()',
|
(ngModelChange)='config.save()',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
.form-group
|
||||||
|
label Working directory
|
||||||
|
input.form-control(
|
||||||
|
type='text',
|
||||||
|
placeholder='Home directory',
|
||||||
|
'[(ngModel)]'='config.store.terminal.workingDirectory',
|
||||||
|
(ngModelChange)='config.save()',
|
||||||
|
)
|
||||||
|
|
||||||
|
.form-group
|
||||||
|
label Auto-open a terminal on app start
|
||||||
|
br
|
||||||
|
.btn-group(
|
||||||
|
'[(ngModel)]'='config.store.terminal.autoOpen',
|
||||||
|
(ngModelChange)='config.save()',
|
||||||
|
ngbRadioGroup
|
||||||
|
)
|
||||||
|
label.btn.btn-secondary(ngbButtonLabel)
|
||||||
|
input(
|
||||||
|
type='radio',
|
||||||
|
ngbButton,
|
||||||
|
[value]='false'
|
||||||
|
)
|
||||||
|
| Off
|
||||||
|
label.btn.btn-secondary(ngbButtonLabel)
|
||||||
|
input(
|
||||||
|
type='radio',
|
||||||
|
ngbButton,
|
||||||
|
[value]='true'
|
||||||
|
)
|
||||||
|
| On
|
||||||
|
|
||||||
|
.col-md-6
|
||||||
.d-flex
|
.d-flex
|
||||||
.form-group.mr-3
|
.form-group.mr-3
|
||||||
label Terminal bell
|
label Terminal bell
|
||||||
@@ -301,37 +334,49 @@
|
|||||||
)
|
)
|
||||||
| On
|
| On
|
||||||
|
|
||||||
.form-group
|
.d-flex
|
||||||
label Session persistence
|
.form-group.mr-3
|
||||||
select.form-control(
|
label Copy on select
|
||||||
'[(ngModel)]'='config.store.terminal.persistence',
|
br
|
||||||
(ngModelChange)='config.save()',
|
.btn-group(
|
||||||
)
|
'[(ngModel)]'='config.store.terminal.copyOnSelect',
|
||||||
option([ngValue]='null') Off
|
(ngModelChange)='config.save()',
|
||||||
option(
|
ngbRadioGroup
|
||||||
*ngFor='let provider of persistenceProviders',
|
)
|
||||||
[ngValue]='provider.id'
|
label.btn.btn-secondary(ngbButtonLabel)
|
||||||
) {{provider.displayName}}
|
input(
|
||||||
|
type='radio',
|
||||||
|
ngbButton,
|
||||||
|
[value]='false'
|
||||||
|
)
|
||||||
|
| Off
|
||||||
|
label.btn.btn-secondary(ngbButtonLabel)
|
||||||
|
input(
|
||||||
|
type='radio',
|
||||||
|
ngbButton,
|
||||||
|
[value]='true'
|
||||||
|
)
|
||||||
|
| On
|
||||||
|
|
||||||
.form-group
|
.form-group
|
||||||
label Auto-open a terminal on app start
|
label Right click behaviour
|
||||||
br
|
br
|
||||||
.btn-group(
|
.btn-group(
|
||||||
'[(ngModel)]'='config.store.terminal.autoOpen',
|
'[(ngModel)]'='config.store.terminal.rightClick',
|
||||||
(ngModelChange)='config.save()',
|
(ngModelChange)='config.save()',
|
||||||
ngbRadioGroup
|
ngbRadioGroup
|
||||||
)
|
)
|
||||||
label.btn.btn-secondary(ngbButtonLabel)
|
label.btn.btn-secondary(ngbButtonLabel)
|
||||||
input(
|
input(
|
||||||
type='radio',
|
type='radio',
|
||||||
ngbButton,
|
ngbButton,
|
||||||
[value]='false'
|
value='menu'
|
||||||
)
|
)
|
||||||
| Off
|
| Menu
|
||||||
label.btn.btn-secondary(ngbButtonLabel)
|
label.btn.btn-secondary(ngbButtonLabel)
|
||||||
input(
|
input(
|
||||||
type='radio',
|
type='radio',
|
||||||
ngbButton,
|
ngbButton,
|
||||||
[value]='true'
|
value='paste'
|
||||||
)
|
)
|
||||||
| On
|
| Paste
|
||||||
|
@@ -60,23 +60,28 @@ export class TerminalTabComponent extends BaseTabComponent {
|
|||||||
this.decorators = this.decorators || []
|
this.decorators = this.decorators || []
|
||||||
this.title = 'Terminal'
|
this.title = 'Terminal'
|
||||||
this.resize$.first().subscribe(async (resizeEvent) => {
|
this.resize$.first().subscribe(async (resizeEvent) => {
|
||||||
this.session = this.sessions.addSession(
|
if (!this.session) {
|
||||||
Object.assign({}, this.sessionOptions, resizeEvent)
|
this.session = this.sessions.addSession(
|
||||||
)
|
Object.assign({}, this.sessionOptions, resizeEvent)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.session.resize(resizeEvent.width, resizeEvent.height)
|
this.session.resize(resizeEvent.width, resizeEvent.height)
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
// this.session.output$.bufferTime(10).subscribe((datas) => {
|
// this.session.output$.bufferTime(10).subscribe((datas) => {
|
||||||
this.session.output$.subscribe(data => {
|
this.session.output$.subscribe(data => {
|
||||||
// let data = datas.join('')
|
|
||||||
this.zone.run(() => {
|
this.zone.run(() => {
|
||||||
this.output$.next(data)
|
this.output$.next(data)
|
||||||
|
this.write(data)
|
||||||
})
|
})
|
||||||
this.write(data)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
this.sessionCloseSubscription = this.session.closed$.subscribe(() => {
|
this.sessionCloseSubscription = this.session.closed$.subscribe(() => {
|
||||||
this.app.closeTab(this)
|
this.app.closeTab(this)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.session.releaseInitialDataBuffer()
|
this.session.releaseInitialDataBuffer()
|
||||||
})
|
})
|
||||||
this.hotkeysSubscription = this.hotkeys.matchedHotkey.subscribe(hotkey => {
|
this.hotkeysSubscription = this.hotkeys.matchedHotkey.subscribe(hotkey => {
|
||||||
@@ -178,7 +183,7 @@ export class TerminalTabComponent extends BaseTabComponent {
|
|||||||
label: 'Paste',
|
label: 'Paste',
|
||||||
click: () => {
|
click: () => {
|
||||||
this.zone.run(() => {
|
this.zone.run(() => {
|
||||||
this.sendInput(this.electron.clipboard.readText())
|
this.paste()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -223,12 +228,17 @@ export class TerminalTabComponent extends BaseTabComponent {
|
|||||||
this.mouseEvent$.next(event)
|
this.mouseEvent$.next(event)
|
||||||
if (event.type === 'mousedown') {
|
if (event.type === 'mousedown') {
|
||||||
if (event.which === 3) {
|
if (event.which === 3) {
|
||||||
this.contextMenu.popup({
|
if (this.config.store.terminal.rightClick === 'menu') {
|
||||||
x: event.pageX + this.content.nativeElement.getBoundingClientRect().left,
|
this.contextMenu.popup({
|
||||||
y: event.pageY + this.content.nativeElement.getBoundingClientRect().top,
|
x: event.pageX + this.content.nativeElement.getBoundingClientRect().left,
|
||||||
async: true,
|
y: event.pageY + this.content.nativeElement.getBoundingClientRect().top,
|
||||||
})
|
async: true,
|
||||||
|
})
|
||||||
|
} else if (this.config.store.terminal.rightClick === 'paste') {
|
||||||
|
this.paste()
|
||||||
|
}
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -302,6 +312,10 @@ export class TerminalTabComponent extends BaseTabComponent {
|
|||||||
this.io.writeUTF8(data)
|
this.io.writeUTF8(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
paste () {
|
||||||
|
this.sendInput(this.electron.clipboard.readText())
|
||||||
|
}
|
||||||
|
|
||||||
clear () {
|
clear () {
|
||||||
this.hterm.wipeContents()
|
this.hterm.wipeContents()
|
||||||
this.hterm.onVTKeystroke('\f')
|
this.hterm.onVTKeystroke('\f')
|
||||||
@@ -319,7 +333,7 @@ export class TerminalTabComponent extends BaseTabComponent {
|
|||||||
preferenceManager.set('send-encoding', 'raw')
|
preferenceManager.set('send-encoding', 'raw')
|
||||||
preferenceManager.set('ctrl-plus-minus-zero-zoom', false)
|
preferenceManager.set('ctrl-plus-minus-zero-zoom', false)
|
||||||
preferenceManager.set('scrollbar-visible', this.hostApp.platform === Platform.macOS)
|
preferenceManager.set('scrollbar-visible', this.hostApp.platform === Platform.macOS)
|
||||||
preferenceManager.set('copy-on-select', false)
|
preferenceManager.set('copy-on-select', config.terminal.copyOnSelect)
|
||||||
preferenceManager.set('alt-sends-what', 'browser-key')
|
preferenceManager.set('alt-sends-what', 'browser-key')
|
||||||
preferenceManager.set('alt-gr-mode', 'ctrl-alt')
|
preferenceManager.set('alt-gr-mode', 'ctrl-alt')
|
||||||
preferenceManager.set('pass-alt-number', true)
|
preferenceManager.set('pass-alt-number', true)
|
||||||
|
@@ -13,6 +13,9 @@ export class TerminalConfigProvider extends ConfigProvider {
|
|||||||
cursor: 'block',
|
cursor: 'block',
|
||||||
cursorBlink: true,
|
cursorBlink: true,
|
||||||
customShell: '',
|
customShell: '',
|
||||||
|
rightClick: 'menu',
|
||||||
|
copyOnSelect: false,
|
||||||
|
workingDirectory: '',
|
||||||
colorScheme: {
|
colorScheme: {
|
||||||
__nonStructural: true,
|
__nonStructural: true,
|
||||||
name: 'Material',
|
name: 'Material',
|
||||||
@@ -80,6 +83,8 @@ export class TerminalConfigProvider extends ConfigProvider {
|
|||||||
font: 'Consolas',
|
font: 'Consolas',
|
||||||
shell: 'clink',
|
shell: 'clink',
|
||||||
persistence: null,
|
persistence: null,
|
||||||
|
rightClick: 'paste',
|
||||||
|
copyOnSelect: true,
|
||||||
},
|
},
|
||||||
hotkeys: {
|
hotkeys: {
|
||||||
'copy': [
|
'copy': [
|
||||||
|
@@ -10,7 +10,7 @@ import { TerminalTabComponent } from './components/terminalTab.component'
|
|||||||
import { TerminalSettingsTabComponent } from './components/terminalSettingsTab.component'
|
import { TerminalSettingsTabComponent } from './components/terminalSettingsTab.component'
|
||||||
import { ColorPickerComponent } from './components/colorPicker.component'
|
import { ColorPickerComponent } from './components/colorPicker.component'
|
||||||
|
|
||||||
import { SessionsService } from './services/sessions.service'
|
import { SessionsService, BaseSession } from './services/sessions.service'
|
||||||
import { TerminalService } from './services/terminal.service'
|
import { TerminalService } from './services/terminal.service'
|
||||||
|
|
||||||
import { ScreenPersistenceProvider } from './persistence/screen'
|
import { ScreenPersistenceProvider } from './persistence/screen'
|
||||||
@@ -117,4 +117,4 @@ export default class TerminalModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export * from './api'
|
export * from './api'
|
||||||
export { TerminalService }
|
export { TerminalService, BaseSession, TerminalTabComponent }
|
||||||
|
@@ -14,7 +14,7 @@ export interface IChildProcess {
|
|||||||
command: string
|
command: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Session {
|
export abstract class BaseSession {
|
||||||
open: boolean
|
open: boolean
|
||||||
name: string
|
name: string
|
||||||
output$ = new Subject<string>()
|
output$ = new Subject<string>()
|
||||||
@@ -22,11 +22,46 @@ export class Session {
|
|||||||
destroyed$ = new Subject<void>()
|
destroyed$ = new Subject<void>()
|
||||||
recoveryId: string
|
recoveryId: string
|
||||||
truePID: number
|
truePID: number
|
||||||
private pty: any
|
|
||||||
private initialDataBuffer = ''
|
private initialDataBuffer = ''
|
||||||
private initialDataBufferReleased = false
|
private initialDataBufferReleased = false
|
||||||
|
|
||||||
|
emitOutput (data: string) {
|
||||||
|
if (!this.initialDataBufferReleased) {
|
||||||
|
this.initialDataBuffer += data
|
||||||
|
} else {
|
||||||
|
this.output$.next(data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
releaseInitialDataBuffer () {
|
||||||
|
this.initialDataBufferReleased = true
|
||||||
|
this.output$.next(this.initialDataBuffer)
|
||||||
|
this.initialDataBuffer = null
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract resize (columns, rows)
|
||||||
|
abstract write (data)
|
||||||
|
abstract kill (signal?: string)
|
||||||
|
abstract async getChildProcesses (): Promise<IChildProcess[]>
|
||||||
|
abstract async gracefullyKillProcess (): Promise<void>
|
||||||
|
abstract async getWorkingDirectory (): Promise<string>
|
||||||
|
|
||||||
|
async destroy (): Promise<void> {
|
||||||
|
if (this.open) {
|
||||||
|
this.open = false
|
||||||
|
this.closed$.next()
|
||||||
|
this.destroyed$.next()
|
||||||
|
this.output$.complete()
|
||||||
|
await this.gracefullyKillProcess()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Session extends BaseSession {
|
||||||
|
private pty: any
|
||||||
|
|
||||||
constructor (options: SessionOptions) {
|
constructor (options: SessionOptions) {
|
||||||
|
super()
|
||||||
this.name = options.name
|
this.name = options.name
|
||||||
this.recoveryId = options.recoveryId
|
this.recoveryId = options.recoveryId
|
||||||
|
|
||||||
@@ -65,12 +100,8 @@ export class Session {
|
|||||||
|
|
||||||
this.open = true
|
this.open = true
|
||||||
|
|
||||||
this.pty.on('data', (data) => {
|
this.pty.on('data', data => {
|
||||||
if (!this.initialDataBufferReleased) {
|
this.emitOutput(data)
|
||||||
this.initialDataBuffer += data
|
|
||||||
} else {
|
|
||||||
this.output$.next(data)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
this.pty.on('exit', () => {
|
this.pty.on('exit', () => {
|
||||||
@@ -86,12 +117,6 @@ export class Session {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
releaseInitialDataBuffer () {
|
|
||||||
this.initialDataBufferReleased = true
|
|
||||||
this.output$.next(this.initialDataBuffer)
|
|
||||||
this.initialDataBuffer = null
|
|
||||||
}
|
|
||||||
|
|
||||||
resize (columns, rows) {
|
resize (columns, rows) {
|
||||||
if (this.pty._writable) {
|
if (this.pty._writable) {
|
||||||
this.pty.resize(columns, rows)
|
this.pty.resize(columns, rows)
|
||||||
@@ -144,16 +169,6 @@ export class Session {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async destroy (): Promise<void> {
|
|
||||||
if (this.open) {
|
|
||||||
this.open = false
|
|
||||||
this.closed$.next()
|
|
||||||
this.destroyed$.next()
|
|
||||||
this.output$.complete()
|
|
||||||
await this.gracefullyKillProcess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async getWorkingDirectory (): Promise<string> {
|
async getWorkingDirectory (): Promise<string> {
|
||||||
if (!this.truePID) {
|
if (!this.truePID) {
|
||||||
return null
|
return null
|
||||||
|
@@ -33,8 +33,12 @@ export class TerminalService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async openTab (shell?: IShell, cwd?: string): Promise<TerminalTabComponent> {
|
async openTab (shell?: IShell, cwd?: string): Promise<TerminalTabComponent> {
|
||||||
if (!cwd && this.app.activeTab instanceof TerminalTabComponent) {
|
if (!cwd) {
|
||||||
cwd = await this.app.activeTab.session.getWorkingDirectory()
|
if (this.app.activeTab instanceof TerminalTabComponent) {
|
||||||
|
cwd = await this.app.activeTab.session.getWorkingDirectory()
|
||||||
|
} else {
|
||||||
|
cwd = this.config.store.terminal.workingDirectory || null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!shell) {
|
if (!shell) {
|
||||||
let shells = await this.shells$.toPromise()
|
let shells = await this.shells$.toPromise()
|
||||||
|
@@ -5,6 +5,7 @@ import { TerminalSettingsTabComponent } from './components/terminalSettingsTab.c
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class TerminalSettingsTabProvider extends SettingsTabProvider {
|
export class TerminalSettingsTabProvider extends SettingsTabProvider {
|
||||||
|
id = 'terminal'
|
||||||
title = 'Terminal'
|
title = 'Terminal'
|
||||||
|
|
||||||
getComponentType (): ComponentType {
|
getComponentType (): ComponentType {
|
||||||
|
@@ -25,7 +25,10 @@ export class WSLShellProvider extends ShellProvider {
|
|||||||
return [{
|
return [{
|
||||||
id: 'wsl',
|
id: 'wsl',
|
||||||
name: 'Bash on Windows',
|
name: 'Bash on Windows',
|
||||||
command: wslPath
|
command: wslPath,
|
||||||
|
env: {
|
||||||
|
TERM: 'xterm-color',
|
||||||
|
}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user