diff --git a/examples/electron/index.html b/examples/electron/index.html
index f3ec65cfc..4aa1368fe 100644
--- a/examples/electron/index.html
+++ b/examples/electron/index.html
@@ -3,7 +3,7 @@
node-pty Electron example
-
+
diff --git a/examples/electron/package.json b/examples/electron/package.json
index 09e46fd8c..702b8a148 100644
--- a/examples/electron/package.json
+++ b/examples/electron/package.json
@@ -11,6 +11,6 @@
"dependencies": {
"electron": "4.0.1",
"node-pty": "^0.8.0",
- "xterm": "^3.14.0"
+ "xterm": "^4.0.0"
}
}
diff --git a/examples/electron/renderer.js b/examples/electron/renderer.js
index b853387f1..8adb742ed 100644
--- a/examples/electron/renderer.js
+++ b/examples/electron/renderer.js
@@ -17,9 +17,7 @@ const xterm = new Terminal();
xterm.open(document.getElementById('xterm'));
// Setup communication between xterm.js and node-pty
-xterm.on('data', (data) => {
- ptyProcess.write(data);
-});
+xterm.onData(data => ptyProcess.write(data));
ptyProcess.on('data', function (data) {
xterm.write(data);
});