Compare commits

...

15 Commits

Author SHA1 Message Date
Eugene Pankov
437d832ac1 Merge branch 'master' of github.com:Eugeny/terminus 2020-04-21 09:38:50 +02:00
Eugene
c90aef1dfa Merge pull request #2438 from Goobles/Add-dock-hide-on-blur-option
Add dock hide on blur option
2020-04-21 09:38:35 +02:00
Eugene
2d25f15041 Merge branch 'master' into Add-dock-hide-on-blur-option 2020-04-21 09:38:28 +02:00
Eugene
1384e26dd8 Merge pull request #2437 from Goobles/dock-always-on-top-toggle
Add dock always on top setting
2020-04-21 09:37:50 +02:00
Eugene Pankov
809bf3360d Merge branch 'master' of github.com:Eugeny/terminus 2020-04-21 09:20:38 +02:00
Eugene
444875b82a Merge pull request #2444 from Eugeny/dependabot/npm_and_yarn/typescript-eslint/parser-2.29.0
Bump @typescript-eslint/parser from 2.27.0 to 2.29.0
2020-04-21 09:20:28 +02:00
Eugene Pankov
c261b64c8e bumped angular 2020-04-21 09:20:25 +02:00
Eugene Pankov
ab1b8a4500 added tab split commands to context menu - fixes #1321 2020-04-21 09:17:26 +02:00
Eugene Pankov
e65d5ba93b fixed webgl renderer (fixes #2439) 2020-04-21 09:09:23 +02:00
dependabot-preview[bot]
6f8ba6b44b Bump @typescript-eslint/parser from 2.27.0 to 2.29.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 2.27.0 to 2.29.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.29.0/packages/parser)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-21 04:22:41 +00:00
Gobius Dolhain
aede1c47a2 fix eslint comma-spacing 2020-04-20 19:21:48 +02:00
Gobius Dolhain
7b9ff043ad eslint: fix whitespace 2020-04-20 19:19:41 +02:00
Gobius Dolhain
d759104c76 add dock hide on blur option 2020-04-20 19:01:10 +02:00
Gobius Dolhain
676bbba7a4 Add dock always on top setting 2020-04-20 18:38:02 +02:00
Eugene Pankov
b8d9f6442a re-fixed #517 2020-04-20 15:35:15 +02:00
15 changed files with 98 additions and 36 deletions

View File

@@ -103,6 +103,12 @@ export class Window {
}
})
this.window.on('blur', () => {
if (this.configStore.appearance?.dockHideOnBlur) {
this.hide()
}
})
this.window.loadURL(`file://${app.getAppPath()}/dist/index.html?${this.window.id}`, { extraHeaders: 'pragma: no-cache\n' })
if (process.platform !== 'darwin') {
@@ -193,8 +199,13 @@ export class Window {
this.window.focus()
})
} else {
// docked, visible
this.window.hide()
if (this.configStore.appearance?.dockAlwaysOnTop) {
// docked, visible, on top
this.window.hide()
} else {
// docked, visible, not on top
this.window.focus()
}
}
}
}

View File

