Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function createTerminal(options: TerminalOptions = {}): Terminal {
// Load the addons on-demand the first time we create a terminal.
// $FlowIgnore
if (XTerminal.fit == null) {
// The 'fit' add-on resizes the terminal based on the container size
// and the font size such that the terminal fills the container.
XTerminal.applyAddon(Fit);
}
// $FlowIgnore
if (XTerminal.webLinksInit == null) {
// The 'webLinks' add-on linkifies http URL strings.
XTerminal.applyAddon(WebLinks);
}
const rendererType = featureConfig.get(RENDERER_TYPE_CONFIG);
// $FlowIgnore We know that TerminalClass is XTerminal + addons
const terminal = new XTerminal(
// $FlowIssue: xterms type needs to be updated to include experimentalCharAtlas
assertTerminalOptionsInFeatureConfig({
cursorBlink: featureConfig.get(CURSOR_BLINK_CONFIG),
cursorStyle: featureConfig.get(CURSOR_STYLE_CONFIG),