fix xterm transparency

This commit is contained in:
Labhansh Agrawal 2023-06-27 16:48:46 +05:30
parent 9527757d9b
commit cb40ca3138
2 changed files with 1 additions and 7 deletions

View file

@ -46,7 +46,7 @@ const isWebgl2Supported = (() => {
const getTermOptions = (props: TermProps): ITerminalOptions => {
// Set a background color only if it is opaque
const needTransparency = Color(props.backgroundColor).alpha() < 1;
const backgroundColor = needTransparency ? 'transparent' : props.backgroundColor;
const backgroundColor = needTransparency ? 'rgba(0,0,0,0)' : props.backgroundColor;
return {
macOptionIsMeta: props.modifierKeys.altIsMeta,

View file

@ -23,11 +23,6 @@ class Hyper extends React.PureComponent<HyperProps> {
}
componentDidUpdate(prev: HyperProps) {
if (this.props.backgroundColor !== prev.backgroundColor) {
// this can be removed when `setBackgroundColor` in electron
// starts working again
document.body.style.backgroundColor = this.props.backgroundColor;
}
const {lastConfigUpdate} = this.props;
if (lastConfigUpdate && lastConfigUpdate !== prev.lastConfigUpdate) {
this.attachKeyListeners();
@ -96,7 +91,6 @@ class Hyper extends React.PureComponent<HyperProps> {
};
componentWillUnmount() {
document.body.style.backgroundColor = 'inherit';
this.mousetrap?.reset();
}