Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fit() {
this.fitAddon.fit()
ipc.send(`pty-resize-${this.id}`, {cols: this.xterm.cols, rows: this.xterm.rows})
}
componentDidMount() {
ipc.send('disable-shortcuts')
}
async kill() {
this.subscriptions.dispose()
this.xterm.dispose()
if (this._wrapperElement) {
this._container.removeChild(this._wrapperElement)
this._wrapperElement = null
}
const ptyId = await this.ptyId
this.xterm = null
await ipc.send(`pty-kill-${ptyId}`)
}
cleanup() {
this.subscriptions.dispose()
ipc.send('enable-shortcuts')
this.props.deactivate()
}
this.subscriptions.add(this.onData(data => {
ipc.send(`pty-write-${this.id}`, data)
}))
this.subscriptions.add(this.onTitle(this.setTitle))
keybindingHandler(e) {
let caught = false
const mapping = this.keymaps[keystrokeForKeyboardEvent(e)]
if (mapping) {
ipc.send(`pty-write-${this.id}`, mapping)
caught = true
}
return !caught
}