This commit is contained in:
Eugene Pankov 2017-04-08 17:00:13 +02:00
parent 79cd2a3bbb
commit cc6c5eda9d
4 changed files with 26 additions and 5 deletions

View file

@ -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

View file

@ -9,3 +9,7 @@ a:hover {
* {
font-feature-settings: "liga" 0; // disable ligatures (they break monospacing)
}
x-screen {
transition: 0.125s ease background;
}

View file

@ -2,7 +2,7 @@
flex: auto;
display: flex;
overflow: hidden;
&> .content {
flex: auto;
position: relative;

View file

@ -17,6 +17,7 @@ export class TerminalTabComponent extends BaseTabComponent {
hterm: any
configSubscription: Subscription
focusedSubscription: Subscription
bell$ = new Subject()
size$ = new ReplaySubject<ResizeEvent>(1)
input$ = new Subject<string>()
output$ = new Subject<string>()
@ -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()
}