Merge "Whitelist pageup and down keys in xterm"

This commit is contained in:
Zuul 2019-04-05 03:54:20 +00:00 committed by Gerrit Code Review
commit 5dd031a902
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)