From cc6c5eda9d2523ef4575c0acf3b351188f776c6f Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Sat, 8 Apr 2017 17:00:13 +0200 Subject: [PATCH] . --- app/src/terminal/components/settings.pug | 8 ++++---- .../terminal/components/terminal.userCSS.scss | 4 ++++ app/src/terminal/components/terminalTab.scss | 2 +- app/src/terminal/components/terminalTab.ts | 17 +++++++++++++++++ 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/app/src/terminal/components/settings.pug b/app/src/terminal/components/settings.pug index 905a3e1e..e66584b3 100644 --- a/app/src/terminal/components/settings.pug +++ b/app/src/terminal/components/settings.pug @@ -110,12 +110,12 @@ label.btn.btn-secondary input( type='radio', - [value]='"sound"' + [value]='"visual"' ) - | Sound + | Visual label.btn.btn-secondary input( type='radio', - [value]='"notification"' + [value]='"audible"' ) - | Notification + | Audible diff --git a/app/src/terminal/components/terminal.userCSS.scss b/app/src/terminal/components/terminal.userCSS.scss index 9c675e12..010c55f3 100644 --- a/app/src/terminal/components/terminal.userCSS.scss +++ b/app/src/terminal/components/terminal.userCSS.scss @@ -9,3 +9,7 @@ a:hover { * { font-feature-settings: "liga" 0; // disable ligatures (they break monospacing) } + +x-screen { + transition: 0.125s ease background; +} diff --git a/app/src/terminal/components/terminalTab.scss b/app/src/terminal/components/terminalTab.scss index f85f0f7c..aebf4fa3 100644 --- a/app/src/terminal/components/terminalTab.scss +++ b/app/src/terminal/components/terminalTab.scss @@ -2,7 +2,7 @@ flex: auto; display: flex; overflow: hidden; - + &> .content { flex: auto; position: relative; diff --git a/app/src/terminal/components/terminalTab.ts b/app/src/terminal/components/terminalTab.ts index 5b0a3370..8b39795a 100644 --- a/app/src/terminal/components/terminalTab.ts +++ b/app/src/terminal/components/terminalTab.ts @@ -17,6 +17,7 @@ export class TerminalTabComponent extends BaseTabComponent { hterm: any configSubscription: Subscription focusedSubscription: Subscription + bell$ = new Subject() size$ = new ReplaySubject(1) input$ = new Subject() output$ = new Subject() @@ -83,6 +84,17 @@ export class TerminalTabComponent extends BaseTabComponent { this.displayActivity() }) }, 1000) + + this.bell$.subscribe(() => { + if (this.config.full().terminal.bell != 'off') { + let bg = preferenceManager.get('background-color') + preferenceManager.set('background-color', 'rgba(128,128,128,.25)') + setTimeout(() => { + preferenceManager.set('background-color', bg) + }, 125) + } + // TODO audible + }) } attachHTermHandlers (hterm: any) { @@ -121,6 +133,10 @@ export class TerminalTabComponent extends BaseTabComponent { _onMouse_(event) } + hterm.ringBell = () => { + this.bell$.next() + } + for (let screen of [hterm.primaryScreen_, hterm.alternateScreen_]) { const _insertString = screen.insertString.bind(screen) screen.insertString = (data) => { @@ -203,6 +219,7 @@ export class TerminalTabComponent extends BaseTabComponent { this.contentUpdated$.complete() this.alternateScreenActive$.complete() this.mouseEvent$.complete() + this.bell$.complete() this.session.gracefullyDestroy() }