From 57921e3fe008f5b841939a18fbf1b0531d87dc3b Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 19 Jun 2017 11:18:55 -0700 Subject: [PATCH 1/3] Render selection on top of rows Fixes #718 --- src/xterm.css | 4 +++- src/xterm.js | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/xterm.css b/src/xterm.css index 37f661a7..eef60b45 100644 --- a/src/xterm.css +++ b/src/xterm.css @@ -192,11 +192,13 @@ position: absolute; top: 0; left: 0; + z-index: 1; + opacity: 0.3; } .terminal .xterm-selection div { position: absolute; - background-color: #555; + background-color: #fff; } /* diff --git a/src/xterm.js b/src/xterm.js index 0abcbeae..9bfb275b 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -647,8 +647,7 @@ Terminal.prototype.open = function(parent, focus) { this.viewportScrollArea.classList.add('xterm-scroll-area'); this.viewportElement.appendChild(this.viewportScrollArea); - // Create the selection container. This needs to be added before the - // rowContainer as the selection must be below the text. + // Create the selection container. this.selectionContainer = document.createElement('div'); this.selectionContainer.classList.add('xterm-selection'); this.element.appendChild(this.selectionContainer); From 6dbc476cdc5ad9b23d1d6086585d26ea265b8328 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 19 Jun 2017 11:26:52 -0700 Subject: [PATCH 2/3] Allow mouse events to pass through selection --- src/xterm.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/xterm.css b/src/xterm.css index eef60b45..6d6f48fa 100644 --- a/src/xterm.css +++ b/src/xterm.css @@ -194,6 +194,7 @@ left: 0; z-index: 1; opacity: 0.3; + pointer-events: none; } .terminal .xterm-selection div { From 32f1782c84eab30d52ec264ca13f1ae1d485b682 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 20 Jun 2017 10:01:39 -0700 Subject: [PATCH 3/3] Fix context menu in firefox Fixes #721 --- src/xterm.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xterm.js b/src/xterm.js index 0abcbeae..17748296 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -538,8 +538,9 @@ Terminal.prototype.initGlobal = function() { on(this.element, 'paste', pasteHandlerWrapper); if (term.browser.isFirefox) { + // Firefox doesn't appear to fire the contextmenu event on right click on(this.element, 'mousedown', event => { - if (ev.button == 2) { + if (event.button == 2) { rightClickHandler(event, this.textarea, this.selectionManager); } });