Skip to content
This repository has been archived by the owner on Jun 10, 2023. It is now read-only.

Commit

Permalink
Fix resize event.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Feb 1, 2017
1 parent 8e599aa commit a93aa28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/script-runner-process.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ class ScriptRunnerProcess
if @pty?
@pty.master.write(data)

@view.on 'resize', (cols, rows) =>
@view.on 'resize', (geometry) =>
if @pty?
@pty.resize(cols, rows)
@pty.resize(geometry.cols, geometry.rows)

@view.focus()

Expand Down
5 changes: 3 additions & 2 deletions lib/script-runner-view.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{$, View} = require 'atom-space-pen-views'
{Emitter} = require 'atom'
OnResize = require('element-resize-detector')(strategy: 'scroll');
OnResize = require('element-resize-detector')(strategy: 'scroll')
Terminal = require 'xterm'
Terminal.loadAddon 'fit'

Expand Down Expand Up @@ -93,7 +93,8 @@ class ScriptRunnerView extends View
}

@term.on 'resize', (geometry) =>
@emitter.emit 'resize', geometry.cols, geometry.rows
console.log("@term.resize", geometry)
@emitter.emit 'resize', geometry

parent = @output.get(0)
@term.open(parent)
Expand Down

0 comments on commit a93aa28

Please sign in to comment.