Compare commits

...

87 Commits

Author SHA1 Message Date
Eugene Pankov
1ae027f17c ci 2018-10-03 22:44:04 +01:00
Eugene
5360b2f292 Merge pull request #443 from vsailev/master
Restore Bash on Windows
2018-10-03 21:57:36 +01:00
vsailev
d806fb6e1e Restore Bash on Windows 2018-10-03 21:15:16 +01:00
Eugene Pankov
57de182013 Merge branch 'master' of github.com:Eugeny/terminus 2018-09-25 10:48:24 +02:00
Eugene Pankov
3fd57e81a6 install terminus into /usr/bin on Debian (fixes #433) 2018-09-25 10:48:00 +02:00
Eugene Pankov
eed01e76ad fixed cwd for new tabs on windows (fixes #378) 2018-09-23 09:25:49 -07:00
Eugene Pankov
7f8d012a8a shell context menu integration (fixes #362) 2018-09-23 09:23:20 -07:00
Eugene Pankov
9ad1371c2b theme fix 2018-09-23 09:11:42 -07:00
Eugene Pankov
0d37f4736a build fix 2018-09-23 17:09:11 +02:00
Eugene Pankov
e71d404c2b added CLI option to paste text into terminal 2018-09-23 16:33:57 +02:00
Eugene Pankov
0545471f3c added Automator workflows 2018-09-23 15:38:57 +02:00
Eugene Pankov
a04c60046e new light theme 2018-09-23 14:10:19 +02:00
Eugene Pankov
5c2003cc2f added a portable build 2018-09-22 13:14:51 +02:00
Eugene Pankov
dc864781e4 fixed focus detection (fixes #185) 2018-09-22 12:27:34 +02:00
Eugene Pankov
e315654d0a build fix 2018-09-22 12:19:14 +02:00
Eugene Pankov
5863ea0de1 fixed exiting fullscreen with vibrancy (fixes #407) 2018-09-22 12:03:43 +02:00
Eugene Pankov
cce49c69d6 bumps 2018-09-22 12:00:58 +02:00
Eugene Pankov
3e41d0df4e yarn 2018-09-22 11:48:57 +02:00
Eugene Pankov
507b69acb4 sensible shell defaults for Windows (fixes #431) 2018-09-22 11:48:51 +02:00
Eugene Pankov
6b08341760 support multiple WSL distributions 2018-09-22 11:37:37 +02:00
Eugene Pankov
62bf681598 fixed visual bell (fixes #419) 2018-09-20 13:04:50 +02:00
Eugene Pankov
e403a423b7 window management fixes (fixes #426) 2018-09-20 13:02:07 +02:00
Eugene Pankov
6b49cdc974 properly pass cwd from a second instance 2018-09-20 13:01:42 +02:00
Eugene Pankov
5fe71b8169 hide menu on Linux and Windows 2018-09-20 13:01:25 +02:00
Eugene Pankov
6bc2d18f3c faster tab creation 2018-09-20 12:46:50 +02:00
Eugene Pankov
6fa5ab5eb2 scroll terminal to bottom on user input 2018-09-20 12:12:57 +02:00
Eugene Pankov
2411713501 include proper tags in github issues 2018-09-20 12:12:45 +02:00
Eugene Pankov
947e0f8b66 theme tweaks 2018-09-20 12:12:38 +02:00
Eugene Pankov
f8bc94fe78 theme tweak 2018-09-20 11:55:23 +02:00
Eugene Pankov
5a32a45b19 theme tweaks 2018-09-20 11:46:47 +02:00
Eugene Pankov
62222e67fb lint 2018-09-20 11:46:24 +02:00
Eugene Pankov
6aab782326 removed window close menu on macos 2018-09-20 11:46:17 +02:00
Eugene Pankov
cec349d021 faster tab switching 2018-09-20 11:42:51 +02:00
Eugene
c8b40647a9 Update README.md 2018-09-20 10:56:31 +02:00
Eugene
67ed830e97 Merge pull request #421 from vsailev/master
Update clink to v0.4.9
2018-09-16 06:16:11 -07:00
vsailev
975d4d62ef Update clink to v0.4.9 2018-09-16 11:05:40 +01:00
Eugene
275791517b Merge pull request #418 from BBJip/master
Save window state on close.
2018-09-12 22:43:55 -07:00
BBJip
9db452f489 save window state on close. 2018-09-13 01:25:08 +02:00
Eugene
5094262e68 Merge pull request #416 from Domain/master
Biding scripts
2018-09-12 05:07:56 -07:00
Domain
17cf0f59c9 Biding scripts 2018-09-12 20:05:45 +08:00
Eugene
aa805b912b Merge pull request #415 from Domain/master
Add keep alive in advanced setting
2018-09-12 05:01:38 -07:00
Domain
4b3cbc5639 Add keep alive in advanced setting 2018-09-12 10:40:58 +08:00
Eugene Pankov
6a59db1a36 build fix 2018-09-11 14:44:11 -07:00
Eugene Pankov
2d43e29bcd bumped hterm 2018-09-11 14:44:04 -07:00
Eugene Pankov
bf5e460bca autodetect powershell core path (fixes #382) 2018-09-11 13:52:33 -07:00
Eugene Pankov
d574f634c9 bumped plugin versions 2018-09-11 13:37:14 -07:00
Eugene Pankov
4ceb8ff897 theme fix 2018-09-10 17:40:57 +02:00
Eugene Pankov
0f8c27e536 fixed #403 2018-09-10 17:40:52 +02:00
Eugene Pankov
d6fb71dca2 fixed autofocus in input fields (fixes #374) 2018-09-10 17:23:36 +02:00
Eugene Pankov
38e450f70a Merge branch 'master' of github.com:Eugeny/terminus 2018-09-06 15:39:57 +02:00
Eugene Pankov
18c0a585a2 bumped electron (potentially fixes #408) 2018-09-06 15:39:35 +02:00
Domain
8a1c33b82a wrong URL (#412) 2018-09-05 11:57:20 +02:00
Domain
f81bda1686 Only MacOS support app.dock (#410) 2018-09-05 10:24:15 +02:00
Eugene Pankov
c285b89b6c fixed #297 2018-09-04 23:14:10 +02:00
Eugene Pankov
6dc46bb970 lint 2018-09-04 22:49:22 +02:00
Eugene Pankov
7d25816751 more cleanup 2018-09-04 22:49:12 +02:00
Eugene Pankov
d6f163b048 cleaned up #409 and renamed to Groups 2018-09-04 22:39:00 +02:00
Domain
f357dab8f0 style 2018-09-04 16:39:52 +08:00
Domain
0eaf857b02 Organize the connections in folders.
Filter connections in quick connect.
Need more custom CSS to handle long connection list.
See also #403
2018-09-04 16:36:01 +08:00
Domain
f367ea6c74 Merge branch 'master' of https://github.com/Eugeny/terminus 2018-09-04 16:28:20 +08:00
Eugene Pankov
dc4b984ed0 . 2018-08-31 16:57:10 +02:00
Eugene Pankov
4b7b692ace experimental support for multiple windows (fixes #212, fixes #170) 2018-08-31 15:41:28 +02:00
Eugene Pankov
0749096d9f smarter progress detection (fixes #406) 2018-08-31 12:41:58 +02:00
Domain
5b76947d70 Add login scripts support (#402)
* Support login scripts. Fix #344

* nowrap

* Follow the general Terminus style
2018-08-29 11:15:00 +02:00
Domain
98a7801803 Follow the general Terminus style 2018-08-29 17:02:02 +08:00
Domain
ce2c72393b nowrap 2018-08-29 12:09:55 +08:00
Domain
2ea2c02845 Support login scripts. Fix #344 2018-08-29 12:09:54 +08:00
Eugene
4b1ba7863f Update package.json 2018-08-27 09:40:43 +02:00
Eugene Pankov
2e558e2aa2 added config file editor 2018-08-26 22:27:50 +02:00
Eugene Pankov
a98f2ce12d bumped bootstrap 2018-08-26 21:03:49 +02:00
Eugene Pankov
046ef239db bumped travis node version 2018-08-26 19:29:40 +02:00
Eugene Pankov
6cc20c3719 allow starting commands in new tabs via CLI (fixes #304) 2018-08-26 17:35:04 +02:00
Eugene Pankov
3f8f87a141 added github stale issues bot 2018-08-26 13:40:26 +02:00
Eugene Pankov
5f337e6dbe Merge branch 'xterm' 2018-08-26 13:24:28 +02:00
Eugene Pankov
7af14c5699 naming 2018-08-26 13:23:57 +02:00
Eugene Pankov
d3a5c7be8d xterm frontend 2018-08-26 13:15:00 +02:00
Eugene Pankov
8aff33d59c remember CSI color overrides (fixes #59) 2018-08-25 10:45:45 +02:00
Eugene Pankov
7f45bb57fc nicer touch bar buttons 2018-08-25 10:11:32 +02:00
Eugene Pankov
06d14f9bb2 settings redesign 2018-08-25 09:37:56 +02:00
Eugene Pankov
64f670bd86 report progress from the console commands in tab headers and taskbar 2018-08-25 00:22:43 +02:00
Eugene Pankov
c9dde2e29c ui fixes 2018-08-24 23:48:25 +02:00
Eugene Pankov
46d8533fee startup time speedup 2018-08-24 23:48:20 +02:00
Eugene Pankov
627d7402ca fixed line breaks when pasting on Windows (fixes #396) 2018-08-24 23:48:02 +02:00
Eugene Pankov
a10c6e6251 enable transparency when vibrancy is enabled on Windows 2018-08-24 23:16:09 +02:00
Eugene Pankov
594597e93d yarn.lock 2018-08-24 22:46:20 +02:00
Eugene Pankov
2dded5ddb6 theme fix 2018-08-23 16:12:11 +02:00
Eugene Pankov
c4415577fa fixed #399 2018-08-23 16:06:00 +02:00
149 changed files with 5075 additions and 1396 deletions

55
.eslintrc.yml Normal file
View File

@@ -0,0 +1,55 @@
parser: babel-eslint
extends: standard
env:
node: true
commonjs: true
rules:
no-duplicate-imports: error
import/no-duplicates: 0
array-bracket-spacing:
- error
- never
block-scoped-var: error
brace-style:
- error
- 1tbs
computed-property-spacing:
- error
- never
comma-dangle:
- error
- always-multiline
curly: error
eol-last: error
eqeqeq:
- error
- smart
max-depth:
- 1
- 5
max-statements:
- 1
- 80
no-multiple-empty-lines: error
no-mixed-spaces-and-tabs: error
no-trailing-spaces: error
no-unused-vars:
- error
- vars: all
args: after-used
argsIgnorePattern: ^_
no-undef: error
no-use-before-define:
- error
- nofunc
no-var: error
object-curly-spacing:
- error
- always
quote-props:
- warn
- as-needed
- keywords: true
numbers: true
strict:
- error

18
.github/stale.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 14
# Issues with these labels will never be considered stale
exemptLabels:
- "T: Enhancement"
- "S: Triaged"
# Label to use when marking an issue as stale
staleLabel: "S: Stale"
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed in two weeks unless you comment.
Thank you for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

View File

@@ -6,7 +6,7 @@ matrix:
env: BUILD_FOR=macos
language: node_js
node_js: 7
node_js: 8
cache:
directories:

View File

@@ -26,8 +26,9 @@ Plugins can be installed directly from the Settings view inside Terminus.
* [clickable-links](https://github.com/Eugeny/terminus-clickable-links) - makes paths and URLs in the terminal clickable
* [theme-hype](https://github.com/Eugeny/terminus-theme-hype) - a Hyper inspired theme
* [shell-selector](https://github.com/Eugeny/terminus-shell-selector) - a quick shell selector pane
* [title-control](https://github.com/kbjr/terminus-scrollbar) - allows modifying the title of the terminal tabs by providing a prefix, suffix, and/or strings to be removed
* [title-control](https://github.com/kbjr/terminus-title-control) - allows modifying the title of the terminal tabs by providing a prefix, suffix, and/or strings to be removed
* [scrollbar](https://github.com/kbjr/terminus-scrollbar) - adds a scrollbar to terminal tabs
* [quick-cmds](https://github.com/Domain/terminus-quick-cmds) - quicklky send commands to one or all terminal tabs
---

172
app/lib/app.ts Normal file
View File

@@ -0,0 +1,172 @@
import { app, ipcMain, Menu, Tray, shell } from 'electron'
import { Window } from './window'
export class Application {
private tray: Tray
private windows: Window[] = []
constructor () {
ipcMain.on('app:config-change', () => {
this.broadcast('host:config-change')
})
}
async newWindow (): Promise<Window> {
let window = new Window()
this.windows.push(window)
window.visible$.subscribe(visible => {
if (visible) {
this.disableTray()
} else {
this.enableTray()
}
})
if (process.platform === 'darwin') {
this.setupMenu()
}
await window.ready
return window
}
broadcast (event, ...args) {
for (let window of this.windows) {
window.send(event, ...args)
}
}
async send (event, ...args) {
if (!this.hasWindows()) {
await this.newWindow()
}
this.windows[0].send(event, ...args)
}
enableTray () {
if (this.tray) {
return
}
if (process.platform === 'darwin') {
this.tray = new Tray(`${app.getAppPath()}/assets/tray-darwinTemplate.png`)
this.tray.setPressedImage(`${app.getAppPath()}/assets/tray-darwinHighlightTemplate.png`)
} else {
this.tray = new Tray(`${app.getAppPath()}/assets/tray.png`)
}
this.tray.on('click', () => this.focus())
const contextMenu = Menu.buildFromTemplate([{
label: 'Show',
click: () => this.focus(),
}])
if (process.platform !== 'darwin') {
this.tray.setContextMenu(contextMenu)
}
this.tray.setToolTip(`Terminus ${app.getVersion()}`)
}
disableTray () {
if (this.tray) {
this.tray.destroy()
this.tray = null
}
}
hasWindows () {
return !!this.windows.length
}
focus () {
for (let window of this.windows) {
window.show()
window.focus()
}
}
private setupMenu () {
let template: Electron.MenuItemConstructorOptions[] = [
{
label: 'Application',
submenu: [
{ role: 'about', label: 'About Terminus' },
{ type: 'separator' },
{
label: 'Preferences',
accelerator: 'Cmd+,',
async click () {
if (!this.hasWindows()) {
await this.newWindow()
}
this.windows[0].send('host:preferences-menu')
},
},
{ type: 'separator' },
{ role: 'services', submenu: [] },
{ type: 'separator' },
{ role: 'hide' },
{ role: 'hideothers' },
{ role: 'unhide' },
{ type: 'separator' },
{
label: 'Quit',
accelerator: 'Cmd+Q',
click () {
app.quit()
},
},
],
},
{
label: 'Edit',
submenu: [
{ role: 'undo' },
{ role: 'redo' },
{ type: 'separator' },
{ role: 'cut' },
{ role: 'copy' },
{ role: 'paste' },
{ role: 'pasteandmatchstyle' },
{ role: 'delete' },
{ role: 'selectall' },
],
},
{
label: 'View',
submenu: [
{ role: 'reload' },
{ role: 'forcereload' },
{ role: 'toggledevtools' },
{ type: 'separator' },
{ role: 'resetzoom' },
{ role: 'zoomin' },
{ role: 'zoomout' },
{ type: 'separator' },
{ role: 'togglefullscreen' },
],
},
{
role: 'window',
submenu: [
{ role: 'minimize' },
{ role: 'zoom' },
{ type: 'separator' },
{ role: 'front' },
],
},
{
role: 'help',
submenu: [
{
label: 'Website',
click () {
shell.openExternal('https://eugeny.github.io/terminus')
},
},
],
}
]
Menu.setApplicationMenu(Menu.buildFromTemplate(template))
}
}

39
app/lib/cli.ts Normal file
View File

@@ -0,0 +1,39 @@
import { app } from 'electron'
export function parseArgs (argv, cwd) {
if (argv[0].includes('node')) {
argv = argv.slice(1)
}
return require('yargs')
.usage('terminus [command] [arguments]')
.command('open [directory]', 'open a shell in a directory', {
directory: { type: 'string', 'default': cwd },
})
.command('run [command...]', 'run a command in the terminal', {
command: { type: 'string' },
})
.command('paste [text]', 'paste stdin into the active tab', yargs => {
return yargs.option('escape', {
alias: 'e',
type: 'boolean',
describe: 'Perform shell escaping'
}).positional('text', {
type: 'string'
})
})
.version('version', '', app.getVersion())
.option('debug', {
alias: 'd',
describe: 'Show DevTools on start',
type: 'boolean'
})
.option('version', {
alias: 'v',
describe: 'Show version and exit',
type: 'boolean'
})
.help('help')
.strict()
.parse(argv.slice(1))
}

65
app/lib/index.ts Normal file
View File

@@ -0,0 +1,65 @@
import './lru'
import { app, ipcMain, Menu } from 'electron'
import electronDebug = require('electron-debug')
import { parseArgs } from './cli'
import { Application } from './app'
if (process.platform === 'win32' && require('electron-squirrel-startup')) process.exit(0)
if (!process.env.TERMINUS_PLUGINS) {
process.env.TERMINUS_PLUGINS = ''
}
const application = new Application()
app.commandLine.appendSwitch('disable-http-cache')
ipcMain.on('app:new-window', () => {
console.log('new-window')
application.newWindow()
})
app.on('activate', () => {
if (!application.hasWindows()) {
application.newWindow()
} else {
application.focus()
}
})
app.on('window-all-closed', () => {
app.quit()
})
process.on('uncaughtException' as any, err => {
console.log(err)
application.broadcast('uncaughtException', err)
})
app.on('second-instance', (_event, argv, cwd) => {
application.send('host:second-instance', parseArgs(argv, cwd), cwd)
})
const argv = parseArgs(process.argv, process.cwd())
if (!app.requestSingleInstanceLock()) {
app.quit()
process.exit(0)
}
if (argv.d) {
electronDebug({ enabled: true, showDevTools: 'undocked' })
}
app.on('ready', () => {
if (process.platform === 'darwin') {
app.dock.setMenu(Menu.buildFromTemplate([
{
label: 'New window',
click () {
this.app.newWindow()
}
}
]))
}
application.newWindow()
})

15
app/lib/lru.ts Normal file
View File

@@ -0,0 +1,15 @@
let lru = require('lru-cache')({ max: 256, maxAge: 250 })
let fs = require('fs')
let origLstat = fs.realpathSync.bind(fs)
// NB: The biggest offender of thrashing realpathSync is the node module system
// itself, which we can't get into via any sane means.
require('fs').realpathSync = function (p) {
let r = lru.get(p)
if (r) return r
r = origLstat(p)
lru.set(p, r)
return r
}

201
app/lib/window.ts Normal file
View File

@@ -0,0 +1,201 @@
import { Subject, Observable } from 'rxjs'
import { BrowserWindow, app, ipcMain, Rectangle, Menu } from 'electron'
import ElectronConfig = require('electron-config')
import * as yaml from 'js-yaml'
import * as fs from 'fs'
import * as path from 'path'
let electronVibrancy: any
if (process.platform !== 'linux') {
electronVibrancy = require('electron-vibrancy')
}
export class Window {
ready: Promise<void>
private visible = new Subject<boolean>()
private window: BrowserWindow
private vibrancyViewID: number
private windowConfig: ElectronConfig
private windowBounds: Rectangle
get visible$ (): Observable<boolean> { return this.visible }
constructor () {
let configPath = path.join(app.getPath('userData'), 'config.yaml')
let configData
if (fs.existsSync(configPath)) {
configData = yaml.safeLoad(fs.readFileSync(configPath, 'utf8'))
} else {
configData = {}
}
this.windowConfig = new ElectronConfig({ name: 'window' })
this.windowBounds = this.windowConfig.get('windowBoundaries')
let maximized = this.windowConfig.get('maximized')
let options: Electron.BrowserWindowConstructorOptions = {
width: 800,
height: 600,
title: 'Terminus',
minWidth: 400,
minHeight: 300,
webPreferences: { webSecurity: false },
frame: false,
show: false,
}
Object.assign(options, this.windowBounds)
if ((configData.appearance || {}).frame === 'native') {
options.frame = true
} else {
if (process.platform === 'darwin') {
options.titleBarStyle = 'hiddenInset'
}
}
if (process.platform === 'win32' && (configData.appearance || {}).vibrancy) {
options.transparent = true
}
if (process.platform === 'linux') {
options.backgroundColor = '#131d27'
}
this.window = new BrowserWindow(options)
this.window.once('ready-to-show', () => {
if (process.platform === 'darwin') {
this.window.setVibrancy('dark')
} else if (process.platform === 'win32' && (configData.appearance || {}).vibrancy) {
this.setVibrancy(true)
}
if (maximized) {
this.window.maximize()
} else {
this.window.show()
}
this.window.focus()
})
this.window.loadURL(`file://${app.getAppPath()}/dist/index.html?${this.window.id}`, { extraHeaders: 'pragma: no-cache\n' })
if (process.platform !== 'darwin') {
this.window.setMenu(null)
}
this.setupWindowManagement()
this.ready = new Promise(resolve => {
const listener = event => {
if (event.sender === this.window.webContents) {
ipcMain.removeListener('app:ready', listener)
resolve()
}
}
ipcMain.on('app:ready', listener)
})
}
setVibrancy (enabled: boolean) {
if (enabled && !this.vibrancyViewID) {
this.vibrancyViewID = electronVibrancy.SetVibrancy(this.window, 0)
} else if (!enabled && this.vibrancyViewID) {
electronVibrancy.RemoveView(this.window, this.vibrancyViewID)
this.vibrancyViewID = null
}
}
show () {
this.window.show()
}
focus () {
this.window.focus()
}
send (event, ...args) {
this.window.webContents.send(event, ...args)
}
private setupWindowManagement () {
this.window.on('show', () => {
this.visible.next(true)
this.window.webContents.send('host:window-shown')
})
this.window.on('hide', () => {
this.visible.next(false)
})
this.window.on('enter-full-screen', () => this.window.webContents.send('host:window-enter-full-screen'))
this.window.on('leave-full-screen', () => this.window.webContents.send('host:window-leave-full-screen'))
this.window.on('close', () => {
this.windowConfig.set('windowBoundaries', this.windowBounds)
this.windowConfig.set('maximized', this.window.isMaximized())
})
this.window.on('closed', () => {
this.destroy()
})
this.window.on('resize', () => {
if (!this.window.isMaximized()) {
this.windowBounds = this.window.getBounds()
}
})
this.window.on('move', () => {
if (!this.window.isMaximized()) {
this.windowBounds = this.window.getBounds()
}
})
ipcMain.on('window-focus', () => {
this.window.focus()
})
ipcMain.on('window-maximize', () => {
this.window.maximize()
})
ipcMain.on('window-unmaximize', () => {
this.window.unmaximize()
})
ipcMain.on('window-toggle-maximize', () => {
if (this.window.isMaximized()) {
this.window.unmaximize()
} else {
this.window.maximize()
}
})
ipcMain.on('window-minimize', () => {
this.window.minimize()
})
ipcMain.on('window-set-bounds', (_event, bounds) => {
this.window.setBounds(bounds)
})
ipcMain.on('window-set-always-on-top', (_event, flag) => {
this.window.setAlwaysOnTop(flag)
})
ipcMain.on('window-set-vibrancy', (_event, enabled) => {
this.setVibrancy(enabled)
})
ipcMain.on('window-set-title', (_event, title) => {
this.window.setTitle(title)
})
ipcMain.on('window-popup-context-menu', (_event, menuDefinition) => {
Menu.buildFromTemplate(menuDefinition).popup({ window: this.window })
})
}
private destroy () {
this.window = null
this.visible.complete()
}
}

View File

@@ -1,312 +0,0 @@
if (process.platform == 'win32' && require('electron-squirrel-startup')) process.exit(0)
const electron = require('electron')
let electronVibrancy
if (process.platform != 'linux') {
electronVibrancy = require('electron-vibrancy')
}
let app = electron.app
const yaml = require('js-yaml')
const path = require('path')
const fs = require('fs')
const Config = require('electron-config')
let windowConfig = new Config({name: 'window'})
if (!process.env.TERMINUS_PLUGINS) {
process.env.TERMINUS_PLUGINS = ''
}
setWindowVibrancy = (enabled) => {
if (enabled && !app.window.vibrancyViewID) {
app.window.vibrancyViewID = electronVibrancy.SetVibrancy(app.window, 0)
} else if (!enabled && app.window.vibrancyViewID) {
electronVibrancy.RemoveView(app.window, app.window.vibrancyViewID)
app.window.vibrancyViewID = null
}
}
setupWindowManagement = () => {
app.window.on('show', () => {
app.window.webContents.send('host:window-shown')
if (app.tray) {
app.tray.destroy()
app.tray = null
}
})
app.window.on('hide', (e) => {
if (!app.tray) {
setupTray()
}
})
app.window.on('enter-full-screen', () => app.window.webContents.send('host:window-enter-full-screen'))
app.window.on('leave-full-screen', () => app.window.webContents.send('host:window-leave-full-screen'))
app.window.on('close', (e) => {
windowConfig.set('windowBoundaries', app.window.getBounds())
})
app.window.on('closed', () => {
app.window = null
})
electron.ipcMain.on('window-focus', () => {
app.window.focus()
})
electron.ipcMain.on('window-maximize', () => {
app.window.maximize()
})
electron.ipcMain.on('window-unmaximize', () => {
app.window.unmaximize()
})
electron.ipcMain.on('window-toggle-maximize', () => {
if (app.window.isMaximized()) {
app.window.unmaximize()
} else {
app.window.maximize()
}
})
electron.ipcMain.on('window-minimize', () => {
app.window.minimize()
})
electron.ipcMain.on('window-set-bounds', (event, bounds) => {
app.window.setBounds(bounds)
})
electron.ipcMain.on('window-set-always-on-top', (event, flag) => {
app.window.setAlwaysOnTop(flag)
})
electron.ipcMain.on('window-set-vibrancy', (event, enabled) => {
setWindowVibrancy(enabled)
})
}
setupTray = () => {
if (process.platform == 'darwin') {
app.tray = new electron.Tray(`${app.getAppPath()}/assets/tray-darwinTemplate.png`)
app.tray.setPressedImage(`${app.getAppPath()}/assets/tray-darwinHighlightTemplate.png`)
} else {
app.tray = new electron.Tray(`${app.getAppPath()}/assets/tray.png`)
}
app.tray.on('click', () => {
app.window.show()
app.window.focus()
})
const contextMenu = electron.Menu.buildFromTemplate([{
label: 'Show',
click () {
app.window.show()
app.window.focus()
}
}])
if (process.platform != 'darwin') {
app.tray.setContextMenu(contextMenu)
}
app.tray.setToolTip(`Terminus ${app.getVersion()}`)
}
setupMenu = () => {
let template = [{
label: "Application",
submenu: [
{ role: 'about', label: 'About Terminus' },
{ type: 'separator' },
{
label: 'Preferences',
accelerator: 'Cmd+,',
click () {
app.window.webContents.send('host:preferences-menu')
}
},
{ type: 'separator' },
{ role: 'services', submenu: [] },
{ type: 'separator' },
{ role: 'hide' },
{ role: 'hideothers' },
{ role: 'unhide' },
{ type: 'separator' },
{
label: 'Quit',
accelerator: 'Cmd+Q',
click () {
app.quit()
}
}
]
},
{
label: "Edit",
submenu: [
{role: 'undo'},
{role: 'redo'},
{type: 'separator'},
{role: 'cut'},
{role: 'copy'},
{role: 'paste'},
{role: 'pasteandmatchstyle'},
{role: 'delete'},
{role: 'selectall'}
]
},
{
label: 'View',
submenu: [
{role: 'reload'},
{role: 'forcereload'},
{role: 'toggledevtools'},
{type: 'separator'},
{role: 'resetzoom'},
{role: 'zoomin'},
{role: 'zoomout'},
{type: 'separator'},
{role: 'togglefullscreen'}
]
},
{
role: 'window',
submenu: [
{role: 'minimize'},
{role: 'zoom'},
{type: 'separator'},
{role: 'front'}
]
},
{
role: 'help',
submenu: [
{
label: 'Website',
click () { electron.shell.openExternal('https://eugeny.github.io/terminus') }
}
]
}]
electron.Menu.setApplicationMenu(electron.Menu.buildFromTemplate(template))
}
start = () => {
let t0 = Date.now()
let configPath = path.join(electron.app.getPath('userData'), 'config.yaml')
let configData
if (fs.existsSync(configPath)) {
configData = yaml.safeLoad(fs.readFileSync(configPath, 'utf8'))
} else {
configData = {}
}
let options = {
width: 800,
height: 600,
title: 'Terminus',
minWidth: 400,
minHeight: 300,
webPreferences: {webSecurity: false},
frame: false,
show: false,
}
Object.assign(options, windowConfig.get('windowBoundaries'))
if ((configData.appearance || {}).frame == 'native') {
options.frame = true
} else {
if (process.platform == 'darwin') {
options.titleBarStyle = 'hiddenInset'
}
}
if (process.platform == 'linux') {
options.backgroundColor = '#131d27'
}
app.commandLine.appendSwitch('disable-http-cache')
app.window = new electron.BrowserWindow(options)
app.window.once('ready-to-show', () => {
if (process.platform == 'darwin') {
app.window.setVibrancy('dark')
} else if (process.platform == 'windows') {
setWindowVibrancy(true)
}
app.window.show()
app.window.focus()
})
app.window.loadURL(`file://${app.getAppPath()}/dist/index.html`, {extraHeaders: "pragma: no-cache\n"})
if (process.platform != 'darwin') {
app.window.setMenu(null)
}
setupWindowManagement()
if (process.platform == 'darwin') {
setupMenu()
} else {
app.window.setMenu(null)
}
console.info(`Host startup: ${Date.now() - t0}ms`)
t0 = Date.now()
electron.ipcMain.on('app:ready', () => {
console.info(`App startup: ${Date.now() - t0}ms`)
})
}
app.on('activate', () => {
if (!app.window)
start()
else {
app.window.show()
app.window.focus()
}
})
process.on('uncaughtException', function(err) {
console.log(err)
app.window.webContents.send('uncaughtException', err)
})
const argv = require('yargs')
.usage('terminus [command] [arguments]')
.version('v', 'Show version and exit', app.getVersion())
.alias('d', 'debug')
.describe('d', 'Show DevTools on start')
.alias('h', 'help')
.help('h')
.strict()
.argv
app.on('second-instance', (argv, cwd) => {
app.window.webContents.send('host:second-instance', argv, cwd)
})
if (!app.requestSingleInstanceLock()) {
app.quit()
process.exit(0)
}
if (argv.d) {
require('electron-debug')({enabled: true, showDevTools: 'undocked'})
}
app.on('ready', start)

View File

@@ -5,7 +5,7 @@
"name": "Eugene Pankov",
"email": "e@ajenti.org"
},
"main": "main.js",
"main": "dist/main.js",
"version": "1.0.0-alpha.1",
"scripts": {
"build": "webpack --progress --color --display-modules",
@@ -22,7 +22,7 @@
"@ng-bootstrap/ng-bootstrap": "^2.0.0",
"devtron": "1.4.0",
"electron-config": "0.2.1",
"electron-debug": "^1.0.1",
"electron-debug": "^2.0.0",
"electron-is-dev": "0.1.2",
"electron-squirrel-startup": "^1.0.0",
"electron-vibrancy": "^0.1.3",

View File

@@ -1,3 +1,4 @@
import '../lib/lru'
import 'source-sans-pro'
import 'font-awesome/css/font-awesome.css'
import 'ngx-toastr/toastr.css'
@@ -28,8 +29,8 @@ Raven.config(
}
)
process.on('uncaughtException', (err) => {
Raven.captureException(err)
process.on('uncaughtException' as any, (err) => {
Raven.captureException(err as any)
console.error(err)
})

View File

@@ -2,6 +2,8 @@ import 'zone.js'
import 'core-js/es7/reflect'
import 'core-js/core/delay'
import 'rxjs'
import './global.scss'
import './toastr.scss'
// Always land on the start view

91
app/src/global.scss Normal file
View File

@@ -0,0 +1,91 @@
body {
min-height: 100vh;
overflow: hidden;
background: #1D272D;
}
.modal-dialog, .modal-backdrop, .no-drag {
-webkit-app-region: no-drag;
}
.selectable {
user-select: text;
}
[ngbradiogroup] input[type="radio"] {
display: none;
}
.form-line {
display: flex;
border-top: 1px solid rgba(0, 0, 0, 0.2);
align-items: center;
padding: 10px 0;
margin: 0;
min-height: 64px;
.header {
margin-right: auto;
.title {
}
.description {
font-size: 13px;
opacity: .5;
}
}
&>.form-control, &>.input-group {
width: 33%;
}
}
input[type=range] {
-webkit-appearance: none;
background: transparent;
outline: none;
padding: 0;
&:focus {
border-color: transparent;
}
@mixin thumb() {
-webkit-appearance: none;
display: block;
height: 12px;
width: 12px;
background: #aaa;
border-radius: 6px;
cursor: pointer;
margin-top: -4px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
transition: 0.25s background;
&:hover {
background: #777;
}
&:active {
background: #666;
}
}
&::-webkit-slider-thumb { @include thumb(); }
&::-moz-range-thumb { @include thumb(); }
&::-ms-thumb { @include thumb(); }
&::thumb { @include thumb(); }
@mixin track() {
height: 4px;
background: #111;
margin: 3px 0 0;
box-sizing: border-box;
}
&::-webkit-slider-runnable-track { @include track(); }
&:focus::-webkit-slider-runnable-track { @include track(); }
&::-moz-range-track { @include track(); }
&::-ms-track { @include track(); }
}

View File

@@ -58,17 +58,3 @@
color: #842fe0;
}
}
.modal-dialog, .modal-backdrop {
-webkit-app-region: no-drag;
}
[ngbradiogroup] input[type="radio"] {
display: none;
}
body {
min-height: 100vh;
overflow: hidden;
background: rgba(0,0,0,.4);
}

View File

@@ -17,7 +17,7 @@
"lib": [
"dom",
"es2015",
"es2015.iterable.ts",
"es2015.iterable",
"es2017",
"es7"
]

31
app/tsconfig.main.json Normal file
View File

@@ -0,0 +1,31 @@
{
"compilerOptions": {
"baseUrl": "./lib",
"module": "commonjs",
"target": "es2017",
"declaration": false,
"noImplicitAny": false,
"removeComments": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUnusedParameters": true,
"noUnusedLocals": true,
"lib": [
"dom",
"es2015",
"es2015.iterable",
"es2017",
"es7"
]
},
"compileOnSave": false,
"exclude": [
"dist",
"node_modules",
"*/node_modules"
]
}

View File

@@ -6,15 +6,16 @@ module.exports = {
target: 'node',
entry: {
'index.ignore': 'file-loader?name=index.html!val-loader!pug-html-loader!' + path.resolve(__dirname, './index.pug'),
'preload': path.resolve(__dirname, 'src/entry.preload.ts'),
'bundle': path.resolve(__dirname, 'src/entry.ts'),
preload: path.resolve(__dirname, 'src/entry.preload.ts'),
bundle: path.resolve(__dirname, 'src/entry.ts'),
},
mode: process.env.DEV ? 'development' : 'production',
context: __dirname,
devtool: 'source-map',
output: {
path: path.join(__dirname, 'dist'),
pathinfo: true,
filename: '[name].js'
filename: '[name].js',
},
resolve: {
modules: ['src/', 'node_modules', '../node_modules', 'assets/'].map(x => path.join(__dirname, x)),
@@ -28,8 +29,8 @@ module.exports = {
loader: 'awesome-typescript-loader',
options: {
configFileName: path.resolve(__dirname, 'tsconfig.json'),
}
}
},
},
},
{ test: /\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader'] },
{ test: /\.css$/, use: ['style-loader', 'css-loader', 'sass-loader'] },
@@ -38,20 +39,20 @@ module.exports = {
use: {
loader: 'file-loader',
options: {
name: 'images/[name].[ext]'
}
}
name: 'images/[name].[ext]',
},
},
},
{
test: /\.(ttf|eot|otf|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: {
loader: 'file-loader',
options: {
name: 'fonts/[name].[ext]'
}
}
}
]
name: 'fonts/[name].[ext]',
},
},
},
],
},
externals: {
'@angular/core': 'commonjs @angular/core',
@@ -61,14 +62,15 @@ module.exports = {
'@angular/forms': 'commonjs @angular/forms',
'@angular/common': 'commonjs @angular/common',
'@ng-bootstrap/ng-bootstrap': 'commonjs @ng-bootstrap/ng-bootstrap',
'child_process': 'commonjs child_process',
'electron': 'commonjs electron',
child_process: 'commonjs child_process',
electron: 'commonjs electron',
'electron-is-dev': 'commonjs electron-is-dev',
fs: 'commonjs fs',
'ngx-toastr': 'commonjs ngx-toastr',
'module': 'commonjs module',
'mz': 'commonjs mz',
'path': 'commonjs path',
'rxjs': 'commonjs rxjs',
module: 'commonjs module',
mz: 'commonjs mz',
path: 'commonjs path',
rxjs: 'commonjs rxjs',
'zone.js': 'commonjs zone.js/dist/zone.js',
},
plugins: [

View File

@@ -0,0 +1,48 @@
const path = require('path')
const webpack = require('webpack')
module.exports = {
name: 'terminus-main',
target: 'node',
entry: {
main: path.resolve(__dirname, 'lib/index.ts'),
},
mode: process.env.DEV ? 'development' : 'production',
context: __dirname,
devtool: 'source-map',
output: {
path: path.join(__dirname, 'dist'),
pathinfo: true,
filename: '[name].js',
},
resolve: {
modules: ['lib/', 'node_modules', '../node_modules'].map(x => path.join(__dirname, x)),
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.ts$/,
use: {
loader: 'awesome-typescript-loader',
options: {
configFileName: path.resolve(__dirname, 'tsconfig.main.json'),
},
},
},
],
},
externals: {
electron: 'commonjs electron',
'electron-config': 'commonjs electron-config',
'electron-vibrancy': 'commonjs electron-vibrancy',
'electron-squirrel-startup': 'commonjs electron-squirrel-startup',
fs: 'commonjs fs',
mz: 'commonjs mz',
path: 'commonjs path',
yargs: 'commonjs yargs',
},
plugins: [
new webpack.optimize.ModuleConcatenationPlugin(),
],
}

View File

@@ -149,27 +149,33 @@ electron-config@0.2.1:
dependencies:
conf "^0.11.1"
electron-debug@^1.0.1:
version "1.2.0"
resolved "https://registry.yarnpkg.com/electron-debug/-/electron-debug-1.2.0.tgz#22e51a73e1bf095d0bb51a6c3d97a203364c4222"
electron-debug@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/electron-debug/-/electron-debug-2.0.0.tgz#3059a6557acbfb091f138d83875f57bac80cea6d"
dependencies:
electron-is-dev "^0.1.0"
electron-localshortcut "^2.0.0"
electron-is-dev "^0.3.0"
electron-localshortcut "^3.0.0"
electron-is-accelerator@^0.1.0:
version "0.1.2"
resolved "https://registry.yarnpkg.com/electron-is-accelerator/-/electron-is-accelerator-0.1.2.tgz#509e510c26a56b55e17f863a4b04e111846ab27b"
electron-is-dev@0.1.2, electron-is-dev@^0.1.0:
electron-is-dev@0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/electron-is-dev/-/electron-is-dev-0.1.2.tgz#8a1043e32b3a1da1c3f553dce28ce764246167e3"
electron-localshortcut@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/electron-localshortcut/-/electron-localshortcut-2.0.2.tgz#6a1adcd6514c957328ec7912f5ccb5e1c10706db"
electron-is-dev@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/electron-is-dev/-/electron-is-dev-0.3.0.tgz#14e6fda5c68e9e4ecbeff9ccf037cbd7c05c5afe"
electron-localshortcut@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/electron-localshortcut/-/electron-localshortcut-3.1.0.tgz#10c1ffd537b8d39170aaf6e1551341f7780dd2ce"
dependencies:
debug "^2.6.8"
electron-is-accelerator "^0.1.0"
keyboardevent-from-electron-accelerator "^1.1.0"
keyboardevents-areequal "^0.2.1"
electron-squirrel-startup@^1.0.0:
version "1.0.0"
@@ -270,6 +276,14 @@ js-yaml@3.8.2:
argparse "^1.0.7"
esprima "^3.1.1"
keyboardevent-from-electron-accelerator@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/keyboardevent-from-electron-accelerator/-/keyboardevent-from-electron-accelerator-1.1.0.tgz#324614f6e33490c37ffc5be5876b3e85fe223c84"
keyboardevents-areequal@^0.2.1:
version "0.2.2"
resolved "https://registry.yarnpkg.com/keyboardevents-areequal/-/keyboardevents-areequal-0.2.2.tgz#88191ec738ce9f7591c25e9056de928b40277194"
lcid@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835"

View File

@@ -4,7 +4,7 @@ platform:
- x64
environment:
nodejs_version: "7"
nodejs_version: "10"
cache:
- '%USERPROFILE%\.electron'
@@ -24,3 +24,4 @@ build_script:
artifacts:
- path: 'dist\win\*.exe'
- path: 'dist\*.exe'

View File

@@ -0,0 +1,4 @@
#!/bin/bash
# Link to the binary
ln -sf '/opt/${productFilename}/${executable}' '/usr/bin/${executable}'

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSServices</key>
<array>
<dict>
<key>NSBackgroundColorName</key>
<string>background</string>
<key>NSIconName</key>
<string>NSActionTemplate</string>
<key>NSMenuItem</key>
<dict>
<key>default</key>
<string>Open Terminus here</string>
</dict>
<key>NSMessage</key>
<string>runWorkflowAsService</string>
<key>NSRequiredContext</key>
<dict>
<key>NSApplicationIdentifier</key>
<string>com.apple.finder</string>
</dict>
<key>NSSendFileTypes</key>
<array>
<string>public.item</string>
</array>
</dict>
</array>
</dict>
</plist>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict/>
<key>files2</key>
<dict>
<key>QuickLook/Thumbnail.png</key>
<dict>
<key>hash</key>
<data>
tv0Qtgo8zZ9+sQPQDNdKJHm7jeQ=
</data>
<key>hash2</key>
<data>
8nlfnBbkORcam9cE84KuxM9Lgf6hYU0jehepX8sSNDU=
</data>
</dict>
<key>document.wflow</key>
<dict>
<key>cdhash</key>
<data>
VK77ipNZktBsDCcUfnfht774juM=
</data>
<key>requirement</key>
<string>identifier document and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = V4JSMC46SY</string>
</dict>
</dict>
<key>rules</key>
<dict>
<key>^Resources/</key>
<true/>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^.*</key>
<true/>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^[^/]+$</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,226 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AMApplicationBuild</key>
<string>444.38</string>
<key>AMApplicationVersion</key>
<string>2.9</string>
<key>AMDocumentVersion</key>
<string>2</string>
<key>actions</key>
<array>
<dict>
<key>action</key>
<dict>
<key>AMAccepts</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Optional</key>
<true/>
<key>Types</key>
<array>
<string>com.apple.cocoa.string</string>
</array>
</dict>
<key>AMActionVersion</key>
<string>2.0.3</string>
<key>AMApplication</key>
<array>
<string>Automator</string>
</array>
<key>AMParameterProperties</key>
<dict>
<key>COMMAND_STRING</key>
<dict/>
<key>CheckedForUserDefaultShell</key>
<dict/>
<key>inputMethod</key>
<dict/>
<key>shell</key>
<dict/>
<key>source</key>
<dict/>
</dict>
<key>AMProvides</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Types</key>
<array>
<string>com.apple.cocoa.string</string>
</array>
</dict>
<key>ActionBundlePath</key>
<string>/System/Library/Automator/Run Shell Script.action</string>
<key>ActionName</key>
<string>Run Shell Script</string>
<key>ActionParameters</key>
<dict>
<key>COMMAND_STRING</key>
<string>/Applications/Terminus.app/Contents/MacOS/terminus open "$1"</string>
<key>CheckedForUserDefaultShell</key>
<true/>
<key>inputMethod</key>
<integer>1</integer>
<key>shell</key>
<string>/bin/sh</string>
<key>source</key>
<string></string>
</dict>
<key>BundleIdentifier</key>
<string>com.apple.RunShellScript</string>
<key>CFBundleVersion</key>
<string>2.0.3</string>
<key>CanShowSelectedItemsWhenRun</key>
<false/>
<key>CanShowWhenRun</key>
<true/>
<key>Category</key>
<array>
<string>AMCategoryUtilities</string>
</array>
<key>Class Name</key>
<string>RunShellScriptAction</string>
<key>InputUUID</key>
<string>CDBAB8D4-B8B8-4FBB-9115-B4082FB99E1C</string>
<key>Keywords</key>
<array>
<string>Shell</string>
<string>Script</string>
<string>Command</string>
<string>Run</string>
<string>Unix</string>
</array>
<key>OutputUUID</key>
<string>96B5890B-A95F-4BF2-8E5A-38E07A849C33</string>
<key>UUID</key>
<string>62251AFB-502C-4EA0-821C-D9B8CA96E6EE</string>
<key>UnlocalizedApplications</key>
<array>
<string>Automator</string>
</array>
<key>arguments</key>
<dict>
<key>0</key>
<dict>
<key>default value</key>
<integer>0</integer>
<key>name</key>
<string>inputMethod</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>0</string>
</dict>
<key>1</key>
<dict>
<key>default value</key>
<string></string>
<key>name</key>
<string>source</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>1</string>
</dict>
<key>2</key>
<dict>
<key>default value</key>
<false/>
<key>name</key>
<string>CheckedForUserDefaultShell</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>2</string>
</dict>
<key>3</key>
<dict>
<key>default value</key>
<string></string>
<key>name</key>
<string>COMMAND_STRING</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>3</string>
</dict>
<key>4</key>
<dict>
<key>default value</key>
<string>/bin/sh</string>
<key>name</key>
<string>shell</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>4</string>
</dict>
</dict>
<key>isViewVisible</key>
<true/>
<key>location</key>
<string>529.000000:305.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Run Shell Script.action/Contents/Resources/Base.lproj/main.nib</string>
</dict>
<key>isViewVisible</key>
<true/>
</dict>
</array>
<key>connectors</key>
<dict/>
<key>workflowMetaData</key>
<dict>
<key>applicationBundleID</key>
<string>com.apple.finder</string>
<key>applicationBundleIDsByPath</key>
<dict>
<key>/System/Library/CoreServices/Finder.app</key>
<string>com.apple.finder</string>
</dict>
<key>applicationPath</key>
<string>/System/Library/CoreServices/Finder.app</string>
<key>applicationPaths</key>
<array>
<string>/System/Library/CoreServices/Finder.app</string>
</array>
<key>inputTypeIdentifier</key>
<string>com.apple.Automator.fileSystemObject</string>
<key>outputTypeIdentifier</key>
<string>com.apple.Automator.nothing</string>
<key>presentationMode</key>
<integer>15</integer>
<key>processesInput</key>
<integer>0</integer>
<key>serviceApplicationBundleID</key>
<string>com.apple.finder</string>
<key>serviceApplicationPath</key>
<string>/System/Library/CoreServices/Finder.app</string>
<key>serviceInputTypeIdentifier</key>
<string>com.apple.Automator.fileSystemObject</string>
<key>serviceOutputTypeIdentifier</key>
<string>com.apple.Automator.nothing</string>
<key>serviceProcessesInput</key>
<integer>0</integer>
<key>systemImageName</key>
<string>NSActionTemplate</string>
<key>useAutomaticInputType</key>
<integer>0</integer>
<key>workflowTypeIdentifier</key>
<string>com.apple.Automator.servicesMenu</string>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSServices</key>
<array>
<dict>
<key>NSBackgroundColorName</key>
<string>background</string>
<key>NSIconName</key>
<string>NSActionTemplate</string>
<key>NSMenuItem</key>
<dict>
<key>default</key>
<string>Paste path into Terminus</string>
</dict>
<key>NSMessage</key>
<string>runWorkflowAsService</string>
<key>NSRequiredContext</key>
<dict>
<key>NSApplicationIdentifier</key>
<string>com.apple.finder</string>
</dict>
<key>NSSendFileTypes</key>
<array>
<string>public.item</string>
</array>
</dict>
</array>
</dict>
</plist>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict/>
<key>files2</key>
<dict>
<key>QuickLook/Thumbnail.png</key>
<dict>
<key>hash</key>
<data>
tv0Qtgo8zZ9+sQPQDNdKJHm7jeQ=
</data>
<key>hash2</key>
<data>
8nlfnBbkORcam9cE84KuxM9Lgf6hYU0jehepX8sSNDU=
</data>
</dict>
<key>document.wflow</key>
<dict>
<key>cdhash</key>
<data>
DwLo2M9xZ+aZGtMzRCGHhHB/wMY=
</data>
<key>requirement</key>
<string>identifier document and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = V4JSMC46SY</string>
</dict>
</dict>
<key>rules</key>
<dict>
<key>^Resources/</key>
<true/>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^.*</key>
<true/>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^[^/]+$</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,226 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AMApplicationBuild</key>
<string>444.38</string>
<key>AMApplicationVersion</key>
<string>2.9</string>
<key>AMDocumentVersion</key>
<string>2</string>
<key>actions</key>
<array>
<dict>
<key>action</key>
<dict>
<key>AMAccepts</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Optional</key>
<true/>
<key>Types</key>
<array>
<string>com.apple.cocoa.string</string>
</array>
</dict>
<key>AMActionVersion</key>
<string>2.0.3</string>
<key>AMApplication</key>
<array>
<string>Automator</string>
</array>
<key>AMParameterProperties</key>
<dict>
<key>COMMAND_STRING</key>
<dict/>
<key>CheckedForUserDefaultShell</key>
<dict/>
<key>inputMethod</key>
<dict/>
<key>shell</key>
<dict/>
<key>source</key>
<dict/>
</dict>
<key>AMProvides</key>
<dict>
<key>Container</key>
<string>List</string>
<key>Types</key>
<array>
<string>com.apple.cocoa.string</string>
</array>
</dict>
<key>ActionBundlePath</key>
<string>/System/Library/Automator/Run Shell Script.action</string>
<key>ActionName</key>
<string>Run Shell Script</string>
<key>ActionParameters</key>
<dict>
<key>COMMAND_STRING</key>
<string>/Applications/Terminus.app/Contents/MacOS/terminus paste --escape "$1"</string>
<key>CheckedForUserDefaultShell</key>
<true/>
<key>inputMethod</key>
<integer>1</integer>
<key>shell</key>
<string>/bin/sh</string>
<key>source</key>
<string></string>
</dict>
<key>BundleIdentifier</key>
<string>com.apple.RunShellScript</string>
<key>CFBundleVersion</key>
<string>2.0.3</string>
<key>CanShowSelectedItemsWhenRun</key>
<false/>
<key>CanShowWhenRun</key>
<true/>
<key>Category</key>
<array>
<string>AMCategoryUtilities</string>
</array>
<key>Class Name</key>
<string>RunShellScriptAction</string>
<key>InputUUID</key>
<string>CDBAB8D4-B8B8-4FBB-9115-B4082FB99E1C</string>
<key>Keywords</key>
<array>
<string>Shell</string>
<string>Script</string>
<string>Command</string>
<string>Run</string>
<string>Unix</string>
</array>
<key>OutputUUID</key>
<string>96B5890B-A95F-4BF2-8E5A-38E07A849C33</string>
<key>UUID</key>
<string>62251AFB-502C-4EA0-821C-D9B8CA96E6EE</string>
<key>UnlocalizedApplications</key>
<array>
<string>Automator</string>
</array>
<key>arguments</key>
<dict>
<key>0</key>
<dict>
<key>default value</key>
<integer>0</integer>
<key>name</key>
<string>inputMethod</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>0</string>
</dict>
<key>1</key>
<dict>
<key>default value</key>
<string></string>
<key>name</key>
<string>source</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>1</string>
</dict>
<key>2</key>
<dict>
<key>default value</key>
<false/>
<key>name</key>
<string>CheckedForUserDefaultShell</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>2</string>
</dict>
<key>3</key>
<dict>
<key>default value</key>
<string></string>
<key>name</key>
<string>COMMAND_STRING</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>3</string>
</dict>
<key>4</key>
<dict>
<key>default value</key>
<string>/bin/sh</string>
<key>name</key>
<string>shell</string>
<key>required</key>
<string>0</string>
<key>type</key>
<string>0</string>
<key>uuid</key>
<string>4</string>
</dict>
</dict>
<key>isViewVisible</key>
<true/>
<key>location</key>
<string>529.000000:305.000000</string>
<key>nibPath</key>
<string>/System/Library/Automator/Run Shell Script.action/Contents/Resources/Base.lproj/main.nib</string>
</dict>
<key>isViewVisible</key>
<true/>
</dict>
</array>
<key>connectors</key>
<dict/>
<key>workflowMetaData</key>
<dict>
<key>applicationBundleID</key>
<string>com.apple.finder</string>
<key>applicationBundleIDsByPath</key>
<dict>
<key>/System/Library/CoreServices/Finder.app</key>
<string>com.apple.finder</string>
</dict>
<key>applicationPath</key>
<string>/System/Library/CoreServices/Finder.app</string>
<key>applicationPaths</key>
<array>
<string>/System/Library/CoreServices/Finder.app</string>
</array>
<key>inputTypeIdentifier</key>
<string>com.apple.Automator.fileSystemObject</string>
<key>outputTypeIdentifier</key>
<string>com.apple.Automator.nothing</string>
<key>presentationMode</key>
<integer>15</integer>
<key>processesInput</key>
<integer>0</integer>
<key>serviceApplicationBundleID</key>
<string>com.apple.finder</string>
<key>serviceApplicationPath</key>
<string>/System/Library/CoreServices/Finder.app</string>
<key>serviceInputTypeIdentifier</key>
<string>com.apple.Automator.fileSystemObject</string>
<key>serviceOutputTypeIdentifier</key>
<string>com.apple.Automator.nothing</string>
<key>serviceProcessesInput</key>
<integer>0</integer>
<key>systemImageName</key>
<string>NSActionTemplate</string>
<key>useAutomaticInputType</key>
<integer>0</integer>
<key>workflowTypeIdentifier</key>
<string>com.apple.Automator.servicesMenu</string>
</dict>
</dict>
</plist>

View File

@@ -1,6 +1,10 @@
### Changes
##### v0.4.9
- Fixed broken Doskey on Win10 (#438, #451)
##### v0.4.8
- Environment variable 'clink_profile' overrides Clink's profile path (#390).

View File

@@ -136,7 +136,7 @@ h6 { font-size: 1.00em; }
<!-- ----------------------------------------------------- -->
<body onload="go();">
<div id="header">
<div id="title">Clink v0.4.8</div>
<div id="title">Clink v0.4.9</div>
<div id="url">
<a href="http://github.com/mridgers/clink">
http://github.com/mridgers/clink
@@ -697,6 +697,10 @@ The current cursor position within the line buffer.
### Changes
##### v0.4.9
- Fixed broken Doskey on Win10 (#438, #451)
##### v0.4.8
- Environment variable 'clink_profile' overrides Clink's profile path (#390).

BIN
extras/clink/clink_x64.exe Normal file

Binary file not shown.

BIN
extras/clink/clink_x86.exe Normal file

Binary file not shown.

View File

@@ -1,19 +1,32 @@
{
"name": "term",
"devDependencies": {
"@types/electron-config": "^0.2.1",
"@types/electron-debug": "^1.1.0",
"@types/fs-promise": "1.0.1",
"@types/js-yaml": "^3.11.2",
"@types/node": "7.0.5",
"@types/webpack-env": "1.13.0",
"apply-loader": "0.1.0",
"awesome-typescript-loader": "^5.0.0",
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.6",
"babel-loader": "^7.1.5",
"babel-preset-es2015": "^6.24.1",
"core-js": "2.4.1",
"cross-env": "4.0.0",
"css-loader": "0.28.0",
"electron": "3.0.0-beta.5",
"electron": "3.0.0",
"electron-builder": "^20.27.1",
"electron-builder-squirrel-windows": "17.0.1",
"electron-installer-snap": "^3.0.0",
"electron-rebuild": "^1.8.2",
"eslint": "^5.4.0",
"eslint-config-standard": "^11.0.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-promise": "^4.0.0",
"eslint-plugin-standard": "^3.1.0",
"file-loader": "^1.1.11",
"font-awesome": "4.7.0",
"graceful-fs": "^4.1.11",
@@ -21,7 +34,7 @@
"json-loader": "0.5.4",
"less": "2.7.1",
"less-loader": "2.2.3",
"node-abi": "^2.4.1",
"node-abi": "^2.4.4",
"node-gyp": "^3.6.2",
"node-sass": "^4.5.3",
"npmlog": "4.1.0",
@@ -60,17 +73,21 @@
],
"extraResources": [
"builtin-plugins",
"clink"
"extras"
],
"win": {
"icon": "./build/windows/icon.ico",
"publish": [
"github"
]
],
"artifactName": "terminus-${version}-setup.exe"
},
"squirrelWindows": {
"iconUrl": "https://github.com/Eugeny/terminus/raw/master/build/windows/icon.ico",
"artifactName": "terminus-${version}-${os}-${arch}.exe"
"artifactName": "terminus-${version}-setup.exe"
},
"portable": {
"artifactName": "terminus-${version}-portable.exe"
},
"mac": {
"category": "public.app-category.video",
@@ -83,11 +100,12 @@
}
},
"dmg": {
"artifactName": "terminus-${version}-${os}-${arch}.dmg"
"artifactName": "terminus-${version}-macos.dmg"
},
"linux": {
"category": "Utilities",
"icon": "./build/icons",
"artifactName": "terminus-${version}-linux.${ext}",
"publish": [
"github"
]
@@ -103,19 +121,18 @@
"libnss3",
"tmux"
],
"artifactName": "terminus-${version}-${os}-${arch}.deb"
"afterInstall": "build/linux/after-install.tpl"
},
"rpm": {
"depends": [
"screen",
"gnome-python2-gnomekeyring"
],
"artifactName": "terminus-${version}-${os}-${arch}.rpm"
]
}
},
"scripts": {
"build": "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",
"watch": "webpack --progress --color --watch",
"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",
"watch": "cross-env DEV=1 webpack --progress --color --watch",
"start": "cross-env DEV=1 electron app --debug",
"prod": "cross-env DEV=1 electron app",
"lint": "tslint -c tslint.json -t stylish terminus-*/src/**/*.ts terminus-*/src/*.ts app/src/*.ts",

View File

@@ -4,7 +4,7 @@ const vars = require('./vars')
builder({
dir: true,
win: ['squirrel'],
win: ['squirrel', 'portable'],
config: {
extraMetadata: {
version: vars.version,

View File

@@ -1,6 +1,6 @@
{
"name": "terminus-community-color-schemes",
"version": "1.0.0-alpha.48",
"version": "1.0.0-alpha.55",
"description": "Community color schemes for Terminus",
"keywords": [
"terminus-builtin-plugin"

View File

@@ -13,6 +13,7 @@ module.exports = {
libraryTarget: 'umd',
devtoolModuleFilenameTemplate: 'webpack-terminus-community-color-schemes:///[resource-path]',
},
mode: process.env.DEV ? 'development' : 'production',
resolve: {
modules: ['.', 'src', 'node_modules', '../app/node_modules'].map(x => path.join(__dirname, x)),
extensions: ['.ts', '.js'],

View File

@@ -1,6 +1,6 @@
{
"name": "terminus-core",
"version": "1.0.0-alpha.48",
"version": "1.0.0-alpha.55",
"description": "Terminus core",
"keywords": [
"terminus-builtin-plugin"
@@ -22,11 +22,13 @@
"@types/webpack-env": "^1.13.0",
"@types/winston": "^2.3.6",
"axios": "0.16.2",
"bootstrap": "4.0.0-alpha.6",
"bootstrap": "^4.1.3",
"core-js": "^2.4.1",
"electron-updater": "^2.8.9",
"ng2-dnd": "^5.0.2",
"ngx-perfect-scrollbar": "^6.0.0"
"ngx-perfect-scrollbar": "^6.0.0",
"shell-escape": "^0.2.0",
"universal-analytics": "^0.4.17"
},
"peerDependencies": {
"@angular/animations": "4.0.1",
@@ -41,6 +43,7 @@
"dependencies": {
"deepmerge": "^1.5.0",
"js-yaml": "^3.9.0",
"winreg": "^1.2.4",
"winston": "^2.4.0"
},
"false": {}

View File

@@ -1,3 +0,0 @@
export abstract class DefaultTabProvider {
abstract async openNewTab (): Promise<void>
}

View File

@@ -3,7 +3,6 @@ export { TabRecoveryProvider, RecoveredTab } from './tabRecovery'
export { ToolbarButtonProvider, IToolbarButton } from './toolbarButtonProvider'
export { ConfigProvider } from './configProvider'
export { HotkeyProvider, IHotkeyDescription } from './hotkeyProvider'
export { DefaultTabProvider } from './defaultTabProvider'
export { Theme } from './theme'
export { AppService } from '../services/app.service'
@@ -11,6 +10,8 @@ export { ConfigService } from '../services/config.service'
export { DockingService } from '../services/docking.service'
export { ElectronService } from '../services/electron.service'
export { Logger, LogService } from '../services/log.service'
export { HomeBaseService } from '../services/homeBase.service'
export { HotkeysService } from '../services/hotkeys.service'
export { HostAppService, Platform } from '../services/hostApp.service'
export { ShellIntegrationService } from '../services/shellIntegration.service'
export { ThemesService } from '../services/themes.service'

View File

@@ -2,6 +2,7 @@ import { SafeHtml } from '@angular/platform-browser'
export interface IToolbarButton {
icon: SafeHtml
touchBarNSImage?: string
title: string
touchBarTitle?: string
weight?: number

View File

@@ -24,7 +24,7 @@ title-bar(
[index]='idx',
[tab]='tab',
[active]='tab == app.activeTab',
[hasActivity]='tab.hasActivity',
[hasActivity]='tab.activity$|async',
@animateTab,
(click)='app.selectTab(tab)',
[class.fully-draggable]='hostApp.platform != Platform.macOS',

View File

@@ -4,7 +4,7 @@
height: 100vh;
flex-direction: column;
overflow: hidden;
-webkit-user-select: none;
user-select: none;
-webkit-user-drag: none;
-webkit-font-smoothing: antialiased;
will-change: transform;

View File

@@ -138,33 +138,43 @@ export class AppRootComponent {
config.changed$.subscribe(() => this.updateVibrancy())
this.updateVibrancy()
this.app.tabOpened$.subscribe(tab => this.unsortedTabs.push(tab))
this.app.tabOpened$.subscribe(tab => {
this.unsortedTabs.push(tab)
tab.progress$.subscribe(progress => {
if (progress !== null) {
this.hostApp.getWindow().setProgressBar(progress / 100.0, { mode: 'normal' })
} else {
this.hostApp.getWindow().setProgressBar(-1, { mode: 'none' })
}
})
})
this.app.tabClosed$.subscribe(tab => {
this.unsortedTabs = this.unsortedTabs.filter(x => x !== tab)
})
}
onGlobalHotkey () {
if (this.electron.app.window.isFocused()) {
if (this.hostApp.getWindow().isFocused()) {
// focused
this.electron.loseFocus()
this.hostApp.getWindow().blur()
if (this.hostApp.platform !== Platform.macOS) {
this.electron.app.window.hide()
this.hostApp.getWindow().hide()
}
} else {
if (!this.electron.app.window.isVisible()) {
if (!this.hostApp.getWindow().isVisible()) {
// unfocused, invisible
this.electron.app.window.show()
this.electron.app.window.focus()
this.hostApp.getWindow().show()
this.hostApp.getWindow().focus()
} else {
if (this.config.store.appearance.dock === 'off') {
// not docked, visible
setTimeout(() => {
this.electron.app.window.focus()
this.hostApp.getWindow().focus()
})
} else {
// docked, visible
this.electron.app.window.hide()
this.hostApp.getWindow().hide()
}
}
}
@@ -175,10 +185,6 @@ export class AppRootComponent {
this.ready = true
this.tabRecovery.saveTabs(this.app.tabs)
if (this.app.tabs.length === 0) {
this.app.openDefaultTab()
}
this.app.emitReady()
}
@@ -218,7 +224,7 @@ export class AppRootComponent {
}
private updateVibrancy () {
this.hostApp.setVibrancy(this.config.store.appearance.vibrancy)
this.hostApp.getWindow().setOpacity(this.config.store.appearance.opacity)
this.hostApp.setVibrancy(this.config.store.appearance.vibrancy)
this.hostApp.getWindow().setOpacity(this.config.store.appearance.opacity)
}
}

View File

@@ -6,16 +6,22 @@ export abstract class BaseTabComponent {
id: number
title: string
customTitle: string
hasActivity = false
hasFocus = false
hasActivity = false
hostView: ViewRef
protected titleChange = new Subject<string>()
protected focused = new Subject<void>()
protected blurred = new Subject<void>()
protected progress = new Subject<number>()
protected activity = new Subject<boolean>()
private progressClearTimeout: number
get focused$ (): Observable<void> { return this.focused }
get blurred$ (): Observable<void> { return this.blurred }
get titleChange$ (): Observable<string> { return this.titleChange }
get progress$ (): Observable<number> { return this.progress }
get activity$ (): Observable<boolean> { return this.activity }
constructor () {
this.id = BaseTabComponent.lastTabID++
@@ -34,8 +40,26 @@ export abstract class BaseTabComponent {
}
}
setProgress (progress: number) {
this.progress.next(progress)
if (progress) {
if (this.progressClearTimeout) {
clearTimeout(this.progressClearTimeout)
}
this.progressClearTimeout = setTimeout(() => {
this.setProgress(null)
}, 5000)
}
}
displayActivity (): void {
this.hasActivity = true
this.activity.next(true)
}
clearActivity (): void {
this.hasActivity = false
this.activity.next(false)
}
getRecoveryToken (): any {
@@ -58,5 +82,6 @@ export abstract class BaseTabComponent {
this.focused.complete()
this.blurred.complete()
this.titleChange.complete()
this.progress.complete()
}
}

View File

@@ -1,4 +1,4 @@
.icon((click)='click()', tabindex='0', [class.active]='model', (keyup.space)='click()')
.icon(tabindex='0', [class.active]='model', (keyup.space)='click()')
i.fa.fa-square-o.off
i.fa.fa-check-square.on
.text((click)='click()') {{text}}
.text {{text}}

View File

@@ -1,4 +1,4 @@
import { NgZone, Component, Input } from '@angular/core'
import { NgZone, Component, Input, HostBinding, HostListener } from '@angular/core'
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
@Component({
@@ -10,12 +10,12 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
]
})
export class CheckboxComponent implements ControlValueAccessor {
@Input() model: boolean
@HostBinding('class.active') @Input() model: boolean
@Input() disabled: boolean
@Input() text: string
private changed = new Array<(val: boolean) => void>()
click () {
@HostListener('click') click () {
NgZone.assertInAngularZone()
if (this.disabled) {
return

View File

@@ -4,21 +4,20 @@ div
sup α
.list-group
a.list-group-item.list-group-item-action(
a.list-group-item.list-group-item-action.d-flex(
*ngFor='let button of getButtons()',
(click)='button.click()',
)
.d-flex.align-self-center([innerHTML]='button.icon')
span {{button.title}}
footer
.pull-right
.form-control-static Version: {{version}}
.btn-group
button.btn.btn-secondary((click)='openGitHub()')
footer.d-flex.align-items-center
.btn-group.mr-auto
button.btn.btn-secondary((click)='homeBase.openGitHub()')
i.fa.fa-github
span GitHub
button.btn.btn-secondary((click)='reportBug()')
button.btn.btn-secondary((click)='homeBase.reportBug()')
i.fa.fa-bug
span Report a problem
.form-control-static.selectable.no-drag Version: {{homeBase.appVersion}}

View File

@@ -3,6 +3,7 @@
flex-direction: column;
flex: auto;
-webkit-app-region: drag;
overflow-y: auto;
}
:host > div {
@@ -32,6 +33,4 @@ a, button {
width: 16px;
height: 16px;
margin-right: 10px;
fill: white;
fill-opacity: 0.75;
}

View File

@@ -1,7 +1,6 @@
import * as os from 'os'
import { Component, Inject } from '@angular/core'
import { ElectronService } from '../services/electron.service'
import { ConfigService } from '../services/config.service'
import { HomeBaseService } from '../services/homeBase.service'
import { IToolbarButton, ToolbarButtonProvider } from '../api'
@Component({
@@ -13,11 +12,10 @@ export class StartPageComponent {
version: string
constructor (
private electron: ElectronService,
private config: ConfigService,
public homeBase: HomeBaseService,
@Inject(ToolbarButtonProvider) private toolbarButtonProviders: ToolbarButtonProvider[],
) {
this.version = electron.app.getVersion()
}
getButtons (): IToolbarButton[] {
@@ -26,19 +24,4 @@ export class StartPageComponent {
.reduce((a, b) => a.concat(b))
.sort((a: IToolbarButton, b: IToolbarButton) => (a.weight || 0) - (b.weight || 0))
}
openGitHub () {
this.electron.shell.openExternal('https://github.com/eugeny/terminus')
}
reportBug () {
let body = `Version: ${this.version}\n`
body += `Platform: ${os.platform()} ${os.release()}\n\n`
let label = {
darwin: 'macOS',
windows: 'Windows',
linux: 'Linux',
}[os.platform()]
this.electron.shell.openExternal(`https://github.com/eugeny/terminus/issues/new?body=${encodeURIComponent(body)}&labels=${label}`)
}
}

View File

@@ -1,3 +1,4 @@
.progressbar([style.width]='progress + "%"', *ngIf='progress != null')
.index(#handle) {{index + 1}}
.name([title]='tab.customTitle || tab.title') {{tab.customTitle || tab.title}}
button((click)='app.closeTab(tab, true)') &times;

View File

@@ -1,6 +1,7 @@
$tabs-height: 36px;
:host {
position: relative;
cursor: pointer;
flex: 1000 1 200px;
@@ -12,8 +13,6 @@ $tabs-height: 36px;
overflow: hidden;
transition: 0.125s ease-out all;
.index {
flex: none;
font-weight: bold;
@@ -43,12 +42,13 @@ $tabs-height: 36px;
flex: none;
background: transparent;
opacity: 0;
-webkit-app-region: no-drag;
$button-size: 23px;
$button-size: 26px;
width: $button-size;
height: $button-size;
border-radius: $button-size / 2;
line-height: $button-size * 0.87;
line-height: $button-size * 0.9;
align-self: center;
margin-right: 10px;
@@ -73,4 +73,13 @@ $tabs-height: 36px;
&.fully-draggable {
cursor: -webkit-grab;
}
.progressbar {
position: absolute;
left: 0;
top: 0;
height: 5px;
z-index: -1;
transition: 0.25s width;
}
}

View File

@@ -17,7 +17,9 @@ export class TabHeaderComponent {
@Input() @HostBinding('class.active') active: boolean
@Input() @HostBinding('class.has-activity') hasActivity: boolean
@Input() tab: BaseTabComponent
@Input() progress: number
@ViewChild('handle') handle: ElementRef
private contextMenu: any
constructor (
@@ -74,6 +76,9 @@ export class TabHeaderComponent {
if (this.hostApp.platform === Platform.macOS) {
this.parentDraggable.setDragHandle(this.handle.nativeElement)
}
this.tab.progress$.subscribe(progress => {
this.progress = progress
})
}
@HostListener('dblclick') onDoubleClick (): void {

View File

@@ -0,0 +1,70 @@
:host {
flex: none;
$toggle-size: 18px;
$height: 30px;
$padding: 2px;
cursor: pointer;
display: inline-flex;
overflow: visible;
border-radius: 3px;
line-height: $height;
height: $height;
transition: 0.25s opacity;
align-items: center;
overflow: hidden;
padding-right: 10px;
padding-left: 10px;
margin-left: -10px;
&:focus {
background: rgba(255,255,255,.05);
border-radius: 5px;
}
&[disabled] {
opacity: 0.5;
}
.body {
$border-width: 2px;
border-radius: 5px;
border: $border-width solid rgba(255, 255, 255, .2);
padding: $padding;
height: $toggle-size + $border-width * 2 + $padding * 2;
width: $toggle-size * 2 + $border-width * 2 + $padding * 2;
position: relative;
.toggle {
position: absolute;
border-radius: 2px;
width: $toggle-size;
height: $toggle-size;
background: #475158;
top: $padding;
left: $padding;
transition: 0.25s left;
line-height: 19px;
text-align: center;
font-size: 10px;
i {
opacity: 0;
transition: 0.25s opacity;
}
}
}
&.active .body .toggle {
left: $toggle-size + $padding;
i {
color: white;
opacity: 1;
}
}
&:active {
background: rgba(255,255,255,.1);
}
}

View File

@@ -0,0 +1,22 @@
import { Component } from '@angular/core'
import { NG_VALUE_ACCESSOR } from '@angular/forms'
import { CheckboxComponent } from './checkbox.component'
@Component({
selector: 'toggle',
template: `
<div class="switch">
<div class="body">
<div class="toggle" [class.bg-primary]='model'>
<i class="fa fa-check"></i>
</div>
</div>
</div>
`,
styles: [require('./toggle.component.scss')],
providers: [
{ provide: NG_VALUE_ACCESSOR, useExisting: ToggleComponent, multi: true },
]
})
export class ToggleComponent extends CheckboxComponent {
}

View File

@@ -9,7 +9,7 @@ button.btn.btn-secondary.btn-maximize(
svg(version='1.1', width='10', height='10')
path(d='M 0,0 0,10 10,10 10,0 Z M 1,1 9,1 9,9 1,9 Z')
button.btn.btn-secondary.btn-close(
(click)='hostApp.quit()',
(click)='hostApp.getWindow().close()',
)
svg(version='1.1', width='10', height='10')
path(d='M 0,0 0,0.7 4.3,5 0,9.3 0,10 0.7,10 5,5.7 9.3,10 10,10 10,9.3 5.7,5 10,0.7 10,0 9.3,0 5,4.3 0.7,0 Z')

View File

@@ -1,4 +1,6 @@
hotkeys:
new-window:
- 'Ctrl-Shift-N'
toggle-window:
- 'Ctrl+Space'
toggle-fullscreen:

View File

@@ -1,4 +1,6 @@
hotkeys:
new-window:
- '⌘-N'
toggle-window:
- 'Ctrl+Space'
toggle-fullscreen:

View File

@@ -1,4 +1,6 @@
hotkeys:
new-window:
- 'Ctrl-Shift-N'
toggle-window:
- 'Ctrl+Space'
toggle-fullscreen:

View File

@@ -9,3 +9,4 @@ appearance:
css: '/* * { color: blue !important; } */'
opacity: 1.0
vibrancy: false
enableAnalytics: true

View File

@@ -0,0 +1,15 @@
import { Directive, AfterViewInit, ElementRef } from '@angular/core'
@Directive({
selector: '[autofocus]'
})
export class AutofocusDirective implements AfterViewInit {
constructor (private el: ElementRef) { }
ngAfterViewInit () {
this.el.nativeElement.blur()
setTimeout(() => {
this.el.nativeElement.focus()
})
}
}

View File

@@ -11,8 +11,10 @@ import { ConfigService } from './services/config.service'
import { ElectronService } from './services/electron.service'
import { HostAppService } from './services/hostApp.service'
import { LogService } from './services/log.service'
import { HomeBaseService } from './services/homeBase.service'
import { HotkeysService, AppHotkeyProvider } from './services/hotkeys.service'
import { DockingService } from './services/docking.service'
import { ShellIntegrationService } from './services/shellIntegration.service'
import { TabRecoveryService } from './services/tabRecovery.service'
import { ThemesService } from './services/themes.service'
import { TouchbarService } from './services/touchbar.service'
@@ -25,14 +27,17 @@ import { SafeModeModalComponent } from './components/safeModeModal.component'
import { StartPageComponent } from './components/startPage.component'
import { TabHeaderComponent } from './components/tabHeader.component'
import { TitleBarComponent } from './components/titleBar.component'
import { ToggleComponent } from './components/toggle.component'
import { WindowControlsComponent } from './components/windowControls.component'
import { RenameTabModalComponent } from './components/renameTabModal.component'
import { AutofocusDirective } from './directives/autofocus.directive'
import { HotkeyProvider } from './api/hotkeyProvider'
import { ConfigProvider } from './api/configProvider'
import { Theme } from './api/theme'
import { StandardTheme, StandardCompactTheme } from './theme'
import { StandardTheme, StandardCompactTheme, PaperTheme } from './theme'
import { CoreConfigProvider } from './config'
import 'perfect-scrollbar/css/perfect-scrollbar.css'
@@ -43,9 +48,11 @@ const PROVIDERS = [
ConfigService,
DockingService,
ElectronService,
HomeBaseService,
HostAppService,
HotkeysService,
LogService,
ShellIntegrationService,
TabRecoveryService,
ThemesService,
TouchbarService,
@@ -53,6 +60,7 @@ const PROVIDERS = [
{ provide: HotkeyProvider, useClass: AppHotkeyProvider, multi: true },
{ provide: Theme, useClass: StandardTheme, multi: true },
{ provide: Theme, useClass: StandardCompactTheme, multi: true },
{ provide: Theme, useClass: PaperTheme, multi: true },
{ provide: ConfigProvider, useClass: CoreConfigProvider, multi: true },
{ provide: PERFECT_SCROLLBAR_CONFIG, useValue: { suppressScrollX: true }}
]
@@ -73,16 +81,20 @@ const PROVIDERS = [
TabBodyComponent,
TabHeaderComponent,
TitleBarComponent,
ToggleComponent,
WindowControlsComponent,
RenameTabModalComponent,
SafeModeModalComponent,
AutofocusDirective,
],
entryComponents: [
RenameTabModalComponent,
SafeModeModalComponent,
],
exports: [
CheckboxComponent
CheckboxComponent,
ToggleComponent,
AutofocusDirective,
]
})
export default class AppModule {

View File

@@ -1,9 +1,9 @@
import { Observable, Subject, AsyncSubject } from 'rxjs'
import { Injectable, ComponentFactoryResolver, Injector, Optional } from '@angular/core'
import { DefaultTabProvider } from '../api/defaultTabProvider'
import { Injectable, ComponentFactoryResolver, Injector } from '@angular/core'
import { BaseTabComponent } from '../components/baseTab.component'
import { Logger, LogService } from './log.service'
import { ConfigService } from './config.service'
import { HostAppService } from './hostApp.service'
export declare type TabComponentType = new (...args: any[]) => BaseTabComponent
@@ -28,8 +28,8 @@ export class AppService {
constructor (
private componentFactoryResolver: ComponentFactoryResolver,
@Optional() private defaultTabProvider: DefaultTabProvider,
private config: ConfigService,
private hostApp: HostAppService,
private injector: Injector,
log: LogService,
) {
@@ -39,25 +39,26 @@ export class AppService {
openNewTab (type: TabComponentType, inputs?: any): BaseTabComponent {
let componentFactory = this.componentFactoryResolver.resolveComponentFactory(type)
let componentRef = componentFactory.create(this.injector)
componentRef.instance.hostView = componentRef.hostView
Object.assign(componentRef.instance, inputs || {})
let tab = componentRef.instance
tab.hostView = componentRef.hostView
Object.assign(tab, inputs || {})
this.tabs.push(componentRef.instance)
this.selectTab(componentRef.instance)
this.tabs.push(tab)
this.selectTab(tab)
this.tabsChanged.next()
this.tabOpened.next(componentRef.instance)
this.tabOpened.next(tab)
return componentRef.instance
}
openDefaultTab (): void {
if (this.defaultTabProvider) {
this.defaultTabProvider.openNewTab()
}
tab.titleChange$.subscribe(title => {
if (tab === this.activeTab) {
this.hostApp.setTitle(title)
}
})
return tab
}
selectTab (tab: BaseTabComponent) {
if (this.activeTab === tab) {
this.activeTab.emitFocused()
return
}
if (this.tabs.includes(this.activeTab)) {
@@ -66,13 +67,14 @@ export class AppService {
this.lastTabIndex = null
}
if (this.activeTab) {
this.activeTab.hasActivity = false
this.activeTab.clearActivity()
this.activeTab.emitBlurred()
}
this.activeTab = tab
this.activeTabChange.next(tab)
if (this.activeTab) {
this.activeTab.emitFocused()
this.hostApp.setTitle(this.activeTab.title)
}
}
@@ -129,5 +131,6 @@ export class AppService {
emitReady () {
this.ready.next(null)
this.ready.complete()
this.hostApp.emitReady()
}
}

View File

@@ -63,7 +63,7 @@ export class ConfigService {
constructor (
electron: ElectronService,
hostApp: HostAppService,
private hostApp: HostAppService,
@Inject(ConfigProvider) configProviders: ConfigProvider[],
) {
this.path = path.join(electron.app.getPath('userData'), 'config.yaml')
@@ -78,6 +78,15 @@ export class ConfigService {
return defaults
}).reduce(configMerge)
this.load()
hostApp.configChangeBroadcast$.subscribe(() => {
this.load()
this.emitChange()
})
}
getDefaults () {
return this.defaults
}
load (): void {
@@ -92,6 +101,18 @@ export class ConfigService {
save (): void {
fs.writeFileSync(this.path, yaml.safeDump(this._store), 'utf8')
this.emitChange()
this.hostApp.broadcastConfigChange()
}
readRaw (): string {
return yaml.safeDump(this._store)
}
writeRaw (data: string): void {
this._store = yaml.safeLoad(data)
this.save()
this.load()
this.emitChange()
}
emitChange (): void {

View File

@@ -76,12 +76,8 @@ export class DockingService {
})
}
getWindow () {
return this.electron.app.window
}
repositionWindow () {
let [x, y] = this.getWindow().getPosition()
let [x, y] = this.hostApp.getWindow().getPosition()
for (let screen of this.electron.screen.getAllDisplays()) {
let bounds = screen.bounds
if (x >= bounds.x && x <= bounds.x + bounds.width && y >= bounds.y && y <= bounds.y + bounds.height) {
@@ -89,6 +85,6 @@ export class DockingService {
}
}
let screen = this.electron.screen.getPrimaryDisplay()
this.getWindow().setPosition(screen.bounds.x, screen.bounds.y)
this.hostApp.getWindow().setPosition(screen.bounds.x, screen.bounds.y)
}
}

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core'
import { TouchBar } from 'electron'
import { TouchBar, BrowserWindow } from 'electron'
@Injectable()
export class ElectronService {
@@ -9,9 +9,11 @@ export class ElectronService {
dialog: any
clipboard: any
globalShortcut: any
nativeImage: any
screen: any
remote: any
TouchBar: typeof TouchBar
BrowserWindow: typeof BrowserWindow
private electron: any
constructor () {
@@ -24,7 +26,9 @@ export class ElectronService {
this.clipboard = this.electron.clipboard
this.ipcRenderer = this.electron.ipcRenderer
this.globalShortcut = this.remote.globalShortcut
this.nativeImage = this.remote.nativeImage
this.TouchBar = this.remote.TouchBar
this.BrowserWindow = this.remote.BrowserWindow
}
remoteRequire (name: string): any {

View File

@@ -0,0 +1,45 @@
import * as os from 'os'
import { Injectable } from '@angular/core'
import { ElectronService } from './electron.service'
import { ConfigService } from './config.service'
import ua = require('universal-analytics')
@Injectable()
export class HomeBaseService {
appVersion: string
constructor (
private electron: ElectronService,
private config: ConfigService,
) {
this.appVersion = electron.app.getVersion()
if (this.config.store.enableAnalytics) {
this.enableAnalytics()
}
}
openGitHub () {
this.electron.shell.openExternal('https://github.com/eugeny/terminus')
}
reportBug () {
let body = `Version: ${this.appVersion}\n`
body += `Platform: ${os.platform()} ${os.release()}\n`
let label = {
darwin: 'OS: macOS',
windows: 'OS: Windows',
linux: 'OS: Linux',
}[os.platform()]
let plugins = (window as any).installedPlugins.filter(x => !x.isBuiltin).map(x => x.name)
body += `Plugins: ${plugins.join(', ')}\n\n`
this.electron.shell.openExternal(`https://github.com/eugeny/terminus/issues/new?body=${encodeURIComponent(body)}&labels=${label}`)
}
enableAnalytics () {
const session = ua('UA-3278102-20')
session.set('cd1', this.appVersion)
session.set('cd2', process.platform)
session.pageview('/').send()
}
}

View File

@@ -1,7 +1,9 @@
import * as path from 'path'
import shellEscape = require('shell-escape')
import { Observable, Subject } from 'rxjs'
import { Injectable, NgZone, EventEmitter } from '@angular/core'
import { ElectronService } from '../services/electron.service'
import { Logger, LogService } from '../services/log.service'
import { ElectronService } from './electron.service'
import { Logger, LogService } from './log.service'
export enum Platform {
Linux, macOS, Windows,
@@ -14,24 +16,27 @@ export interface Bounds {
height: number
}
export interface SecondInstanceArgs {
argv: string[],
cwd: string
}
@Injectable()
export class HostAppService {
platform: Platform
nodePlatform: string
ready = new EventEmitter<any>()
shown = new EventEmitter<any>()
isFullScreen = false
private preferencesMenu = new Subject<void>()
private secondInstance = new Subject<SecondInstanceArgs>()
private secondInstance = new Subject<void>()
private cliOpenDirectory = new Subject<string>()
private cliRunCommand = new Subject<string[]>()
private cliPaste = new Subject<string>()
private configChangeBroadcast = new Subject<void>()
private logger: Logger
private windowId: number
get preferencesMenu$ (): Observable<void> { return this.preferencesMenu }
get secondInstance$ (): Observable<SecondInstanceArgs> { return this.secondInstance }
get secondInstance$ (): Observable<void> { return this.secondInstance }
get cliOpenDirectory$ (): Observable<string> { return this.cliOpenDirectory }
get cliRunCommand$ (): Observable<string[]> { return this.cliRunCommand }
get cliPaste$ (): Observable<string> { return this.cliPaste }
get configChangeBroadcast$ (): Observable<void> { return this.configChangeBroadcast }
constructor (
private zone: NgZone,
@@ -46,9 +51,12 @@ export class HostAppService {
linux: Platform.Linux
}[this.nodePlatform]
this.windowId = parseInt(location.search.substring(1))
this.logger.info('Window ID:', this.windowId)
electron.ipcRenderer.on('host:preferences-menu', () => this.zone.run(() => this.preferencesMenu.next()))
electron.ipcRenderer.on('uncaughtException', ($event, err) => {
electron.ipcRenderer.on('uncaughtException', (_$event, err) => {
this.logger.error('Unhandled exception:', err)
})
@@ -64,17 +72,33 @@ export class HostAppService {
this.zone.run(() => this.shown.emit())
})
electron.ipcRenderer.on('host:second-instance', ($event, argv: string[], cwd: string) => {
this.zone.run(() => this.secondInstance.next({ argv, cwd }))
})
electron.ipcRenderer.on('host:second-instance', (_$event, argv: any, cwd: string) => this.zone.run(() => {
this.logger.info('Second instance', argv)
const op = argv._[0]
if (op === 'open') {
this.cliOpenDirectory.next(path.resolve(cwd, argv.directory))
} else if (op === 'run') {
this.cliRunCommand.next(argv.command)
} else if (op === 'paste') {
let text = argv.text
if (argv.escape) {
text = shellEscape([text])
}
this.cliPaste.next(text)
}
}))
this.ready.subscribe(() => {
electron.ipcRenderer.send('app:ready')
})
electron.ipcRenderer.on('host:config-change', () => this.zone.run(() => {
this.configChangeBroadcast.next()
}))
}
getWindow () {
return this.electron.app.window
return this.electron.BrowserWindow.fromId(this.windowId)
}
newWindow () {
this.electron.ipcRenderer.send('app:new-window')
}
getShell () {
@@ -91,7 +115,7 @@ export class HostAppService {
toggleFullscreen () {
let window = this.getWindow()
window.setFullScreen(!window.isFullScreen())
window.setFullScreen(!this.isFullScreen)
}
openDevTools () {
@@ -136,6 +160,26 @@ export class HostAppService {
}
}
setTitle (title: string) {
this.electron.ipcRenderer.send('window-set-title', title)
}
setTouchBar (touchBar: Electron.TouchBar) {
this.getWindow().setTouchBar(touchBar)
}
popupContextMenu (menuDefinition: Electron.MenuItemConstructorOptions[]) {
this.electron.ipcRenderer.send('window-popup-context-menu', menuDefinition)
}
broadcastConfigChange () {
this.electron.ipcRenderer.send('app:config-change')
}
emitReady () {
this.electron.ipcRenderer.send('app:ready')
}
quit () {
this.logger.info('Quitting')
this.electron.app.quit()

View File

@@ -174,6 +174,10 @@ export class HotkeysService {
@Injectable()
export class AppHotkeyProvider extends HotkeyProvider {
hotkeys: IHotkeyDescription[] = [
{
id: 'new-window',
name: 'New window',
},
{
id: 'toggle-window',
name: 'Toggle terminal window',

View File

@@ -0,0 +1,85 @@
import * as path from 'path'
import * as fs from 'mz/fs'
import { exec } from 'mz/child_process'
import { Injectable } from '@angular/core'
import { ElectronService } from './electron.service'
import { HostAppService, Platform } from './hostApp.service'
let Registry = null
try {
Registry = require('winreg')
} catch (_) { } // tslint:disable-line no-empty
@Injectable()
export class ShellIntegrationService {
private automatorWorkflows = ['Open Terminus here.workflow', 'Paste path into Terminus.workflow']
private automatorWorkflowsLocation: string
private automatorWorkflowsDestination: string
private registryKeys = [
{
path: '\\Software\\Classes\\Directory\\Background\\shell\\Open Terminus here',
command: 'open "%V"'
},
{
path: '\\Software\\Classes\\*\\shell\\Paste path into Terminus',
command: 'paste "%V"'
},
]
constructor (
private electron: ElectronService,
private hostApp: HostAppService,
) {
if (this.hostApp.platform === Platform.macOS) {
this.automatorWorkflowsLocation = path.join(
path.dirname(path.dirname(this.electron.app.getPath('exe'))),
'Resources',
'extras',
'automator-workflows',
)
this.automatorWorkflowsDestination = path.join(process.env.HOME, 'Library', 'Services')
}
}
async isInstalled (): Promise<boolean> {
if (this.hostApp.platform === Platform.macOS) {
return await fs.exists(path.join(this.automatorWorkflowsDestination, this.automatorWorkflows[0]))
} else if (this.hostApp.platform === Platform.Windows) {
return await new Promise<boolean>(resolve => {
let reg = new Registry({ hive: Registry.HKCU, key: this.registryKeys[0].path, arch: 'x64' })
reg.keyExists((err, exists) => resolve(!err && exists))
})
}
return true
}
async install () {
if (this.hostApp.platform === Platform.macOS) {
for (let wf of this.automatorWorkflows) {
await exec(`cp -r "${this.automatorWorkflowsLocation}/${wf}" "${this.automatorWorkflowsDestination}"`)
}
} else if (this.hostApp.platform === Platform.Windows) {
for (let registryKey of this.registryKeys) {
let reg = new Registry({ hive: Registry.HKCU, key: registryKey.path, arch: 'x64' })
await new Promise(resolve => {
reg.set('Icon', Registry.REG_SZ, this.electron.app.getPath('exe'), () => {
reg.create(() => {
let cmd = new Registry({
hive: Registry.HKCU,
key: registryKey.path + '\\command',
arch: 'x64'
})
cmd.create(() => {
cmd.set(
'',
Registry.REG_SZ,
this.electron.app.getPath('exe') + ' ' + registryKey.command,
() => resolve()
)
})
})
})
})
}
}
}
}

View File

@@ -1,20 +1,20 @@
import { Injectable, Inject, NgZone } from '@angular/core'
import { TouchBarSegmentedControl, SegmentedControlSegment } from 'electron'
import { Subscription } from 'rxjs'
import { AppService } from './app.service'
import { ConfigService } from './config.service'
import { ElectronService } from './electron.service'
import { BaseTabComponent } from '../components/baseTab.component'
import { HostAppService } from './hostApp.service'
import { IToolbarButton, ToolbarButtonProvider } from '../api'
@Injectable()
export class TouchbarService {
private titleSubscriptions = new Map<BaseTabComponent, Subscription>()
private tabsSegmentedControl: TouchBarSegmentedControl
private tabSegments: SegmentedControlSegment[] = []
private nsImageCache: {[id: string]: Electron.NativeImage} = {}
constructor (
private app: AppService,
private hostApp: HostAppService,
@Inject(ToolbarButtonProvider) private toolbarButtonProviders: ToolbarButtonProvider[],
private config: ConfigService,
private electron: ElectronService,
@@ -23,15 +23,10 @@ export class TouchbarService {
app.tabsChanged$.subscribe(() => this.update())
app.activeTabChange$.subscribe(() => this.update())
app.tabOpened$.subscribe(tab => {
let sub = tab.titleChange$.subscribe(title => {
tab.titleChange$.subscribe(title => {
this.tabSegments[app.tabs.indexOf(tab)].label = this.shortenTitle(title)
this.tabsSegmentedControl.segments = this.tabSegments
})
this.titleSubscriptions.set(tab, sub)
})
app.tabClosed$.subscribe(tab => {
this.titleSubscriptions.get(tab).unsubscribe()
this.titleSubscriptions.delete(tab)
})
}
@@ -56,14 +51,25 @@ export class TouchbarService {
this.tabsSegmentedControl,
new this.electron.TouchBar.TouchBarSpacer({size: 'flexible'}),
new this.electron.TouchBar.TouchBarSpacer({size: 'small'}),
...buttons.map(button => new this.electron.TouchBar.TouchBarButton({
label: this.shortenTitle(button.touchBarTitle || button.title),
// backgroundColor: '#0022cc',
click: () => this.zone.run(() => button.click()),
}))
...buttons.map(button => this.getButton(button))
]
})
this.electron.app.window.setTouchBar(touchBar)
this.hostApp.setTouchBar(touchBar)
}
private getButton (button: IToolbarButton): Electron.TouchBarButton {
return new this.electron.TouchBar.TouchBarButton({
label: button.touchBarNSImage ? null : this.shortenTitle(button.touchBarTitle || button.title),
icon: button.touchBarNSImage ? this.getCachedNSImage(button.touchBarNSImage) : null,
click: () => this.zone.run(() => button.click()),
})
}
private getCachedNSImage (name: string) {
if (!this.nsImageCache[name]) {
this.nsImageCache[name] = this.electron.nativeImage.createFromNamedImage(name, [0, 0, 1])
}
return this.nsImageCache[name]
}
private shortenTitle (title: string): string {

View File

@@ -0,0 +1,398 @@
$black: #002b36;
$base02: #073642;
$base01: #586e75;
$base00: #657b83;
$base0: #839496;
$base1: #93a1a1;
$base2: #eee8d5;
$white: #fdf6e3;
$yellow: #b58900;
$orange: #cb4b16;
$red: #dc322f;
$pink: #d33682;
$purple: #6c71c4;
$blue: #268bd2;
$teal: #2aa198;
$green: #859900;
$tab-border-radius: 5px;
$button-hover-bg: rgba(0, 0, 0, .125);
$button-active-bg: rgba(0, 0, 0, .25);
$theme-colors: (
"primary": $orange,
"secondary": $base0
);
$content-bg: rgba($white, 0.65);
$content-bg-solid: $white;
$body-bg: $base2;
$body-bg2: $base1;
$body-color: $black;
$font-family-sans-serif: "Source Sans Pro";
$font-size-base: 14rem / 16;
$btn-border-radius: 0;
$nav-tabs-border-width: 0;
$nav-tabs-border-radius: 0;
$nav-tabs-link-hover-border-color: $body-bg;
$nav-tabs-active-link-hover-color: $white;
$nav-tabs-active-link-hover-bg: $blue;
$nav-tabs-active-link-hover-border-color: darken($blue, 30%);
$nav-pills-border-radius: 0;
$input-bg: $base2;
$input-disabled-bg: $base1;
$input-color: $body-color;
$input-color-placeholder: $base1;
$input-border-color: $base1;
//$input-box-shadow: inset 0 1px 1px rgba($black,.075);
$input-border-radius: 0;
$custom-select-border-radius: 0;
$input-bg-focus: $input-bg;
//$input-border-focus: lighten($brand-primary, 25%);
//$input-box-shadow-focus: $input-box-shadow, rgba($input-border-focus, .6);
$input-color-focus: $input-color;
$input-group-addon-bg: $body-bg;
$input-group-addon-border-color: $input-border-color;
$modal-content-bg: $content-bg-solid;
$modal-content-border-color: $body-bg;
$modal-header-border-color: transparent;
$modal-footer-border-color: transparent;
$popover-bg: $body-bg;
$dropdown-bg: $body-bg;
$dropdown-link-color: $body-color;
$dropdown-link-hover-color: #333;
$dropdown-link-hover-bg: $body-bg2;
//$dropdown-link-active-color: $component-active-color;
//$dropdown-link-active-bg: $component-active-bg;
$dropdown-link-disabled-color: #333;
$dropdown-header-color: #333;
$list-group-color: $body-color;
$list-group-bg: rgba($black,.05);
$list-group-border-color: rgba($black,.1);
$list-group-hover-bg: rgba($black,.1);
$list-group-link-active-bg: rgba($black,.2);
$list-group-action-color: $body-color;
$list-group-action-bg: rgba($black,.05);
$list-group-action-active-bg: $list-group-link-active-bg;
$list-group-border-radius: 0;
$pre-bg: $dropdown-bg;
$pre-color: $dropdown-link-color;
$alert-danger-bg: $body-bg;
$alert-danger-text: $red;
$alert-danger-border: $red;
$headings-font-weight: lighter;
$headings-color: $base0;
@import '~bootstrap/scss/bootstrap.scss';
window-controls {
svg {
transition: 0.25s fill;
fill: $base01;
}
button:hover {
background: rgba($black, 0.125);
svg {
fill: $black;
}
}
.btn-close:hover {
background: #8a2828;
}
}
$border-color: $base1;
body {
background: $body-bg;
&.vibrant {
background: rgba(255, 255, 255,.4) !important;
}
}
app-root {
&> .content {
.tab-bar {
height: 40px;
.btn-tab-bar {
background: transparent;
line-height: 42px;
svg {
fill: $black;
fill-opacity: 0.75;
}
&:hover { background: rgba(0, 0, 0, .125) !important; }
&:active { background: rgba(0, 0, 0, .25) !important; }
}
&>.tabs {
tab-header {
border-left: 1px solid transparent;
border-right: 1px solid transparent;
color: $base01;
transition: 0.125s ease-out width;
.index {
color: rgba($black, 0.4);
}
button {
color: $body-color;
border: none;
transition: 0.25s all;
&:hover { background: $button-hover-bg !important; }
&:active { background: $button-active-bg !important; }
}
.progressbar {
background: $blue;
}
&.active {
color: $black;
background: $content-bg;
border-left: 1px solid $border-color;
border-right: 1px solid $border-color;
}
}
}
}
&.tabs-on-top .tab-bar {
&>.background {
border-bottom: 1px solid $border-color;
}
tab-header {
border-bottom: 1px solid $border-color;
&.active {
border-bottom-color: transparent;
}
&.has-activity:not(.active) {
background: linear-gradient(to bottom, rgba(208, 0, 0, 0) 95%, #36beff 96%);
}
}
}
&:not(.tabs-on-top) .tab-bar {
&>.background {
border-top: 1px solid $border-color;
}
tab-header {
border-top: 1px solid $border-color;
&.active {
margin-top: -1px;
}
&.has-activity:not(.active) {
background: linear-gradient(to top, rgba(208, 0, 0, 0) 95%, #36beff 96%);
}
}
}
}
&.platform-win32, &.platform-linux {
border: 1px solid #111;
&>.content .tab-bar .tabs tab-header:first-child {
border-left: none;
}
}
}
tab-body {
background: $content-bg;
}
settings-tab > ngb-tabset {
border-right: 1px solid $body-bg;
& > .nav {
background: rgba(0, 0, 0, 0.25);
& > .nav-item > .nav-link {
border: none;
padding: 10px 50px 10px 20px;
font-size: 14px;
&:not(.active) {
color: $body-color;
}
}
}
}
multi-hotkey-input {
.item {
background: $body-bg2;
border: 1px solid $blue;
border-radius: 3px;
margin-right: 5px;
.body {
padding: 3px 0 2px;
.stroke {
padding: 0 6px;
border-right: 1px solid $content-bg;
}
}
.remove {
padding: 3px 8px 2px;
}
}
.add {
color: #777;
padding: 4px 10px 0;
}
.add, .item .body, .item .remove {
&:hover { background: darken($body-bg2, 5%); }
&:active { background: darken($body-bg2, 15%); }
}
}
hotkey-input-modal {
.input {
background: $input-bg;
padding: 10px;
font-size: 24px;
line-height: 27px;
height: 55px;
.stroke {
background: $body-bg2;
border: 1px solid $blue;
border-radius: 3px;
margin-right: 10px;
padding: 3px 10px;
}
}
.timeout {
background: $input-bg;
div {
background: $blue;
}
}
}
.form-group label {
margin-bottom: 2px;
}
.nav-tabs {
.nav-link {
transition: 0.25s all;
border-bottom-color: $nav-tabs-border-color;
}
}
ngb-tabset .tab-content {
padding-top: 20px;
}
[ngbradiogroup] > label.active {
background: $blue;
}
.btn {
i + * {
margin-left: 5px;
}
&.btn-lg i + * {
margin-left: 10px;
}
}
.input-group-addon + .form-control {
border-left: none;
}
.input-group > select.form-control {
flex-direction: row;
}
.list-group-item {
transition: 0.25s background;
&:not(:first-child) {
border-top: none;
}
i + * {
margin-left: 10px;
}
}
select.form-control {
-webkit-appearance: none;
background-image: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'><path fill='#444' d='M7.406 7.828l4.594 4.594 4.594-4.594 1.406 1.406-6 6-6-6z'></path></svg>");
background-position: 100% 50%;
background-repeat: no-repeat;
padding-right: 30px;
}
checkbox i.on {
color: $blue;
}
toggle {
.body {
border-color: $base0 !important;
.toggle {
background: $base0 !important;
}
}
&.active .body .toggle {
background: theme-colors(primary) !important;
}
}
.list-group-item svg {
fill: $black;
}
.terminus-title {
color: $base01;
}
.terminus-logo {
filter: saturate(0);
}
start-page footer {
background: $white !important;
}

View File

@@ -14,13 +14,17 @@ $teal: #5bc0de !default;
$pink: #ff5b77 !default;
$purple: #613d7c !default;
$theme-colors: (
"primary": $blue,
"secondary": #394b5d
);
$content-bg: rgba(39, 49, 60, 0.65); //#1D272D;
$content-bg-solid: #1D272D;
$body-bg: #131d27;
$body-bg2: #20333e;
$body-color: #aaa;
$body-color: #ccc;
$font-family-sans-serif: "Source Sans Pro";
$font-size-base: 14rem / 16;
@@ -32,16 +36,16 @@ $btn-secondary-border: #444;
//$btn-warning-bg: rgba($orange, .5);
$nav-tabs-border-color: $body-bg;
$nav-tabs-border-width: 1px;
$nav-tabs-border-width: 0;
$nav-tabs-border-radius: 0;
$nav-tabs-link-hover-border-color: $body-bg;
$nav-tabs-active-link-hover-color: $white;
$nav-tabs-active-link-hover-bg: $blue;
$nav-tabs-active-link-hover-border-color: darken($blue, 30%);
$nav-pills-border-radius: 0;
$input-bg: #111;
$input-bg-disabled: #333;
$input-disabled-bg: #333;
$input-color: $body-color;
$input-color-placeholder: #333;
@@ -78,6 +82,10 @@ $list-group-border-color: rgba(255,255,255,.1);
$list-group-hover-bg: rgba(255,255,255,.1);
$list-group-link-active-bg: rgba(255,255,255,.2);
$list-group-action-color: $body-color;
$list-group-action-bg: rgba(255,255,255,.05);
$list-group-action-active-bg: $list-group-link-active-bg;
$pre-bg: $dropdown-bg;
$pre-color: $dropdown-link-color;
@@ -119,9 +127,9 @@ app-root {
&> .content {
.tab-bar {
.btn-tab-bar {
&:not(:hover):not(:active) {
background: transparent;
}
background: transparent;
&:hover { background: rgba(0, 0, 0, .25) !important; }
&:active { background: rgba(0, 0, 0, .5) !important; }
}
&>.tabs {
@@ -129,10 +137,10 @@ app-root {
border-left: 1px solid transparent;
border-right: 1px solid transparent;
transition: 0.25s all;
transition: 0.125s ease-out width;
.index {
color: #888;
color: rgba(255, 255, 255, 0.4);
}
button {
@@ -144,6 +152,10 @@ app-root {
&:active { background: $button-active-bg !important; }
}
.progressbar {
background: $green;
}
&.active {
color: white;
background: $content-bg;
@@ -210,10 +222,7 @@ settings-tab > ngb-tabset {
background: rgba(0, 0, 0, 0.25);
& > .nav-item > .nav-link {
border-left: none;
border-right: none;
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
border: none;
padding: 10px 50px 10px 20px;
font-size: 14px;
@@ -224,11 +233,6 @@ settings-tab > ngb-tabset {
color: $white;
}
}
&.active {
border-top-color: $nav-tabs-active-link-hover-border-color;
border-bottom-color: $nav-tabs-active-link-hover-border-color;
}
}
}
}
@@ -346,5 +350,14 @@ select.form-control {
}
checkbox i.on {
color: $blue;
color: $blue;
}
toggle.active .body .toggle {
background: $blue;
}
.list-group-item svg {
fill: white;
fill-opacity: 0.75;
}

View File

@@ -14,3 +14,10 @@ export class StandardCompactTheme extends Theme {
css = require('./theme.compact.scss')
terminalBackground = '#1D272D'
}
@Injectable()
export class PaperTheme extends Theme {
name = 'Paper'
css = require('./theme.paper.scss')
terminalBackground = '#1D272D'
}

View File

@@ -14,6 +14,7 @@ module.exports = {
libraryTarget: 'umd',
devtoolModuleFilenameTemplate: 'webpack-terminus-core:///[resource-path]',
},
mode: process.env.DEV ? 'development' : 'production',
resolve: {
modules: ['.', 'src', 'node_modules', '../app/node_modules'].map(x => path.join(__dirname, x)),
extensions: ['.ts', '.js'],

View File

@@ -20,16 +20,47 @@
dependencies:
"@types/node" "*"
ajv@^5.1.0:
version "5.5.2"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965"
dependencies:
co "^4.6.0"
fast-deep-equal "^1.0.0"
fast-json-stable-stringify "^2.0.0"
json-schema-traverse "^0.3.0"
argparse@^1.0.7:
version "1.0.9"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86"
dependencies:
sprintf-js "~1.0.2"
asn1@~0.2.3:
version "0.2.4"
resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136"
dependencies:
safer-buffer "~2.1.0"
assert-plus@1.0.0, assert-plus@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
async@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/async/-/async-1.0.0.tgz#f8fc04ca3a13784ade9e1641af98578cfbd647a9"
asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
aws-sign2@~0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
aws4@^1.6.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
axios@0.16.2:
version "0.16.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.16.2.tgz#ba4f92f17167dfbab40983785454b9ac149c3c6d"
@@ -37,6 +68,12 @@ axios@0.16.2:
follow-redirects "^1.2.3"
is-buffer "^1.1.5"
bcrypt-pbkdf@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"
dependencies:
tweetnacl "^0.14.3"
bluebird-lst@^1.0.2, bluebird-lst@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/bluebird-lst/-/bluebird-lst-1.0.3.tgz#cc56c18660eff0a0b86e2c33d1659618f7005158"
@@ -47,31 +84,76 @@ bluebird@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c"
bootstrap@4.0.0-alpha.6:
version "4.0.0-alpha.6"
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.0.0-alpha.6.tgz#4f54dd33ac0deac3b28407bc2df7ec608869c9c8"
boom@4.x.x:
version "4.3.1"
resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31"
dependencies:
jquery ">=1.9.1"
tether "^1.4.0"
hoek "4.x.x"
boom@5.x.x:
version "5.2.0"
resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02"
dependencies:
hoek "4.x.x"
bootstrap@^4.1.3:
version "4.1.3"
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.1.3.tgz#0eb371af2c8448e8c210411d0cb824a6409a12be"
caseless@~0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
co@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
colors@1.0.x:
version "1.0.3"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b"
combined-stream@1.0.6, combined-stream@~1.0.5:
version "1.0.6"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818"
dependencies:
delayed-stream "~1.0.0"
core-js@^2.4.1:
version "2.5.1"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.1.tgz#ae6874dc66937789b80754ff5428df66819ca50b"
core-util-is@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
cryptiles@3.x.x:
version "3.1.2"
resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe"
dependencies:
boom "5.x.x"
cycle@1.0.x:
version "1.0.3"
resolved "https://registry.yarnpkg.com/cycle/-/cycle-1.0.3.tgz#21e80b2be8580f98b468f379430662b046c34ad2"
dashdash@^1.12.0:
version "1.14.1"
resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
dependencies:
assert-plus "^1.0.0"
debug@^2.4.5:
version "2.6.8"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc"
dependencies:
ms "2.0.0"
debug@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
dependencies:
ms "2.0.0"
debug@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.0.1.tgz#0564c612b521dc92d9f2988f0549e34f9c98db64"
@@ -82,6 +164,17 @@ deepmerge@^1.5.0:
version "1.5.1"
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-1.5.1.tgz#c053bf06fd7276f1994f70c09a0760cb61a56237"
delayed-stream@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
ecc-jsbn@~0.1.1:
version "0.1.2"
resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9"
dependencies:
jsbn "~0.1.0"
safer-buffer "^2.1.0"
electron-builder-http@~19.27.5:
version "19.27.5"
resolved "https://registry.yarnpkg.com/electron-builder-http/-/electron-builder-http-19.27.5.tgz#800865df2e618ffab9e5b3b895c15b4ce7fd7f17"
@@ -115,16 +208,48 @@ esprima@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804"
extend@~3.0.1:
version "3.0.2"
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
extsprintf@1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
extsprintf@^1.2.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
eyes@0.1.x:
version "0.1.8"
resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0"
fast-deep-equal@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614"
fast-json-stable-stringify@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
follow-redirects@^1.2.3:
version "1.2.4"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.2.4.tgz#355e8f4d16876b43f577b0d5ce2668b9723214ea"
dependencies:
debug "^2.4.5"
forever-agent@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
form-data@~2.3.1:
version "2.3.2"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099"
dependencies:
asynckit "^0.4.0"
combined-stream "1.0.6"
mime-types "^2.1.12"
fs-extra-p@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/fs-extra-p/-/fs-extra-p-4.4.0.tgz#729c601c4f4c701328921adc7cfe9b236f100660"
@@ -140,22 +265,60 @@ fs-extra@^4.0.0:
jsonfile "^3.0.0"
universalify "^0.1.0"
getpass@^0.1.1:
version "0.1.7"
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
dependencies:
assert-plus "^1.0.0"
graceful-fs@^4.1.2, graceful-fs@^4.1.6:
version "4.1.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
har-schema@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
har-validator@~5.0.3:
version "5.0.3"
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd"
dependencies:
ajv "^5.1.0"
har-schema "^2.0.0"
hawk@~6.0.2:
version "6.0.2"
resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038"
dependencies:
boom "4.x.x"
cryptiles "3.x.x"
hoek "4.x.x"
sntp "2.x.x"
hoek@4.x.x:
version "4.2.1"
resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb"
http-signature@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
dependencies:
assert-plus "^1.0.0"
jsprim "^1.2.2"
sshpk "^1.7.0"
is-buffer@^1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc"
isstream@0.1.x:
is-typedarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
isstream@0.1.x, isstream@~0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
jquery@>=1.9.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.2.1.tgz#5c4d9de652af6cd0a770154a631bba12b015c787"
js-yaml@^3.9.0, js-yaml@^3.9.1:
version "3.9.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.1.tgz#08775cebdfdd359209f0d2acd383c8f86a6904a0"
@@ -163,12 +326,37 @@ js-yaml@^3.9.0, js-yaml@^3.9.1:
argparse "^1.0.7"
esprima "^4.0.0"
jsbn@~0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
json-schema-traverse@^0.3.0:
version "0.3.1"
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340"
json-schema@0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
json-stringify-safe@~5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
jsonfile@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.1.tgz#a5ecc6f65f53f662c4415c7675a0331d0992ec66"
optionalDependencies:
graceful-fs "^4.1.6"
jsprim@^1.2.2:
version "1.4.1"
resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
dependencies:
assert-plus "1.0.0"
extsprintf "1.3.0"
json-schema "0.2.3"
verror "1.10.0"
lazy-val@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/lazy-val/-/lazy-val-1.0.2.tgz#d9b07fb1fce54cbc99b3c611de431b83249369b6"
@@ -181,6 +369,16 @@ macaddress@^0.2.7:
version "0.2.8"
resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12"
mime-db@~1.35.0:
version "1.35.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.35.0.tgz#0569d657466491283709663ad379a99b90d9ab47"
mime-types@^2.1.12, mime-types@~2.1.17:
version "2.1.19"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.19.tgz#71e464537a7ef81c15f2db9d97e913fc0ff606f0"
dependencies:
mime-db "~1.35.0"
ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
@@ -196,14 +394,64 @@ ngx-perfect-scrollbar@^6.0.0:
perfect-scrollbar "^1.3.0"
resize-observer-polyfill "^1.4.0"
oauth-sign@~0.8.2:
version "0.8.2"
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43"
perfect-scrollbar@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/perfect-scrollbar/-/perfect-scrollbar-1.3.0.tgz#61da56f94b58870d8e0a617bce649cee17d1e3b2"
performance-now@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
punycode@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
qs@~6.5.1:
version "6.5.2"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
request@2.86.0:
version "2.86.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.86.0.tgz#2b9497f449b0a32654c081a5cf426bbfb5bf5b69"
dependencies:
aws-sign2 "~0.7.0"
aws4 "^1.6.0"
caseless "~0.12.0"
combined-stream "~1.0.5"
extend "~3.0.1"
forever-agent "~0.6.1"
form-data "~2.3.1"
har-validator "~5.0.3"
hawk "~6.0.2"
http-signature "~1.2.0"
is-typedarray "~1.0.0"
isstream "~0.1.2"
json-stringify-safe "~5.0.1"
mime-types "~2.1.17"
oauth-sign "~0.8.2"
performance-now "^2.1.0"
qs "~6.5.1"
safe-buffer "^5.1.1"
tough-cookie "~2.3.3"
tunnel-agent "^0.6.0"
uuid "^3.1.0"
resize-observer-polyfill@^1.4.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.0.tgz#660ff1d9712a2382baa2cad450a4716209f9ca69"
safe-buffer@^5.0.1, safe-buffer@^5.1.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
version "2.1.2"
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
sax@^1.2.1:
version "1.2.4"
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
@@ -212,6 +460,16 @@ semver@^5.4.1:
version "5.4.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e"
shell-escape@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/shell-escape/-/shell-escape-0.2.0.tgz#68fd025eb0490b4f567a027f0bf22480b5f84133"
sntp@2.x.x:
version "2.1.0"
resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8"
dependencies:
hoek "4.x.x"
source-map-support@^0.4.16:
version "0.4.17"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.17.tgz#6f2150553e6375375d0ccb3180502b78c18ba430"
@@ -226,13 +484,48 @@ sprintf-js@~1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
sshpk@^1.7.0:
version "1.14.2"
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.2.tgz#c6fc61648a3d9c4e764fd3fcdf4ea105e492ba98"
dependencies:
asn1 "~0.2.3"
assert-plus "^1.0.0"
dashdash "^1.12.0"
getpass "^0.1.1"
safer-buffer "^2.0.2"
optionalDependencies:
bcrypt-pbkdf "^1.0.0"
ecc-jsbn "~0.1.1"
jsbn "~0.1.0"
tweetnacl "~0.14.0"
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:
version "1.4.0"
resolved "https://registry.yarnpkg.com/tether/-/tether-1.4.0.tgz#0f9fa171f75bf58485d8149e94799d7ae74d1c1a"
tough-cookie@~2.3.3:
version "2.3.4"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655"
dependencies:
punycode "^1.4.1"
tunnel-agent@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
dependencies:
safe-buffer "^5.0.1"
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
version "0.14.5"
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
universal-analytics@^0.4.17:
version "0.4.17"
resolved "https://registry.yarnpkg.com/universal-analytics/-/universal-analytics-0.4.17.tgz#b57a07e37446ebe4f32872b2152a44cbc5cc4b73"
dependencies:
debug "^3.0.0"
request "2.86.0"
uuid "^3.0.0"
universalify@^0.1.0:
version "0.1.1"
@@ -244,6 +537,22 @@ uuid-1345@^0.99.6:
dependencies:
macaddress "^0.2.7"
uuid@^3.0.0, uuid@^3.1.0:
version "3.3.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
verror@1.10.0:
version "1.10.0"
resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
dependencies:
assert-plus "^1.0.0"
core-util-is "1.0.2"
extsprintf "^1.2.0"
winreg@^1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/winreg/-/winreg-1.2.4.tgz#ba065629b7a925130e15779108cf540990e98d1b"
winston@^2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/winston/-/winston-2.4.0.tgz#808050b93d52661ed9fb6c26b3f0c826708b0aee"

View File

@@ -1,6 +1,6 @@
{
"name": "terminus-plugin-manager",
"version": "1.0.0-alpha.48",
"version": "1.0.0-alpha.55",
"description": "Terminus' plugin manager",
"keywords": [
"terminus-builtin-plugin"

View File

@@ -19,7 +19,7 @@ h3 Installed
.d-flex.flex-column.align-items-end.mr-3
div {{plugin.version}}
small.text-muted {{plugin.author}}
button.btn.btn-outline-primary(
button.btn.btn-secondary.ml-2(
*ngIf='npmInstalled && knownUpgrades[plugin.name]',
(click)='upgradePlugin(plugin)',
[disabled]='busy[plugin.name] != undefined'
@@ -27,19 +27,19 @@ h3 Installed
i.fa.fa-fw.fa-arrow-up(*ngIf='busy[plugin.name] != BusyState.Installing')
i.fa.fa-fw.fa-circle-o-notch.fa-spin(*ngIf='busy[plugin.name] == BusyState.Installing')
span Upgrade ({{knownUpgrades[plugin.name].version}})
button.btn.btn-outline-danger(
button.btn.btn-secondary.ml-2(
(click)='uninstallPlugin(plugin)',
*ngIf='!plugin.isBuiltin && npmInstalled',
[disabled]='busy[plugin.name] != undefined'
)
i.fa.fa-fw.fa-trash-o(*ngIf='busy[plugin.name] != BusyState.Uninstalling')
i.fa.fa-fw.fa-circle-o-notch.fa-spin(*ngIf='busy[plugin.name] == BusyState.Uninstalling')
button.btn.btn-outline-danger(
button.btn.btn-secondary.ml-2(
*ngIf='config.store.pluginBlacklist.includes(plugin.name)',
(click)='enablePlugin(plugin)'
)
i.fa.fa-fw.fa-play
button.btn.btn-outline-primary(
button.btn.btn-secondary.ml-2(
*ngIf='!config.store.pluginBlacklist.includes(plugin.name)',
(click)='disablePlugin(plugin)'
)
@@ -60,9 +60,10 @@ div(*ngIf='npmInstalled')
h3.mt-4 Available
.input-group.mb-4
.input-group-addon
i.fa.fa-fw.fa-circle-o-notch.fa-spin(*ngIf='!availablePluginsReady')
i.fa.fa-fw.fa-search(*ngIf='availablePluginsReady')
.input-group-prepend
.input-group-text
i.fa.fa-fw.fa-circle-o-notch.fa-spin(*ngIf='!availablePluginsReady')
i.fa.fa-fw.fa-search(*ngIf='availablePluginsReady')
input.form-control(
type='text',
'[(ngModel)]'='_1',
@@ -71,7 +72,7 @@ div(*ngIf='npmInstalled')
)
.list-group(*ngIf='availablePlugins$')
.list-group.mb-4(*ngIf='availablePlugins$')
ng-container(*ngFor='let plugin of (availablePlugins$|async|orderBy:"name")')
.list-group-item.flex-column.align-items-start(*ngIf='!isAlreadyInstalled(plugin)')
.d-flex.w-100
@@ -83,7 +84,7 @@ div(*ngIf='npmInstalled')
div {{plugin.version}}
small.text-muted {{plugin.author}}
i.fa.fa-check.text-success.ml-1(*ngIf='plugin.isOfficial', title='Official')
button.btn.btn-outline-primary(
button.btn.btn-primary(
(click)='installPlugin(plugin)',
[disabled]='busy[plugin.name] != undefined'
)

View File

@@ -13,6 +13,7 @@ module.exports = {
libraryTarget: 'umd',
devtoolModuleFilenameTemplate: 'webpack-terminus-plugin-manager:///[resource-path]',
},
mode: process.env.DEV ? 'development' : 'production',
resolve: {
modules: ['.', 'src', 'node_modules', '../app/node_modules'].map(x => path.join(__dirname, x)),
extensions: ['.ts', '.js'],

View File

@@ -1,6 +1,6 @@
{
"name": "terminus-settings",
"version": "1.0.0-alpha.48",
"version": "1.0.0-alpha.55",
"description": "Terminus terminal settings page",
"keywords": [
"terminus-builtin-plugin"

View File

@@ -19,7 +19,7 @@ export class ButtonProvider extends ToolbarButtonProvider {
return [{
icon: this.domSanitizer.bypassSecurityTrustHtml(require('./icons/cog.svg')),
title: 'Settings',
touchBarTitle: '⚙️',
touchBarNSImage: 'NSTouchBarComposeTemplate',
weight: 10,
click: () => this.open(),
}]

Some files were not shown because too many files have changed in this diff Show More