From 35d56eeb68a147758806d7febf130b474fb779eb Mon Sep 17 00:00:00 2001 From: Tobias Henkel Date: Wed, 3 Apr 2019 20:50:50 +0200 Subject: [PATCH] Whitelist pageup and down keys in xterm We currently block all keys in xterm so we can use ctrl+c for copying text. However this blocks scrolling via shift+pageup and down. Whitelist those buttons so scrolling per keyboard works. This blocks scrolling per keyboard. In case this is still needed we should add it back with a specific blacklist or whitelist. Change-Id: Ida8c90f556912941af528d3c1fd322cf1256185d --- web/src/pages/Stream.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/pages/Stream.jsx b/web/src/pages/Stream.jsx index 273b171908..0af5e96794 100644 --- a/web/src/pages/Stream.jsx +++ b/web/src/pages/Stream.jsx @@ -99,7 +99,11 @@ class StreamPage extends React.Component { term.setOption('disableStdin', true) term.setOption('convertEol', true) - term.attachCustomKeyEventHandler(function () {return false}) + // Block all keys but page up/down. This needs to be done so ctrl+c can + // be used to copy text from the terminal. + term.attachCustomKeyEventHandler(function (e) { + return e.key === 'PageDown' || e.key === 'PageUp' + }) term.open(this.terminal)