Copy selected terminal text with ctrl shift c

This commit is contained in:
Johannes Zellner
2023-06-13 15:27:16 +02:00
parent ce1181531a
commit 67c0a4f513
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -280,7 +280,7 @@ angular.module('Application').controller('TerminalController', ['$scope', '$tran
$scope.terminal.focus();
};
$scope.terminalCopy = function () {
$scope.terminalCopyToClipboard = function () {
if (!$scope.terminal) return;
// execCommand('copy') would copy any selection from the page, so do this only if terminal has a selection
@@ -363,6 +363,13 @@ angular.module('Application').controller('TerminalController', ['$scope', '$tran
});
});
window.addEventListener('keydown', function (event) {
if (event.key === 'C' && event.ctrlKey) { // ctrl shift c
event.preventDefault();
$scope.terminalCopyToClipboard();
}
});
$translate([ 'terminal.title' ]).then(function (tr) {
if (tr['terminal.title'] !== 'terminal.title') window.document.title = tr['terminal.title'];
});