Change:
Upstream:
It's not true that it takes very long. It does not get visible at all. I have to downsize the terminal pane to a certain size to make it visible again. In my case it's about 5-10 lines. Seems to me that the canvas is not resized properly. There are no problems if I disable GPU rendering (code --disable-gpu). Also without any noticeable performance issues. Would be nice to have a flag in the preferences to disable GPU rendering as a quick workaround. One of the reasons for using code (instead of Atom or Sublime) was the integrated terminal which seems to be broken since the new canvas rendering was introduced. My System Config: OS X 10.11.6, GPU: NVidia 8800, 4GB RAM
that will probably get fixed as part of this as well, it's probably something to do with your GPU/Chromium not liking the texture sizes above a certain size.

Discussion:
export const IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY = 'terminal.integrated.isWorkspaceShellAllowed'; export const NEVER_SUGGEST_SELECT_WINDOWS_SHELL_STORAGE_KEY = 'terminal.integrated.neverSuggestSelectWindowsShell'; <ins> export const NEVER_MEASURE_RENDER_TIME_STORAGE_KEY = 'terminal.integrated.neverMeasureRenderTime'; </ins> export const ITerminalService = createDecorator<ITerminalService>(TERMINAL_SERVICE_ID);

import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; <del> import { ITerminalInstance, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TERMINAL_PANEL_ID, IShellLaunchConfig, ITerminalProcessManager, ProcessState } from 'vs/workbench/parts/terminal/common/terminal'; </del> <ins> import { ITerminalInstance, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TERMINAL_PANEL_ID, IShellLaunchConfig, ITerminalProcessManager, ProcessState, NEVER_MEASURE_RENDER_TIME_STORAGE_KEY } from 'vs/workbench/parts/terminal/common/terminal'; </ins> import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { TabFocus } from 'vs/editor/common/config/commonEditorConfig';

import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { ansiColorIdentifiers, TERMINAL_BACKGROUND_COLOR, TERMINAL_FOREGROUND_COLOR, TERMINAL_CURSOR_FOREGROUND_COLOR, TERMINAL_CURSOR_BACKGROUND_COLOR, TERMINAL_SELECTION_BACKGROUND_COLOR } from 'vs/workbench/parts/terminal/common/terminalColorRegistry'; import { PANEL_BACKGROUND } from 'vs/workbench/common/theme'; <del> import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; </del> <ins> import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; </ins> import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; <del> import { INotificationService } from 'vs/platform/notification/common/notification'; </del> <ins> import { INotificationService, Severity, IPromptChoice } from 'vs/platform/notification/common/notification'; </ins> import { ILogService } from 'vs/platform/log/common/log'; import { TerminalCommandTracker } from 'vs/workbench/parts/terminal/node/terminalCommandTracker'; import { TerminalProcessManager } from './terminalProcessManager'; <ins> import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; // How long in milliseconds should an average frame take to render for a notification to appear // which suggests the fallback DOM-based renderer const SLOW_CANVAS_RENDER_THRESHOLD = 50; </ins> let Terminal: typeof XTermTerminal;

@IClipboardService private readonly _clipboardService: IClipboardService, @IThemeService private readonly _themeService: IThemeService, @IConfigurationService private readonly _configurationService: IConfigurationService, <del> @ILogService private _logService: ILogService </del> <ins> @ILogService private _logService: ILogService, @IStorageService private readonly _storageService: IStorageService, </ins> ) { this._disposables = []; this._skipTerminalCommands = [];

if (this._xterm.getOption('disableStdin')) { this._attachPressAnyKeyToCloseListener(); } <ins> const neverMeasureRenderTime = this._storageService.getBoolean(NEVER_MEASURE_RENDER_TIME_STORAGE_KEY, StorageScope.GLOBAL, false); if (!neverMeasureRenderTime && this._configHelper.config.rendererType === 'auto') { this._measureRenderTime(); } </ins> }); } <ins> private _measureRenderTime(): void { const textRenderLayer = (<any>this._xterm).renderer._renderLayers[0]; const originalOnGridChanged = textRenderLayer.onGridChanged; textRenderLayer.onGridChanged = (terminal: XTermTerminal, firstRow: number, lastRow: number) => { const startTime = performance.now(); originalOnGridChanged.call(textRenderLayer, terminal, firstRow, lastRow); const renderTimeMilliseconds = performance.now() - startTime; if (renderTimeMilliseconds > SLOW_CANVAS_RENDER_THRESHOLD) { const promptChoices: IPromptChoice[] = [ { label: nls.localize('yes', "Yes"), run: () => { this._configurationService.updateValue('terminal.integrated.rendererType', 'dom', ConfigurationTarget.USER).then(() => { this._notificationService.info(nls.localize('terminal.rendererInAllNewTerminals', "All newly created terminals will use the non-GPU renderer.")); }); } } as IPromptChoice, { label: nls.localize('no', "No") } as IPromptChoice, { label: nls.localize('dontShowAgain', "Don't Show Again"), isSecondary: true, run: () => this._storageService.store(NEVER_MEASURE_RENDER_TIME_STORAGE_KEY, true) } as IPromptChoice ]; this._notificationService.prompt( Severity.Warning, nls.localize('terminal.slowRendering', 'The current standard canvas renderer for the integrated terminal appears to be slow on your computer. Using the DOM-based renderer may improve performance, do you want to switch to the DOM-based renderer? [Read more about terminal settings](https://code.visualstudio.com/docs/editor/integrated-terminal#_changing-how-the-terminal-is-rendered).'), promptChoices ); } // Restore original function textRenderLayer.onGridChanged = originalOnGridChanged; }; } </ins> public registerLinkMatcher(regex: RegExp, handler: (url: string) => void, matchIndex?: number, validationCallback?: (uri: string, callback: (isValid: boolean) => void) => void): number { return this._linkHandler.registerCustomLinkHandler(regex, handler, matchIndex, validationCallback); }