proper visual bell (fixes #131)

This commit is contained in:
Eugene Pankov 2017-07-23 20:55:41 +02:00
parent 49b90f15bc
commit 932ed9b8f2
4 changed files with 11 additions and 6 deletions

Binary file not shown.

View File

@ -32,6 +32,7 @@ export class TerminalTabComponent extends BaseTabComponent {
alternateScreenActive$ = new BehaviorSubject(false)
mouseEvent$ = new Subject<Event>()
htermVisible = false
private bellPlayer: HTMLAudioElement
private io: any
constructor (
@ -84,6 +85,8 @@ export class TerminalTabComponent extends BaseTabComponent {
this.resetZoom()
}
})
this.bellPlayer = document.createElement('audio')
this.bellPlayer.src = require<string>('../bell.ogg')
}
getRecoveryToken (): any {
@ -126,13 +129,15 @@ export class TerminalTabComponent extends BaseTabComponent {
}, 1000)
this.bell$.subscribe(() => {
if (this.config.store.terminal.bell !== 'off') {
let bg = preferenceManager.get('background-color')
if (this.config.store.terminal.bell === 'visual') {
preferenceManager.set('background-color', 'rgba(128,128,128,.25)')
setTimeout(() => {
preferenceManager.set('background-color', bg)
this.configure()
}, 125)
}
if (this.config.store.terminal.bell === 'audible') {
this.bellPlayer.play()
}
// TODO audible
})
}
@ -246,7 +251,7 @@ export class TerminalTabComponent extends BaseTabComponent {
preferenceManager.set('font-family', `"${config.terminal.font}", "monospace-fallback", monospace`)
this.setFontSize()
preferenceManager.set('enable-bold', true)
preferenceManager.set('audible-bell-sound', '')
// preferenceManager.set('audible-bell-sound', '')
preferenceManager.set('desktop-notification-bell', config.terminal.bell === 'notification')
preferenceManager.set('enable-clipboard-notice', false)
preferenceManager.set('receive-encoding', 'raw')

View File

@ -87,7 +87,7 @@ export class ScreenPersistenceProvider extends SessionPersistenceProvider {
let configPath = '/tmp/.termScreenConfig'
await fs.writeFile(configPath, `
escape ^^^
vbell on
vbell off
deflogin on
defflow off
term xterm-color

View File

@ -35,7 +35,7 @@ module.exports = {
{ test: /\.scss$/, use: ['to-string-loader', 'css-loader', 'sass-loader'] },
{ test: /\.css$/, use: ['to-string-loader', 'css-loader'] },
{
test: /\.(ttf|eot|otf|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
test: /\.(ttf|eot|otf|woff|woff2|ogg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "url-loader",
options: {
limit: 999999999999,