Fix 2FA sizing issue, add support for copying text from xterm.js (#1825)
closes #1812, closes #1813
This commit is contained in:
parent
1b1c95d8ce
commit
b05048871c
2 changed files with 69 additions and 35 deletions
|
@ -81,6 +81,17 @@ export default () => {
|
|||
// @see https://github.com/xtermjs/xterm.js/issues/2265
|
||||
// @see https://github.com/xtermjs/xterm.js/issues/2230
|
||||
TerminalFit.fit(terminal);
|
||||
|
||||
// Add support for copying terminal text.
|
||||
terminal.attachCustomKeyEventHandler((e: KeyboardEvent) => {
|
||||
// Ctrl + C
|
||||
if (e.ctrlKey && (e.key === 'c')) {
|
||||
document.execCommand('copy');
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}, [ terminal, connected, terminalElement ]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue