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
This commit is contained in:
Tobias Henkel 2019-04-03 20:50:50 +02:00
parent 4af8c52a2e
commit 35d56eeb68
No known key found for this signature in database
GPG Key ID: 03750DEC158E5FA2
1 changed files with 5 additions and 1 deletions

View File

@ -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)