mirror of
https://github.com/Eugeny/tabby.git
synced 2024-11-22 11:52:03 +03:00
done
This commit is contained in:
parent
0ea346a6ae
commit
dc513b427d
16
Makefile
16
Makefile
@ -6,17 +6,29 @@ SHORT_VERSION=$(shell python -c 'import subprocess; v = subprocess.check_output(
|
||||
all: run
|
||||
|
||||
run:
|
||||
DEV=1 ./node_modules/.bin/electron ./app --debug
|
||||
DEV=1 NODE_PATH=./app/node_modules ./node_modules/.bin/electron ./app --debug
|
||||
|
||||
lint:
|
||||
tslint -c tslint.json app/src/*.ts app/src/**/*.ts
|
||||
|
||||
build:
|
||||
DEV=1 ./node_modules/.bin/webpack --progress
|
||||
DEV=1 ./node_modules/.bin/webpack --progress --display-modules
|
||||
|
||||
build-plugins:
|
||||
cd terminus-core; npm run build
|
||||
cd terminus-settings; npm run build
|
||||
cd terminus-terminal; npm run build
|
||||
cd terminus-community-color-schemes; npm run build
|
||||
cd terminus-clickable-links; npm run build
|
||||
|
||||
watch:
|
||||
DEV=1 ./node_modules/.bin/webpack --progress -w
|
||||
|
||||
|
||||
build-native:
|
||||
./node_modules/.bin/electron-rebuild -f -w terminus-terminal/node_modules/node-pty -m terminus-terminal
|
||||
./node_modules/.bin/electron-rebuild -f -w terminus-terminal/node_modules/font-manager -m terminus-terminal
|
||||
|
||||
build-native-windows:
|
||||
echo :: Building native extensions
|
||||
rm -r ./native/windows/build || true
|
||||
|
58
app/assets/bootstrap/bootstrap.less
vendored
58
app/assets/bootstrap/bootstrap.less
vendored
@ -1,58 +0,0 @@
|
||||
// Core variables and mixins
|
||||
@import "../../../node_modules/bootstrap/less/variables.less";
|
||||
@import "variables.less";
|
||||
@import "../../../node_modules/bootstrap/less/mixins.less";
|
||||
//@import "mixin-overrides.less";
|
||||
|
||||
// Reset and dependencies
|
||||
@import "../../../node_modules/bootstrap/less/normalize.less";
|
||||
@import "../../../node_modules/bootstrap/less/print.less";
|
||||
@import "../../../node_modules/bootstrap/less/glyphicons.less";
|
||||
|
||||
// Core CSS
|
||||
@import "../../../node_modules/bootstrap/less/scaffolding.less";
|
||||
@import "../../../node_modules/bootstrap/less/type.less";
|
||||
@import "../../../node_modules/bootstrap/less/code.less";
|
||||
@import "../../../node_modules/bootstrap/less/grid.less";
|
||||
@import "../../../node_modules/bootstrap/less/tables.less";
|
||||
@import "../../../node_modules/bootstrap/less/forms.less";
|
||||
@import "../../../node_modules/bootstrap/less/buttons.less";
|
||||
|
||||
// Components
|
||||
@import "../../../node_modules/bootstrap/less/component-animations.less";
|
||||
@import "../../../node_modules/bootstrap/less/dropdowns.less";
|
||||
@import "../../../node_modules/bootstrap/less/button-groups.less";
|
||||
@import "../../../node_modules/bootstrap/less/input-groups.less";
|
||||
@import "../../../node_modules/bootstrap/less/navs.less";
|
||||
@import "../../../node_modules/bootstrap/less/navbar.less";
|
||||
@import "../../../node_modules/bootstrap/less/breadcrumbs.less";
|
||||
@import "../../../node_modules/bootstrap/less/pagination.less";
|
||||
@import "../../../node_modules/bootstrap/less/pager.less";
|
||||
@import "../../../node_modules/bootstrap/less/labels.less";
|
||||
@import "../../../node_modules/bootstrap/less/badges.less";
|
||||
@import "../../../node_modules/bootstrap/less/jumbotron.less";
|
||||
@import "../../../node_modules/bootstrap/less/thumbnails.less";
|
||||
@import "../../../node_modules/bootstrap/less/alerts.less";
|
||||
@import "../../../node_modules/bootstrap/less/progress-bars.less";
|
||||
@import "../../../node_modules/bootstrap/less/media.less";
|
||||
@import "../../../node_modules/bootstrap/less/list-group.less";
|
||||
@import "../../../node_modules/bootstrap/less/panels.less";
|
||||
@import "../../../node_modules/bootstrap/less/responsive-embed.less";
|
||||
@import "../../../node_modules/bootstrap/less/wells.less";
|
||||
@import "../../../node_modules/bootstrap/less/close.less";
|
||||
|
||||
// Components w/ JavaScript
|
||||
@import "../../../node_modules/bootstrap/less/modals.less";
|
||||
@import "../../../node_modules/bootstrap/less/tooltip.less";
|
||||
@import "../../../node_modules/bootstrap/less/popovers.less";
|
||||
@import "../../../node_modules/bootstrap/less/carousel.less";
|
||||
|
||||
// Utility classes
|
||||
@import "../../../node_modules/bootstrap/less/utilities.less";
|
||||
@import "../../../node_modules/bootstrap/less/responsive-utilities.less";
|
||||
|
||||
@import "overrides.less";
|
||||
|
||||
body {
|
||||
background: transparent;
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
// Core variables and mixins
|
||||
@import "../../../node_modules/bootstrap/less/variables.less";
|
||||
@import "variables.less";
|
||||
@import "../../../node_modules/bootstrap/less/mixins.less";
|
@ -143,7 +143,7 @@ start = () => {
|
||||
Object.assign(options, windowConfig.get('windowBoundaries'))
|
||||
|
||||
if (platform == 'darwin') {
|
||||
options.titleBarStyle = 'hidden'
|
||||
options.titleBarStyle = 'hidden-inset'
|
||||
}
|
||||
|
||||
if ((configData.appearance || {}).useNativeFrame) {
|
||||
|
@ -1,18 +1,23 @@
|
||||
{
|
||||
"name": "term",
|
||||
"version": "1.0.0",
|
||||
"name": "terminus",
|
||||
"version": "0.0.1",
|
||||
"main": "main.js",
|
||||
"dependencies": {
|
||||
"child-process-promise": "2.2.0",
|
||||
"@angular/animations": "4.0.1",
|
||||
"@angular/common": "4.0.1",
|
||||
"@angular/compiler": "4.0.1",
|
||||
"@angular/core": "4.0.1",
|
||||
"@angular/forms": "4.0.1",
|
||||
"@angular/platform-browser": "4.0.1",
|
||||
"@angular/platform-browser-dynamic": "4.0.1",
|
||||
"@ng-bootstrap/ng-bootstrap": "1.0.0-alpha.22",
|
||||
"devtron": "1.4.0",
|
||||
"electron-config": "0.2.1",
|
||||
"electron-debug": "1.0.1",
|
||||
"electron-is-dev": "0.1.2",
|
||||
"fs-promise": "^2.0.1",
|
||||
"node-pty": "0.6.3",
|
||||
"path": "0.12.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"js-yaml": "3.8.2"
|
||||
"js-yaml": "3.8.2",
|
||||
"path": "0.12.7",
|
||||
"rxjs": "5.3.0",
|
||||
"zone.js": "0.8.4"
|
||||
}
|
||||
}
|
||||
|
@ -1,21 +1,27 @@
|
||||
import { NgModule } from '@angular/core'
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'
|
||||
|
||||
const projectRoot = '/home/eugene/Work/term/'
|
||||
if (process.env.DEV) {
|
||||
(<any>global).require('module').globalPaths.push(projectRoot);
|
||||
(<any>global).require('module').globalPaths.push(projectRoot + 'app/node_modules')
|
||||
}
|
||||
|
||||
let plugins = [
|
||||
(<any>global).require('../terminus-settings').default,
|
||||
(<any>global).require('../terminus-terminal').default,
|
||||
(<any>global).require('../terminus-clickable-links').default,
|
||||
(<any>global).require('../terminus-community-color-schemes').default,
|
||||
(<any>global).require(projectRoot + 'terminus-settings').default,
|
||||
(<any>global).require(projectRoot + 'terminus-terminal').default,
|
||||
(<any>global).require(projectRoot + 'terminus-clickable-links').default,
|
||||
(<any>global).require(projectRoot + 'terminus-community-color-schemes').default,
|
||||
]
|
||||
|
||||
const core = (<any>global).require('../terminus-core').default,
|
||||
const core = (<any>global).require(projectRoot + 'terminus-core')
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
core.forRoot(),
|
||||
core.AppRootModule.forRoot(),
|
||||
...plugins,
|
||||
NgbModule.forRoot(),
|
||||
]
|
||||
//bootstrap: [AppRootComponent]
|
||||
],
|
||||
bootstrap: [core.AppRootComponent]
|
||||
})
|
||||
export class RootModule { }
|
||||
|
@ -1,3 +1,3 @@
|
||||
import 'source-sans-pro'
|
||||
import 'font-awesome/css/font-awesome.css'
|
||||
import '../assets/toaster-custom.less'
|
||||
import '../assets/toaster-custom.scss'
|
||||
|
@ -1,4 +1,4 @@
|
||||
console.timeStamp('entry point')
|
||||
(<any>console).timeStamp('entry point')
|
||||
|
||||
import 'core-js'
|
||||
import 'zone.js/dist/zone.js'
|
||||
@ -18,7 +18,7 @@ if ((<any>global).require('electron-is-dev')) {
|
||||
enableProdMode()
|
||||
}
|
||||
|
||||
console.timeStamp('angular bootstrap started')
|
||||
(<any>console).timeStamp('angular bootstrap started')
|
||||
platformBrowserDynamic().bootstrapModule(RootModule);
|
||||
|
||||
|
||||
|
7
app/src/root.component.ts
Normal file
7
app/src/root.component.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import { Component } from '@angular/core'
|
||||
|
||||
|
||||
@Component({
|
||||
template: '<app-root></app-root>'
|
||||
})
|
||||
export class RootComponent { }
|
19
package.json
19
package.json
@ -1,6 +1,12 @@
|
||||
{
|
||||
"name": "term",
|
||||
"devDependencies": {
|
||||
"angular2-perfect-scrollbar": "2.0.0",
|
||||
"jquery": "^3.1.1",
|
||||
"@types/fs-promise": "^1.0.1",
|
||||
"@types/core-js": "^0.9.35",
|
||||
"@types/electron": "1.4.34",
|
||||
"@types/node": "^7.0.5",
|
||||
"@types/webpack-env": "^1.13.0",
|
||||
"apply-loader": "^0.1.0",
|
||||
"awesome-typescript-loader": "3.1.2",
|
||||
@ -12,6 +18,7 @@
|
||||
"file-loader": "^0.9.0",
|
||||
"font-awesome": "4.7.0",
|
||||
"html-loader": "^0.4.4",
|
||||
"source-sans-pro": "^2.0.10",
|
||||
"less": "^2.7.1",
|
||||
"less-loader": "^2.2.3",
|
||||
"node-gyp": "^3.4.0",
|
||||
@ -25,7 +32,7 @@
|
||||
"to-string-loader": "^1.1.5",
|
||||
"tslint": "5.0.0",
|
||||
"tslint-eslint-rules": "4.0.0",
|
||||
"typescript": "2.2.2",
|
||||
"typescript": "~2.1.0",
|
||||
"url-loader": "^0.5.7",
|
||||
"val-loader": "^0.5.0",
|
||||
"vrsource-tslint-rules": "^4.0.1",
|
||||
@ -54,15 +61,5 @@
|
||||
"pack": "build --dir",
|
||||
"postinstall": "install-app-deps",
|
||||
"dist": "build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular/platform-server": "4.0.1",
|
||||
"@angular/router": "4.0.1",
|
||||
"@types/fs-promise": "^1.0.1",
|
||||
"@types/core-js": "^0.9.35",
|
||||
"@types/electron": "1.4.34",
|
||||
"@types/node": "^7.0.5",
|
||||
"angular2-perfect-scrollbar": "2.0.0",
|
||||
"jquery": "^3.1.1"
|
||||
}
|
||||
}
|
||||
|
@ -15,10 +15,12 @@
|
||||
"typescript": "^2.2.2",
|
||||
"webpack": "^2.3.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"peerDependencies": {
|
||||
"@angular/core": "^4.0.1",
|
||||
"terminus-core": "*",
|
||||
"terminus-terminal": "*",
|
||||
"terminus-terminal": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"untildify": "^3.0.2"
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"baseUrl": "src",
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"declaration": false,
|
||||
@ -22,8 +22,9 @@
|
||||
"es7"
|
||||
],
|
||||
"paths": {
|
||||
"terminus-*": ["../terminus-*"]
|
||||
}
|
||||
"*": ["../../app/node_modules/*"],
|
||||
"terminus-*": ["../../terminus-*"]
|
||||
}
|
||||
},
|
||||
"compileOnSave": false,
|
||||
"exclude": [
|
||||
|
@ -1,15 +1,15 @@
|
||||
module.exports = {
|
||||
target: 'node',
|
||||
entry: './index.ts',
|
||||
entry: 'src/index.ts',
|
||||
devtool: 'source-map',
|
||||
output: {
|
||||
filename: './dist/index.js',
|
||||
pathinfo: true,
|
||||
library: 'terminusClickableLinks',
|
||||
libraryTarget: 'umd',
|
||||
devtoolModuleFilenameTemplate: 'webpack-terminus-clickable-links:///[resource-path]',
|
||||
},
|
||||
resolve: {
|
||||
modules: ['.', 'node_modules', '..'],
|
||||
modules: ['.', 'node_modules', '../app/node_modules'],
|
||||
extensions: ['.ts', '.js'],
|
||||
},
|
||||
module: {
|
||||
@ -20,11 +20,12 @@ module.exports = {
|
||||
},
|
||||
]
|
||||
},
|
||||
externals: [{
|
||||
'fs': true,
|
||||
'untildify': true,
|
||||
'@angular/core': true,
|
||||
'terminus-core': true,
|
||||
'terminus-terminal': true,
|
||||
}]
|
||||
externals: [
|
||||
'fs',
|
||||
'untildify',
|
||||
/^rxjs/,
|
||||
/^@angular/,
|
||||
/^@ng-bootstrap/,
|
||||
/^terminus-/,
|
||||
]
|
||||
}
|
||||
|
@ -10,8 +10,9 @@
|
||||
},
|
||||
"author": "Eugene Pankov",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"peerDependencies": {
|
||||
"@angular/core": "4.0.1",
|
||||
"terminus-core": "*",
|
||||
"terminus-terminal": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core'
|
||||
import { TerminalColorSchemeProvider, ITerminalColorScheme } from 'terminus-terminal'
|
||||
|
||||
const schemeContents = require.context('./schemes/', true, /.*/)
|
||||
const schemeContents = require.context('../schemes/', true, /.*/)
|
||||
|
||||
|
||||
@Injectable()
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"baseUrl": "src",
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"declaration": false,
|
||||
@ -22,7 +22,8 @@
|
||||
"es7"
|
||||
],
|
||||
"paths": {
|
||||
"terminus-*": ["../terminus-*"]
|
||||
"*": ["../../app/node_modules/*"],
|
||||
"terminus-*": ["../../terminus-*"]
|
||||
}
|
||||
},
|
||||
"compileOnSave": false,
|
||||
|
@ -1,15 +1,15 @@
|
||||
module.exports = {
|
||||
target: 'node',
|
||||
entry: 'index.ts',
|
||||
entry: 'src/index.ts',
|
||||
devtool: 'source-map',
|
||||
output: {
|
||||
filename: './dist/index.js',
|
||||
pathinfo: true,
|
||||
library: 'terminusCommunityColorSchemes',
|
||||
libraryTarget: 'umd',
|
||||
devtoolModuleFilenameTemplate: 'webpack-terminus-community-color-schemes:///[resource-path]',
|
||||
},
|
||||
resolve: {
|
||||
modules: ['.', 'node_modules', '..'],
|
||||
modules: ['.', 'node_modules', '../app/node_modules'],
|
||||
extensions: ['.ts', '.js'],
|
||||
},
|
||||
module: {
|
||||
@ -18,9 +18,10 @@ module.exports = {
|
||||
{ test: /\/schemes\//, loader: "raw-loader" },
|
||||
]
|
||||
},
|
||||
externals: {
|
||||
'fs': true,
|
||||
'@angular/core': true,
|
||||
'terminus-terminal': true,
|
||||
}
|
||||
externals: [
|
||||
/^rxjs/,
|
||||
/^@angular/,
|
||||
/^@ng-bootstrap/,
|
||||
/^terminus-/,
|
||||
]
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
import { Component } from '@angular/core'
|
||||
import { HostAppService } from 'services/hostApp'
|
||||
|
||||
@Component({
|
||||
selector: 'title-bar',
|
||||
template: require('./titleBar.pug'),
|
||||
styles: [require('./titleBar.scss')],
|
||||
})
|
||||
export class TitleBarComponent {
|
||||
constructor (public hostApp: HostAppService) {
|
||||
}
|
||||
}
|
@ -5,8 +5,8 @@
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "webpack --progress --color",
|
||||
"watch": "webpack --progress --color --watch"
|
||||
"build": "rm -r dist; webpack --progress --color --display-modules",
|
||||
"watch": "rm -r dist; webpack --progress --color --watch"
|
||||
},
|
||||
"author": "Eugene Pankov",
|
||||
"license": "MIT",
|
||||
@ -19,20 +19,22 @@
|
||||
"webpack": "^2.3.3",
|
||||
"bootstrap": "4.0.0-alpha.6",
|
||||
"core-js": "^2.4.1",
|
||||
"style-loader": "^0.13.1",
|
||||
"to-string-loader": "^1.1.5",
|
||||
"json-loader": "^0.5.4",
|
||||
"yaml-loader": "^0.4.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/animations": "4.0.1",
|
||||
"@angular/common": "4.0.1",
|
||||
"@angular/core": "4.0.1",
|
||||
"json-loader": "^0.5.4",
|
||||
"@angular/forms": "4.0.1",
|
||||
"@angular/platform-browser": "4.0.1",
|
||||
"@angular/platform-browser-dynamic": "4.0.1",
|
||||
"source-sans-pro": "^2.0.10",
|
||||
"rxjs": "5.3.0",
|
||||
"yaml-loader": "^0.4.0",
|
||||
"zone.js": "0.8.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular/core": "^4.0.1",
|
||||
"deepmerge": "^1.3.2",
|
||||
"js-yaml": "^3.8.3"
|
||||
}
|
||||
|
@ -1,28 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
||||
|
||||
|
||||
@Injectable()
|
||||
export class ModalService {
|
||||
constructor(
|
||||
private ngbModal: NgbModal,
|
||||
) {}
|
||||
|
||||
open(content: any, config?: any) {
|
||||
config = config || {}
|
||||
config.windowClass = 'out'
|
||||
let modal = this.ngbModal.open(content, config)
|
||||
|
||||
let fx = (<any>modal)._removeModalElements.bind(modal);
|
||||
|
||||
(<any>modal)._removeModalElements = () => {
|
||||
(<any>modal)._windowCmptRef.instance.windowClass = 'out'
|
||||
setTimeout(() => fx(), 500)
|
||||
}
|
||||
setTimeout(() => {
|
||||
(<any>modal)._windowCmptRef.instance.windowClass = ''
|
||||
}, 1)
|
||||
|
||||
return modal
|
||||
}
|
||||
}
|
@ -7,6 +7,8 @@ export { DefaultTabProvider } from './defaultTabProvider'
|
||||
|
||||
export { AppService } from '../services/app'
|
||||
export { ConfigService } from '../services/config'
|
||||
export { DockingService } from '../services/docking'
|
||||
export { ElectronService } from '../services/electron'
|
||||
export { Logger, LogService } from '../services/log'
|
||||
export { HotkeysService } from '../services/hotkeys'
|
||||
export { HostAppService, Platform } from '../services/hostApp'
|
@ -6,7 +6,3 @@ declare interface Window {
|
||||
}
|
||||
|
||||
declare var window: Window
|
||||
|
||||
declare interface Console {
|
||||
timeStamp(...args: any[])
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
title-bar(*ngIf='!config.full().appearance.useNativeFrame && config.store.appearance.dock == "off"')
|
||||
title-bar(*ngIf='!config.full().appearance.useNativeFrame && config.full().appearance.dock == "off"')
|
||||
|
||||
.content(
|
||||
[class.tabs-on-top]='config.full().appearance.tabsOnTop'
|
@ -2,16 +2,16 @@ import { Component, Inject } from '@angular/core'
|
||||
import { trigger, style, animate, transition, state } from '@angular/animations'
|
||||
import { ToasterConfig } from 'angular2-toaster'
|
||||
|
||||
import { ElectronService } from 'services/electron'
|
||||
import { HostAppService } from 'services/hostApp'
|
||||
import { HotkeysService } from 'services/hotkeys'
|
||||
import { Logger, LogService } from 'services/log'
|
||||
import { QuitterService } from 'services/quitter'
|
||||
import { ConfigService } from 'services/config'
|
||||
import { DockingService } from 'services/docking'
|
||||
import { TabRecoveryService } from 'services/tabRecovery'
|
||||
import { ElectronService } from '../services/electron'
|
||||
import { HostAppService } from '../services/hostApp'
|
||||
import { HotkeysService } from '../services/hotkeys'
|
||||
import { Logger, LogService } from '../services/log'
|
||||
import { QuitterService } from '../services/quitter'
|
||||
import { ConfigService } from '../services/config'
|
||||
import { DockingService } from '../services/docking'
|
||||
import { TabRecoveryService } from '../services/tabRecovery'
|
||||
|
||||
import { AppService, IToolbarButton, ToolbarButtonProvider } from 'api'
|
||||
import { AppService, IToolbarButton, ToolbarButtonProvider } from '../api'
|
||||
|
||||
import 'angular2-toaster/toaster.css'
|
||||
import 'overrides.scss'
|
||||
@ -57,7 +57,7 @@ export class AppRootComponent {
|
||||
log: LogService,
|
||||
_quitter: QuitterService,
|
||||
) {
|
||||
console.timeStamp('AppComponent ctor')
|
||||
(<any>console).timeStamp('AppComponent ctor')
|
||||
|
||||
this.logger = log.create('main')
|
||||
this.logger.info('v', electron.app.getVersion())
|
@ -1,5 +1,5 @@
|
||||
import { Component, Input, ViewChild, HostBinding, ViewContainerRef } from '@angular/core'
|
||||
import { BaseTabComponent } from 'components/baseTab'
|
||||
import { BaseTabComponent } from '../components/baseTab'
|
||||
|
||||
@Component({
|
||||
selector: 'tab-body',
|
@ -1,5 +1,5 @@
|
||||
import { Component, Input, Output, EventEmitter, HostBinding } from '@angular/core'
|
||||
import { BaseTabComponent } from 'components/baseTab'
|
||||
import { BaseTabComponent } from '../components/baseTab'
|
||||
|
||||
import './tabHeader.scss'
|
||||
|
@ -32,4 +32,17 @@ $titlebar-height: 30px;
|
||||
.btn-close {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
&.inset-titlebar {
|
||||
flex-basis: 36px;
|
||||
|
||||
.title {
|
||||
padding-left: 80px;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
button {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
15
terminus-core/src/components/titleBar.ts
Normal file
15
terminus-core/src/components/titleBar.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { Component, HostBinding } from '@angular/core'
|
||||
import { HostAppService, Platform } from '../services/hostApp'
|
||||
|
||||
@Component({
|
||||
selector: 'title-bar',
|
||||
template: require('./titleBar.pug'),
|
||||
styles: [require('./titleBar.scss')],
|
||||
})
|
||||
export class TitleBarComponent {
|
||||
@HostBinding('class.inset-titlebar') insetTitlebar = false
|
||||
|
||||
constructor (public hostApp: HostAppService) {
|
||||
this.insetTitlebar = hostApp.platform == Platform.macOS
|
||||
}
|
||||
}
|
@ -3,6 +3,7 @@ appearance:
|
||||
dockScreen: 'current'
|
||||
dockFill: 50
|
||||
tabsOnTop: true
|
||||
useNativeFrame: false
|
||||
hotkeys:
|
||||
close-tab:
|
||||
- 'Ctrl-Shift-W'
|
@ -1,29 +1,29 @@
|
||||
import { NgModule, ModuleWithProviders } from '@angular/core'
|
||||
console.info((<any>global).require.resolve('@angular/core'))
|
||||
import { BrowserModule } from '@angular/platform-browser'
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
|
||||
import { FormsModule } from '@angular/forms'
|
||||
import { ToasterModule } from 'angular2-toaster'
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'
|
||||
|
||||
import { AppService } from 'services/app'
|
||||
import { ConfigService } from 'services/config'
|
||||
import { ElectronService } from 'services/electron'
|
||||
import { HostAppService } from 'services/hostApp'
|
||||
import { LogService } from 'services/log'
|
||||
import { HotkeysService, AppHotkeyProvider } from 'services/hotkeys'
|
||||
import { ModalService } from 'services/modal'
|
||||
import { NotifyService } from 'services/notify'
|
||||
import { PluginsService } from 'services/plugins'
|
||||
import { QuitterService } from 'services/quitter'
|
||||
import { DockingService } from 'services/docking'
|
||||
import { TabRecoveryService } from 'services/tabRecovery'
|
||||
import { AppService } from './services/app'
|
||||
import { ConfigService } from './services/config'
|
||||
import { ElectronService } from './services/electron'
|
||||
import { HostAppService } from './services/hostApp'
|
||||
import { LogService } from './services/log'
|
||||
import { HotkeysService, AppHotkeyProvider } from './services/hotkeys'
|
||||
import { NotifyService } from './services/notify'
|
||||
import { PluginsService } from './services/plugins'
|
||||
import { QuitterService } from './services/quitter'
|
||||
import { DockingService } from './services/docking'
|
||||
import { TabRecoveryService } from './services/tabRecovery'
|
||||
|
||||
import { AppRootComponent } from 'components/appRoot'
|
||||
import { TabBodyComponent } from 'components/tabBody'
|
||||
import { TabHeaderComponent } from 'components/tabHeader'
|
||||
import { TitleBarComponent } from 'components/titleBar'
|
||||
import { AppRootComponent } from './components/appRoot'
|
||||
import { TabBodyComponent } from './components/tabBody'
|
||||
import { TabHeaderComponent } from './components/tabHeader'
|
||||
import { TitleBarComponent } from './components/titleBar'
|
||||
|
||||
import { HotkeyProvider } from 'api/hotkeyProvider'
|
||||
import { HotkeyProvider } from './api/hotkeyProvider'
|
||||
|
||||
|
||||
const PROVIDERS = [
|
||||
@ -34,7 +34,6 @@ const PROVIDERS = [
|
||||
HostAppService,
|
||||
HotkeysService,
|
||||
LogService,
|
||||
ModalService,
|
||||
NotifyService,
|
||||
PluginsService,
|
||||
TabRecoveryService,
|
||||
@ -52,19 +51,17 @@ const PROVIDERS = [
|
||||
NgbModule,
|
||||
],
|
||||
providers: PROVIDERS,
|
||||
entryComponents: [
|
||||
],
|
||||
declarations: [
|
||||
AppRootComponent,
|
||||
TabBodyComponent,
|
||||
TabHeaderComponent,
|
||||
TitleBarComponent,
|
||||
],
|
||||
bootstrap: [
|
||||
AppRootComponent,
|
||||
]
|
||||
})
|
||||
export default class AppModule {
|
||||
}
|
||||
|
||||
export class AppRootModule {
|
||||
static forRoot(): ModuleWithProviders {
|
||||
return {
|
||||
ngModule: AppModule,
|
||||
@ -73,5 +70,5 @@ export default class AppModule {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export { AppRootComponent }
|
||||
export * from './api'
|
@ -2,20 +2,28 @@ import { Injectable, NgZone, EventEmitter } from '@angular/core'
|
||||
import { ElectronService } from '../services/electron'
|
||||
import { Logger, LogService } from '../services/log'
|
||||
|
||||
export const PLATFORM_WINDOWS = 'win32'
|
||||
export const PLATFORM_MAC = 'darwin'
|
||||
export const PLATFORM_LINUX = 'linux'
|
||||
export enum Platform {
|
||||
Linux, macOS, Windows,
|
||||
}
|
||||
|
||||
|
||||
@Injectable()
|
||||
export class HostAppService {
|
||||
platform: Platform
|
||||
nodePlatform: string
|
||||
|
||||
constructor(
|
||||
private zone: NgZone,
|
||||
private electron: ElectronService,
|
||||
log: LogService,
|
||||
) {
|
||||
this.platform = require('os').platform()
|
||||
this.logger = log.create('hostApp')
|
||||
this.nodePlatform = require('os').platform()
|
||||
this.platform = {
|
||||
win32: Platform.Windows,
|
||||
darwin: Platform.macOS,
|
||||
linux: Platform.Linux
|
||||
}[this.nodePlatform]
|
||||
|
||||
electron.ipcRenderer.on('host:quit-request', () => this.zone.run(() => this.quitRequested.emit()))
|
||||
|
||||
@ -36,7 +44,6 @@ export class HostAppService {
|
||||
})
|
||||
}
|
||||
|
||||
platform: string;
|
||||
quitRequested = new EventEmitter<any>()
|
||||
ready = new EventEmitter<any>()
|
||||
shown = new EventEmitter<any>()
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"baseUrl": "./src",
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"declaration": false,
|
||||
@ -22,11 +22,11 @@
|
||||
"es7"
|
||||
],
|
||||
"paths": {
|
||||
"terminus-*": ["../terminus-*"]
|
||||
"*": ["../../app/node_modules/*"],
|
||||
"terminus-*": ["../../terminus-*"]
|
||||
}
|
||||
},
|
||||
"compileOnSave": false,
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
}
|
||||
|
@ -1,33 +1,37 @@
|
||||
module.exports = {
|
||||
target: 'node',
|
||||
entry: './index.ts',
|
||||
entry: 'src/index.ts',
|
||||
devtool: 'source-map',
|
||||
output: {
|
||||
filename: './dist/index.js',
|
||||
pathinfo: true,
|
||||
library: 'terminusCore',
|
||||
libraryTarget: 'commonjs',
|
||||
libraryTarget: 'umd',
|
||||
devtoolModuleFilenameTemplate: 'webpack-terminus-core:///[resource-path]',
|
||||
},
|
||||
resolve: {
|
||||
modules: ['.', 'node_modules', '..'],
|
||||
modules: ['.', 'src', 'node_modules', '../app/node_modules'],
|
||||
extensions: ['.ts', '.js'],
|
||||
},
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /\.ts$/, use: 'awesome-typescript-loader' },
|
||||
{ test: /schemes\/.*$/, use: "raw-loader" },
|
||||
{ test: /\.pug$/, use: ['apply-loader', 'pug-loader'] },
|
||||
{ test: /\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader'] },
|
||||
{ test: /\.css$/, use: ['style-loader', 'css-loader', 'sass-loader'] },
|
||||
{ test: /\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader'], exclude: /components\// },
|
||||
{ test: /\.scss$/, use: ['to-string-loader', 'css-loader', 'sass-loader'], include: /components\// },
|
||||
{ test: /\.css$/, use: ['to-string-loader', 'css-loader', 'sass-loader'] },
|
||||
{ test: /\.yaml$/, use: ['json-loader', 'yaml-loader'] },
|
||||
]
|
||||
},
|
||||
externals: [{
|
||||
'fs': true,
|
||||
'os': true,
|
||||
'path': true,
|
||||
'deepmerge': true,
|
||||
'untildify': true,
|
||||
'@angular/core': true,
|
||||
}]
|
||||
externals: [
|
||||
'electron',
|
||||
'fs',
|
||||
'os',
|
||||
'path',
|
||||
'deepmerge',
|
||||
'untildify',
|
||||
'js-yaml',
|
||||
/^rxjs/,
|
||||
/^@angular/,
|
||||
/^@ng-bootstrap/,
|
||||
]
|
||||
}
|
||||
|
1
terminus-settings/.gitignore
vendored
Normal file
1
terminus-settings/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
dist
|
36
terminus-settings/package.json
Normal file
36
terminus-settings/package.json
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "terminus-settings",
|
||||
"version": "0.0.1",
|
||||
"description": "Terminus terminal settings page",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "webpack --progress --color --display-modules",
|
||||
"watch": "webpack --progress --color --watch"
|
||||
},
|
||||
"author": "Eugene Pankov",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/deep-equal": "1.0.0",
|
||||
"@types/node": "7.0.12",
|
||||
"@types/webpack-env": "1.13.0",
|
||||
"awesome-typescript-loader": "3.1.2",
|
||||
"css-loader": "^0.28.0",
|
||||
"node-sass": "^4.5.2",
|
||||
"pug": "^2.0.0-beta3",
|
||||
"pug-loader": "^2.3.0",
|
||||
"raw-loader": "^0.5.1",
|
||||
"sass-loader": "^6.0.3",
|
||||
"to-string-loader": "^1.1.5",
|
||||
"webpack": "2.3.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/common": "4.0.1",
|
||||
"@angular/core": "4.0.1",
|
||||
"@angular/forms": "4.0.1",
|
||||
"@angular/platform-browser": "4.0.1",
|
||||
"@ng-bootstrap/ng-bootstrap": "1.0.0-alpha.22",
|
||||
"terminus-core": "*",
|
||||
"rxjs": "5.3.0"
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@angular/core'
|
||||
import { ToolbarButtonProvider, IToolbarButton, AppService } from 'api'
|
||||
import { ToolbarButtonProvider, IToolbarButton, AppService } from 'terminus-core'
|
||||
|
||||
import { SettingsTabComponent } from './components/settingsTab'
|
||||
|
||||
|
@ -4,7 +4,7 @@ import { Component, Input, trigger, style, animate, transition } from '@angular/
|
||||
@Component({
|
||||
selector: 'hotkey-display',
|
||||
template: require('./hotkeyDisplay.pug'),
|
||||
styles: [require('./hotkeyDisplay.less')],
|
||||
styles: [require('./hotkeyDisplay.scss')],
|
||||
//changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
animations: [
|
||||
trigger('animateKey', [
|
@ -1,5 +1,6 @@
|
||||
import { Component, Input, Output, EventEmitter, HostListener, ChangeDetectionStrategy } from '@angular/core'
|
||||
import { ModalService } from 'services/modal'
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
||||
|
||||
import { HotkeyInputModalComponent } from './hotkeyInputModal'
|
||||
|
||||
|
||||
@ -8,16 +9,16 @@ import { HotkeyInputModalComponent } from './hotkeyInputModal'
|
||||
template: `
|
||||
<hotkey-display [model]='model'></hotkey-display>
|
||||
`,
|
||||
styles: [require('./hotkeyInput.less')],
|
||||
styles: [require('./hotkeyInput.scss')],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class HotkeyInputComponent {
|
||||
constructor(
|
||||
private modal: ModalService,
|
||||
private ngbModal: NgbModal,
|
||||
) { }
|
||||
|
||||
@HostListener('click') public click() {
|
||||
this.modal.open(HotkeyInputModalComponent).result.then((value: string[]) => {
|
||||
this.ngbModal.open(HotkeyInputModalComponent).result.then((value: string[]) => {
|
||||
this.model = value
|
||||
this.modelChange.emit(this.model)
|
||||
})
|
@ -1,7 +1,7 @@
|
||||
import { Component, Input, trigger, transition, style, animate } from '@angular/core'
|
||||
import { HotkeysService } from 'services/hotkeys'
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
|
||||
import { Subscription } from 'rxjs'
|
||||
import { HotkeysService } from 'terminus-core'
|
||||
|
||||
const INPUT_TIMEOUT = 1000
|
||||
|
@ -1,8 +1,5 @@
|
||||
import { Component, Inject } from '@angular/core'
|
||||
import { ElectronService } from 'services/electron'
|
||||
import { ConfigService } from 'services/config'
|
||||
import { DockingService } from 'services/docking'
|
||||
import { IHotkeyDescription, HotkeyProvider, BaseTabComponent } from 'api'
|
||||
import { ElectronService, DockingService, ConfigService, IHotkeyDescription, HotkeyProvider, BaseTabComponent } from 'terminus-core'
|
||||
|
||||
import { SettingsTabProvider } from '../api'
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { Component, Input, ViewContainerRef, ViewChild, ComponentFactoryResolver, ComponentRef } from '@angular/core'
|
||||
import { SettingsTabProvider } from '../api'
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'settings-tab-body',
|
||||
template: '<ng-template #placeholder></ng-template>',
|
@ -2,6 +2,7 @@ import { NgModule } from '@angular/core'
|
||||
import { BrowserModule } from '@angular/platform-browser'
|
||||
import { FormsModule } from '@angular/forms'
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'
|
||||
import { ToolbarButtonProvider, TabRecoveryProvider } from 'terminus-core'
|
||||
|
||||
import { HotkeyInputComponent } from './components/hotkeyInput'
|
||||
import { HotkeyDisplayComponent } from './components/hotkeyDisplay'
|
||||
@ -10,8 +11,6 @@ import { MultiHotkeyInputComponent } from './components/multiHotkeyInput'
|
||||
import { SettingsTabComponent } from './components/settingsTab'
|
||||
import { SettingsTabBodyComponent } from './components/settingsTabBody'
|
||||
|
||||
import { ToolbarButtonProvider, TabRecoveryProvider } from 'api'
|
||||
|
||||
import { ButtonProvider } from './buttonProvider'
|
||||
import { RecoveryProvider } from './recoveryProvider'
|
||||
|
||||
@ -39,8 +38,7 @@ import { RecoveryProvider } from './recoveryProvider'
|
||||
SettingsTabBodyComponent,
|
||||
],
|
||||
})
|
||||
class SettingsModule {
|
||||
export default class SettingsModule {
|
||||
}
|
||||
|
||||
|
||||
export default SettingsModule
|
||||
export * from './api'
|
@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@angular/core'
|
||||
import { TabRecoveryProvider, AppService } from 'api'
|
||||
import { TabRecoveryProvider, AppService } from 'terminus-core'
|
||||
|
||||
import { SettingsTabComponent } from './components/settingsTab'
|
||||
|
||||
|
32
terminus-settings/tsconfig.json
Normal file
32
terminus-settings/tsconfig.json
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./src",
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"declaration": false,
|
||||
"noImplicitAny": false,
|
||||
"removeComments": false,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"sourceMap": true,
|
||||
"noUnusedParameters": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUnusedParameters": true,
|
||||
"noUnusedLocals": true,
|
||||
"declaration": true,
|
||||
"declarationDir": "dist",
|
||||
"lib": [
|
||||
"dom",
|
||||
"es2015",
|
||||
"es7"
|
||||
],
|
||||
"paths": {
|
||||
"*": ["../../app/node_modules/*"],
|
||||
"terminus-*": ["../../terminus-*"]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
}
|
36
terminus-settings/webpack.config.js
Normal file
36
terminus-settings/webpack.config.js
Normal file
@ -0,0 +1,36 @@
|
||||
module.exports = {
|
||||
target: 'node',
|
||||
entry: 'src/index.ts',
|
||||
devtool: 'source-map',
|
||||
output: {
|
||||
filename: './dist/index.js',
|
||||
pathinfo: true,
|
||||
libraryTarget: 'commonjs',
|
||||
devtoolModuleFilenameTemplate: 'webpack-terminus-settings:///[resource-path]',
|
||||
},
|
||||
resolve: {
|
||||
modules: ['.', 'node_modules', '../app/node_modules'],
|
||||
extensions: ['.ts', '.js'],
|
||||
},
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /\.ts$/, use: 'awesome-typescript-loader', exclude: [/node_modules/] },
|
||||
{ test: /schemes\/.*$/, use: "raw-loader" },
|
||||
{ test: /\.pug$/, use: ['apply-loader', 'pug-loader'] },
|
||||
{ test: /\.scss$/, use: ['to-string-loader', 'css-loader', 'sass-loader'] },
|
||||
{ test: /\.css$/, use: ['to-string-loader', 'css-loader', 'sass-loader'] },
|
||||
]
|
||||
},
|
||||
externals: [
|
||||
'fs',
|
||||
'fs-promise',
|
||||
'path',
|
||||
'node-pty',
|
||||
'child-process-promise',
|
||||
'fs-promise',
|
||||
/^rxjs/,
|
||||
/^@angular/,
|
||||
/^@ng-bootstrap/,
|
||||
/^terminus-/,
|
||||
]
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "webpack --progress --color",
|
||||
"build": "webpack --progress --color --display-modules",
|
||||
"watch": "webpack --progress --color --watch"
|
||||
},
|
||||
"author": "Eugene Pankov",
|
||||
@ -16,25 +16,30 @@
|
||||
"@types/webpack-env": "1.13.0",
|
||||
"awesome-typescript-loader": "3.1.2",
|
||||
"css-loader": "^0.28.0",
|
||||
"dataurl": "0.1.0",
|
||||
"deep-equal": "1.0.1",
|
||||
"pug": "^2.0.0-beta11",
|
||||
"pug-loader": "^2.3.0",
|
||||
"raw-loader": "^0.5.1",
|
||||
"sass-loader": "^6.0.3",
|
||||
"style-loader": "^0.16.1",
|
||||
"to-string-loader": "^1.1.5",
|
||||
"webpack": "2.3.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"peerDependencies": {
|
||||
"@angular/common": "4.0.1",
|
||||
"@angular/core": "4.0.1",
|
||||
"@angular/forms": "4.0.1",
|
||||
"@angular/platform-browser": "4.0.1",
|
||||
"@ng-bootstrap/ng-bootstrap": "1.0.0-alpha.22",
|
||||
"child-process-promise": "2.2.1",
|
||||
"dataurl": "0.1.0",
|
||||
"deep-equal": "1.0.1",
|
||||
"fs-promise": "2.0.2",
|
||||
"hterm-commonjs": "1.0.0",
|
||||
"node-pty": "0.6.2",
|
||||
"terminus-core": "*",
|
||||
"terminus-settings": "*",
|
||||
"rxjs": "5.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"child-process-promise": "2.2.1",
|
||||
"fs-promise": "2.0.2",
|
||||
"font-manager": "0.2.2",
|
||||
"hterm-commonjs": "1.0.0",
|
||||
"node-pty": "0.6.2"
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core'
|
||||
import { HotkeysService, ToolbarButtonProvider, IToolbarButton, AppService } from 'terminus-core'
|
||||
import { HotkeysService, ToolbarButtonProvider, IToolbarButton, AppService, HostAppService, Platform } from 'terminus-core'
|
||||
|
||||
import { SessionsService } from './services/sessions'
|
||||
import { TerminalTabComponent } from './components/terminalTab'
|
||||
@ -10,6 +10,7 @@ export class ButtonProvider extends ToolbarButtonProvider {
|
||||
constructor (
|
||||
private app: AppService,
|
||||
private sessions: SessionsService,
|
||||
private hostApp: HostAppService,
|
||||
hotkeys: HotkeysService,
|
||||
) {
|
||||
super()
|
||||
@ -25,9 +26,14 @@ export class ButtonProvider extends ToolbarButtonProvider {
|
||||
if (this.app.activeTab instanceof TerminalTabComponent) {
|
||||
cwd = await this.app.activeTab.session.getWorkingDirectory()
|
||||
}
|
||||
let command = {
|
||||
[Platform.macOS]: 'zsh',
|
||||
[Platform.Linux]: 'zsh',
|
||||
[Platform.Windows]: 'cmd.exe',
|
||||
}[this.hostApp.platform]
|
||||
this.app.openNewTab(
|
||||
TerminalTabComponent,
|
||||
{ session: await this.sessions.createNewSession({ command: 'zsh', cwd }) }
|
||||
{ session: await this.sessions.createNewSession({ command, cwd }) }
|
||||
)
|
||||
}
|
||||
|
@ -43,6 +43,12 @@
|
||||
span ->
|
||||
span([style.color]='config.full().terminal.colorScheme.colors[1]') link
|
||||
div
|
||||
span
|
||||
div
|
||||
span john@doe-pc
|
||||
span([style.color]='config.full().terminal.colorScheme.colors[1]') $
|
||||
span rm -rf /
|
||||
span([style.background-color]='config.full().terminal.colorScheme.cursor')
|
||||
|
||||
|
||||
.col-lg-6
|
||||
@ -85,7 +91,7 @@
|
||||
title='BG',
|
||||
)
|
||||
color-picker(
|
||||
'[(model)]'='config.store.terminal.cursor.background',
|
||||
'[(model)]'='config.store.terminal.colorScheme.cursor',
|
||||
(modelChange)='config.save()',
|
||||
title='CU',
|
||||
)
|
@ -3,8 +3,10 @@ import 'rxjs/add/operator/map'
|
||||
import 'rxjs/add/operator/debounceTime'
|
||||
import 'rxjs/add/operator/distinctUntilChanged'
|
||||
const equal = require('deep-equal')
|
||||
const fontManager = require('font-manager')
|
||||
|
||||
import { Component, Inject } from '@angular/core'
|
||||
import { ConfigService } from 'terminus-core'
|
||||
import { ConfigService, HostAppService, Platform } from 'terminus-core'
|
||||
const { exec } = require('child-process-promise')
|
||||
|
||||
import { TerminalColorSchemeProvider, ITerminalColorScheme } from '../api'
|
||||
@ -21,19 +23,26 @@ export class SettingsComponent {
|
||||
|
||||
constructor(
|
||||
public config: ConfigService,
|
||||
private hostApp: HostAppService,
|
||||
@Inject(TerminalColorSchemeProvider) private colorSchemeProviders: TerminalColorSchemeProvider[],
|
||||
) { }
|
||||
|
||||
async ngOnInit () {
|
||||
exec('fc-list :spacing=mono').then((result) => {
|
||||
this.fonts = result.stdout
|
||||
.split('\n')
|
||||
.filter((x) => !!x)
|
||||
.map((x) => x.split(':')[1].trim())
|
||||
.map((x) => x.split(',')[0].trim())
|
||||
if (this.hostApp.platform == Platform.Windows) {
|
||||
let fonts = await new Promise<any[]>((resolve) => fontManager.findFonts({ monospace: true }, resolve))
|
||||
this.fonts = fonts.map(x => x.family)
|
||||
this.fonts.sort()
|
||||
})
|
||||
|
||||
}
|
||||
if (this.hostApp.platform == Platform.Linux) {
|
||||
exec('fc-list :spacing=mono').then((result) => {
|
||||
this.fonts = result.stdout
|
||||
.split('\n')
|
||||
.filter(x => !!x)
|
||||
.map(x => x.split(':')[1].trim())
|
||||
.map(x => x.split(',')[0].trim())
|
||||
this.fonts.sort()
|
||||
})
|
||||
}
|
||||
this.colorSchemes = (await Promise.all(this.colorSchemeProviders.map(x => x.getSchemes()))).reduce((a, b) => a.concat(b))
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user