From 48dd4b5c1f2496be5b2ba19be1310ec2b2a85506 Mon Sep 17 00:00:00 2001 From: Igor Stroganov Date: Thu, 10 Nov 2016 03:11:51 +0300 Subject: [PATCH] Fix inverted text display. Fix #883 (#968) * Fix inverted text display. Fix #883 * Add a comment explaining setBackgroundColor override --- lib/components/term.js | 6 +++++- lib/hterm.js | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/components/term.js b/lib/components/term.js index 809e217f..9ab873b4 100644 --- a/lib/components/term.js +++ b/lib/components/term.js @@ -37,7 +37,11 @@ export default class Term extends Component { prefs.set('cursor-color', this.validateColor(props.cursorColor, 'rgba(255,255,255,0.5)')); prefs.set('enable-clipboard-notice', false); prefs.set('foreground-color', props.foregroundColor); - prefs.set('background-color', 'transparent'); + + // hterm.ScrollPort.prototype.setBackgroundColor is overriden + // to make hterm's background transparent. we still need to set + // background-color for proper text rendering + prefs.set('background-color', props.backgroundColor); prefs.set('color-palette-overrides', getColorList(props.colors)); prefs.set('user-css', this.getStylesheet(props.customCSS)); prefs.set('scrollbar-visible', false); diff --git a/lib/hterm.js b/lib/hterm.js index 59c575aa..ff2deb16 100644 --- a/lib/hterm.js +++ b/lib/hterm.js @@ -207,6 +207,11 @@ hterm.Terminal.prototype.onMouse_ = function (e) { return oldOnMouse.call(this, e); }; +// make background transparent to avoid transparency issues +hterm.ScrollPort.prototype.setBackgroundColor = function () { + this.screen_.style.backgroundColor = 'transparent'; +}; + // fixes a bug in hterm, where the shorthand hex // is not properly converted to rgb lib.colors.hexToRGB = function (arg) {