diff --git a/app/config-default.js b/app/config-default.js index bf51c8f8..d56a7fb1 100644 --- a/app/config-default.js +++ b/app/config-default.js @@ -57,7 +57,13 @@ module.exports = { shell: '', // for environment variables - env: {} + env: {}, + + // set to false for no bell + bell: 'SOUND' + + // URL to custom bell + // bellSoundURL: 'http://example.com/bell.mp3', // for advanced config flags please refer to https://hyperterm.org/#cfg }, diff --git a/lib/components/term.js b/lib/components/term.js index 4066ebdf..ea57b4b0 100644 --- a/lib/components/term.js +++ b/lib/components/term.js @@ -39,6 +39,12 @@ export default class Term extends Component { this.term.prefs_.set('send-encoding', 'raw'); this.term.prefs_.set('alt-sends-what', 'browser-key'); + if (props.bell === 'SOUND') { + this.term.prefs_.set('audible-bell-sound', this.props.bellSoundURL); + } else { + this.term.prefs_.set('audible-bell-sound', ''); + } + this.term.onTerminalReady = () => { const io = this.term.io.push(); io.onVTKeystroke = io.sendString = props.onData; @@ -200,6 +206,12 @@ export default class Term extends Component { if (this.props.customCSS !== nextProps.customCSS) { this.term.prefs_.set('user-css', this.getStylesheet(nextProps.customCSS)); } + + if (this.props.bell === 'SOUND') { + this.term.prefs_.set('audible-bell-sound', this.props.bellSoundURL); + } else { + this.term.prefs_.set('audible-bell-sound', ''); + } } componentWillUnmount () { diff --git a/lib/components/terms.js b/lib/components/terms.js index 977b5c2c..fdbb7dca 100644 --- a/lib/components/terms.js +++ b/lib/components/terms.js @@ -143,7 +143,9 @@ export default class Terms extends Component { onResize: this.bind(this.props.onResize, null, uid), onTitle: this.bind(this.props.onTitle, null, uid), onData: this.bind(this.props.onData, null, uid), - onURLAbort: this.bind(this.props.onURLAbort, null, uid) + onURLAbort: this.bind(this.props.onURLAbort, null, uid), + bell: this.props.bell, + bellSoundURL: this.props.bellSoundURL }); return