Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(plugins/plugin-client-common): fullscreen pty apps like vi are a … #7599

Merged
merged 1 commit into from
Jun 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,9 @@ export default class ScrollableTerminal extends React.PureComponent<Props, State
>
<React.Fragment>
{this.state.splits.length > 1 && <SplitHeader onRemove={scrollback.remove} onClear={scrollback.clear} />}
<ul className="kui--scrollback-block-list">{this.blocks(tab, scrollback, sbidx)}</ul>
<ul className="kui--scrollback-block-list">
<div className="kui--scrollback-block-list-for-sizing">{this.blocks(tab, scrollback, sbidx)}</div>
</ul>
</React.Fragment>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,8 @@ function paddingHorizontal(elt: Element) {
)
}

function paddingVertical(elt: Element) {
const style = window.getComputedStyle(elt)
return (
parseInt(style.getPropertyValue('padding-top') || '0', 10) +
parseInt(style.getPropertyValue('padding-bottom') || '0', 10)
)
}

export default function getSize(this: HTMLElement): { width: number; height: number } {
const enclosingRect = this.getBoundingClientRect()
const enclosingRect = this.querySelector('.kui--scrollback-block-list-for-sizing').getBoundingClientRect()

const selectorForWidthPad = '.repl-block .repl-output'
const widthPadElement = this.querySelector(selectorForWidthPad)
Expand All @@ -42,7 +34,7 @@ export default function getSize(this: HTMLElement): { width: number; height: num
const { width: contextWidth } = contextElement ? contextElement.getBoundingClientRect() : { width: 0 }

const width = enclosingRect.width - paddingHorizontal(widthPadElement) - contextWidth
const height = enclosingRect.height - paddingVertical(this /* heightPadElement */)
const height = enclosingRect.height // kui--scrollback-block-list-for-sizing will include any outer padding

return { width, height }
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,21 @@ $split-bgcolor: var(--color-repl-background);
background-color: $split-bgcolor;
}

/**
* e.g. so that Terminal/getSize() can have a height that doesn't
require computing the padding we may associate with the
ScrollbackBlockList
*
*/
@include ScrollbackBlockList {
/* these two rules given us inner scrolling on ScrollbackBlockList */
flex: 1;
overflow: auto;

padding: $split-padding 0;

/* these rules given us inner scrolling on ScrollbackBlockList */
flex: 1;
display: flex;
overflow: hidden;
.kui--scrollback-block-list-for-sizing {
flex: 1;
overflow: auto;
}
}