@@ -13,12 +13,12 @@
"watch": "webpack --progress --color --watch"
},
"dependencies": {
"@angular/animations": "9.1.0",
"@angular/animations": "9.1.2",
"@angular/common": "9.1.2",
"@angular/compiler": "9.1.2",
"@angular/core": "9.1.2",
"@angular/forms": "9.1.1",
"@angular/platform-browser": "9.1.1",
"@angular/forms": "9.1.2",
"@angular/platform-browser": "9.1.2",
"@angular/platform-browser-dynamic": "9.1.2",
"@ng-bootstrap/ng-bootstrap": "^6.0.2",
"devtron": "1.4.0",

View File

@@ -9,7 +9,7 @@
"@types/node": "12.7.12",
"@types/webpack-env": "1.15.0",
"@typescript-eslint/eslint-plugin": "^2.26.0",
"@typescript-eslint/parser": "^2.27.0",
"@typescript-eslint/parser": "^2.29.0",
"apply-loader": "2.0.0",
"awesome-typescript-loader": "^5.0.0",
"core-js": "^3.6.5",

View File

@@ -14,6 +14,11 @@ export interface BaseTabProcess {
* Abstract base class for custom tab components
*/
export abstract class BaseTabComponent {
/**
* Parent tab (usually a SplitTabComponent)
*/
parent: BaseTabComponent|null = null
/**
* Current tab title
*/

View File

@@ -358,6 +358,7 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
this.attachTabView(tab)
setImmediate(() => {
tab.parent = this
this.layout()
this.tabAdded.next(tab)
this.focus(tab)
@@ -374,11 +375,11 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
parent.children.splice(index, 1)
this.detachTabView(tab)
tab.parent = null
this.layout()
this.tabRemoved.next(tab)
if (this.root.children.length === 0) {
this.destroy()
} else {
@@ -569,6 +570,7 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
if (recovered) {
const tab = this.tabsService.create(recovered.type, recovered.options)
children.push(tab)
tab.parent = this
this.attachTabView(tab)
} else {
state.ratios.splice(state.children.indexOf(childState), 0)

View File

@@ -2,6 +2,8 @@ appearance:
dock: off
dockScreen: current
dockFill: 0.5
dockHideOnBlur: false
dockAlwaysOnTop: true
tabsLocation: top
cycleTabs: true
theme: Standard

View File

@@ -36,7 +36,7 @@ import { ConfigService } from './services/config.service'
import { StandardTheme, StandardCompactTheme, PaperTheme } from './theme'
import { CoreConfigProvider } from './config'
import { AppHotkeyProvider } from './hotkeys'
import { TaskCompletionContextMenu, CommonOptionsContextMenu, CloseContextMenu } from './tabContextMenu'
import { TaskCompletionContextMenu, CommonOptionsContextMenu, TabManagementContextMenu } from './tabContextMenu'
import 'perfect-scrollbar/css/perfect-scrollbar.css'
import 'ng2-dnd/bundles/style.css'
@@ -54,7 +54,7 @@ const PROVIDERS = [
{ provide: Theme, useClass: PaperTheme, multi: true },
{ provide: ConfigProvider, useClass: CoreConfigProvider, multi: true },
{ provide: TabContextMenuItemProvider, useClass: CommonOptionsContextMenu, multi: true },
{ provide: TabContextMenuItemProvider, useClass: CloseContextMenu, multi: true },
{ provide: TabContextMenuItemProvider, useClass: TabManagementContextMenu, multi: true },
{ provide: TabContextMenuItemProvider, useClass: TaskCompletionContextMenu, multi: true },
{ provide: TabRecoveryProvider, useClass: SplitTabRecoveryProvider, multi: true },
{ provide: PERFECT_SCROLLBAR_CONFIG, useValue: { suppressScrollX: true } },

View File

@@ -53,7 +53,9 @@ export class DockingService {
newBounds.y = display.bounds.y
}
this.hostApp.setAlwaysOnTop(true)
const alwaysOnTop = this.config.store.appearance.dockAlwaysOnTop
this.hostApp.setAlwaysOnTop(alwaysOnTop)
setImmediate(() => {
this.hostApp.setBounds(newBounds)
})

View File

@@ -4,11 +4,12 @@ import { Subscription } from 'rxjs'
import { AppService } from './services/app.service'
import { BaseTabComponent } from './components/baseTab.component'
import { TabHeaderComponent } from './components/tabHeader.component'
import { SplitTabComponent, SplitDirection } from './components/splitTab.component'
import { TabContextMenuItemProvider } from './api/tabContextMenuProvider'
/** @hidden */
@Injectable()
export class CloseContextMenu extends TabContextMenuItemProvider {
export class TabManagementContextMenu extends TabContextMenuItemProvider {
weight = -5
constructor (
@@ -19,7 +20,7 @@ export class CloseContextMenu extends TabContextMenuItemProvider {
}
async getItems (tab: BaseTabComponent, tabHeader?: TabHeaderComponent): Promise<Electron.MenuItemConstructorOptions[]> {
let items = [
let items: Electron.MenuItemConstructorOptions[] = [
{
label: 'Close',
click: () => this.zone.run(() => {
@@ -59,6 +60,24 @@ export class CloseContextMenu extends TabContextMenuItemProvider {
}),
},
]
} else {
if (tab.parent instanceof SplitTabComponent) {
const directions: SplitDirection[] = ['r', 'b', 'l', 't']
items.push({
label: 'Split',
submenu: directions.map(dir => ({
label: {
r: 'Right',
b: 'Down',
l: 'Left',
t: 'Up',
}[dir],
click: () => this.zone.run(() => {
(tab.parent as SplitTabComponent).splitTab(tab, dir)
}),
})) as Electron.MenuItemConstructorOptions[],
})
}
}
return items
}
@@ -87,8 +106,10 @@ export class CommonOptionsContextMenu extends TabContextMenuItemProvider {
}
async getItems (tab: BaseTabComponent, tabHeader?: TabHeaderComponent): Promise<Electron.MenuItemConstructorOptions[]> {
let items: Electron.MenuItemConstructorOptions[] = []
if (tabHeader) {
return [
items = [
...items,
{
label: 'Rename',
click: () => this.zone.run(() => tabHeader?.showRenameTabModal()),
@@ -111,7 +132,7 @@ export class CommonOptionsContextMenu extends TabContextMenuItemProvider {
},
]
}
return []
return items
}
}

View File

@@ -207,6 +207,15 @@ ngb-tabset.vertical(type='pills', [activeId]='activeTab')
)
| {{screen.name}}
.form-line(*ngIf='config.store.appearance.dock != "off"')
.header
.title Dock always on top
.description Keep docked terminal always on top
toggle(
[(ngModel)]='config.store.appearance.dockAlwaysOnTop',
(ngModelChange)='config.save(); docking.dock()',
)
.form-line(*ngIf='config.store.appearance.dock != "off"')
.header
.title Docked terminal size
@@ -219,6 +228,15 @@ ngb-tabset.vertical(type='pills', [activeId]='activeTab')
step='0.01'
)
.form-line(*ngIf='config.store.appearance.dock != "off"')
.header
.title Hide dock on blur
.description Hides the docked terminal when you click away.
toggle(
[(ngModel)]='config.store.appearance.dockHideOnBlur',
(ngModelChange)='config.save(); ',
)
.form-line
.header
.title Debugging

View File

@@ -27,7 +27,7 @@
"runes": "^0.4.2",
"slugify": "^1.4.0",
"uuid": "^7.0.1",
"xterm": "^4.5.0-beta.9",
"xterm": "^4.6.0-beta.17",
"xterm-addon-fit": "^0.4.0-beta.8",
"xterm-addon-ligatures": "^0.2.1",
"xterm-addon-search": "^0.7.0-beta.1",

View File

@@ -49,7 +49,7 @@ export class TerminalService {
}
getProfileID (profile: Profile): string {
return slugify(profile.name).toLowerCase()
return slugify(profile.name, { remove: /[:.]/g }).toLowerCase()
}
async getProfileByID (id: string): Promise<Profile> {

View File

@@ -91,8 +91,9 @@ export class WSLShellProvider extends ShellProvider {
const wslVersion = childKey.Flags.value & 8 ? 2 : 1
const name = childKey.DistributionName.value
const fsBase = wslVersion === 2 ? `\\\\wsl$\\${name}` : childKey.BasePath.value as string + '\\rootfs'
const slug = slugify(name, { remove: /[:.]/g })
const shell: Shell = {
id: `wsl-${slugify(name)}`,
id: `wsl-${slug}`,
name: `WSL / ${name}`,
command: wslPath,
args: ['-d', name],

View File

@@ -257,10 +257,10 @@ xterm-addon-webgl@^0.7.0-beta.5:
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.7.0-beta.5.tgz#20fbafcf2fb2c2438977c40fd41945d297ea0c25"
integrity sha512-Mf0PYiWe4GL8mcS4KnjVsosbvD2xSxUCappbTRNZ+5hQgmrayrr6UciKw7CasSLOsji8AHkoZJEl0MxMsTTEeg==
xterm@^4.5.0-beta.9:
version "4.5.0"
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.5.0.tgz#c7fd145c6cf91c9f2ef07011a9b35026cf4bfecc"
integrity sha512-4t12tsvtYnv13FBJwewddxdI/j4kSonmbQQv50j34R/rPIFbUNGtptbprmuUlTDAKvHLMDZ/Np2XcpNimga/HQ==
xterm@^4.6.0-beta.17:
version "4.6.0-beta.17"
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.6.0-beta.17.tgz#d3b448a7e09d65307f74ca862ce50847da891d89"
integrity sha512-/lG3pWSjejqPd58SSa1C24h3yarZkyVHefCt+3K2fqpV7EQTSnzl67RH3k/ojIflIX9d/JUQRqp/GGWnyyb2JQ==
yallist@^2.1.2:
version "2.1.2"

View File

@@ -283,24 +283,24 @@
eslint-scope "^5.0.0"
eslint-utils "^2.0.0"
"@typescript-eslint/experimental-utils@2.27.0":
version "2.27.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.27.0.tgz#801a952c10b58e486c9a0b36cf21e2aab1e9e01a"
integrity sha512-vOsYzjwJlY6E0NJRXPTeCGqjv5OHgRU1kzxHKWJVPjDYGbPgLudBXjIlc+OD1hDBZ4l1DLbOc5VjofKahsu9Jw==
"@typescript-eslint/experimental-utils@2.29.0":
version "2.29.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.29.0.tgz#3cb8060de9265ba131625a96bbfec31ba6d4a0fe"
integrity sha512-H/6VJr6eWYstyqjWXBP2Nn1hQJyvJoFdDtsHxGiD+lEP7piGnGpb/ZQd+z1ZSB1F7dN+WsxUDh8+S4LwI+f3jw==
dependencies:
"@types/json-schema" "^7.0.3"
"@typescript-eslint/typescript-estree" "2.27.0"
"@typescript-eslint/typescript-estree" "2.29.0"
eslint-scope "^5.0.0"
eslint-utils "^2.0.0"
"@typescript-eslint/parser@^2.27.0":
version "2.27.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.27.0.tgz#d91664335b2c46584294e42eb4ff35838c427287"
integrity sha512-HFUXZY+EdwrJXZo31DW4IS1ujQW3krzlRjBrFRrJcMDh0zCu107/nRfhk/uBasO8m0NVDbBF5WZKcIUMRO7vPg==
"@typescript-eslint/parser@^2.29.0":
version "2.29.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.29.0.tgz#6e3c4e21ed6393dc05b9d8b47f0b7e731ef21c9c"
integrity sha512-H78M+jcu5Tf6m/5N8iiFblUUv+HJDguMSdFfzwa6vSg9lKR8Mk9BsgeSjO8l2EshKnJKcbv0e8IDDOvSNjl0EA==
dependencies:
"@types/eslint-visitor-keys" "^1.0.0"
"@typescript-eslint/experimental-utils" "2.27.0"
"@typescript-eslint/typescript-estree" "2.27.0"
"@typescript-eslint/experimental-utils" "2.29.0"
"@typescript-eslint/typescript-estree" "2.29.0"
eslint-visitor-keys "^1.1.0"
"@typescript-eslint/typescript-estree@2.26.0":
@@ -316,10 +316,10 @@
semver "^6.3.0"
tsutils "^3.17.1"
"@typescript-eslint/typescript-estree@2.27.0":
version "2.27.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.27.0.tgz#a288e54605412da8b81f1660b56c8b2e42966ce8"
integrity sha512-t2miCCJIb/FU8yArjAvxllxbTiyNqaXJag7UOpB5DVoM3+xnjeOngtqlJkLRnMtzaRcJhe3CIR9RmL40omubhg==
"@typescript-eslint/typescript-estree@2.29.0":
version "2.29.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.29.0.tgz#1be6612bb02fc37ac9f466521c1459a4744e8d3a"
integrity sha512-3YGbtnWy4az16Egy5Fj5CckkVlpIh0MADtAQza+jiMADRSKkjdpzZp/5WuvwK/Qib3Z0HtzrDFeWanS99dNhnA==
dependencies:
debug "^4.1.1"
eslint-visitor-keys "^1.1.0"