提交 e5316826 编写于 作者: D Daniel Imms

Add experimentalRefreshOnResume as potential workaround for texture corruption

Part of #69665
上级 ec0499a9
......@@ -263,6 +263,11 @@ configurationRegistry.registerConfiguration({
description: nls.localize('terminal.integrated.windowsEnableConpty', "Whether to use ConPTY for Windows terminal process communication (requires Windows 10 build number 18309+). Winpty will be used if this is false."),
type: 'boolean',
default: true
},
'terminal.integrated.experimentalRefreshOnResume': {
description: nls.localize('terminal.integrated.experimentalRefreshOnResume', "An experimental setting that will refresh the terminal renderer when the system is resumed."),
type: 'boolean',
default: false
}
}
});
......
......@@ -764,6 +764,14 @@ export class TerminalInstance implements ITerminalInstance {
}
public forceRedraw(): void {
if (this._configHelper.config.experimentalRefreshOnResume) {
if (this._xterm.getOption('rendererType') !== 'dom') {
this._xterm.setOption('rendererType', 'dom');
// Do this asynchronously to clear our the texture atlas as all terminals will not
// be using canvas
setTimeout(() => this._xterm.setOption('rendererType', 'canvas'), 0);
}
}
this._xterm.refresh(0, this._xterm.rows - 1);
}
......@@ -788,6 +796,7 @@ export class TerminalInstance implements ITerminalInstance {
public paste(): void {
this.focus();
document.execCommand('paste');
this.forceRedraw();
}
public write(text: string): void {
......
......@@ -101,6 +101,7 @@ export interface ITerminalConfiguration {
experimentalBufferImpl: 'JsArray' | 'TypedArray';
splitCwd: 'workspaceRoot' | 'initial' | 'inherited';
windowsEnableConpty: boolean;
experimentalRefreshOnResume: boolean;
}
export interface ITerminalConfigHelper {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册