I have the following code that is part of a React class component:
render () {
return (
<div id = 'remote-console'>
</div>
)
}
and my application currently opens a new browser window with a console interface. I was wondering how I would be able to make this window resizable (and have the xterm console fit to the new dimensions). I currently use the FitAddon addon for xterm, but I'm not sure how to get the console to resize to the size of the current window (including the height)
componentDidMount() {
this.console = new Terminal()
this.fitAddon = new FitAddon()
this.console.loadAddon(this.fitAddon)
this.console.open(document.getElementById('remote-console'))
this.fitAddon.fit()
window.onresize = function () {
this.fitAddon.fit()
}
}