(options = {})
| 31 | |
| 32 | export default class TerminalComponent { |
| 33 | constructor(options = {}) { |
| 34 | // Get terminal settings from shared defaults |
| 35 | const terminalSettings = getTerminalSettings(); |
| 36 | |
| 37 | this.options = { |
| 38 | allowProposedApi: true, |
| 39 | scrollOnUserInput: true, |
| 40 | rows: options.rows || 24, |
| 41 | cols: options.cols || 80, |
| 42 | port: options.port || 8767, |
| 43 | renderer: options.renderer || "auto", // 'auto' | 'canvas' | 'webgl' |
| 44 | fontSize: terminalSettings.fontSize, |
| 45 | fontFamily: terminalSettings.fontFamily, |
| 46 | fontWeight: terminalSettings.fontWeight, |
| 47 | theme: TerminalThemeManager.getTheme(terminalSettings.theme), |
| 48 | cursorBlink: terminalSettings.cursorBlink, |
| 49 | cursorStyle: terminalSettings.cursorStyle, |
| 50 | cursorInactiveStyle: terminalSettings.cursorInactiveStyle, |
| 51 | scrollback: terminalSettings.scrollback, |
| 52 | tabStopWidth: terminalSettings.tabStopWidth, |
| 53 | convertEol: terminalSettings.convertEol, |
| 54 | letterSpacing: terminalSettings.letterSpacing, |
| 55 | ...options, |
| 56 | }; |
| 57 | |
| 58 | this.terminal = null; |
| 59 | this.fitAddon = null; |
| 60 | this.attachAddon = null; |
| 61 | this.unicode11Addon = null; |
| 62 | this.searchAddon = null; |
| 63 | this.webLinksAddon = null; |
| 64 | this.imageAddon = null; |
| 65 | this.ligaturesAddon = null; |
| 66 | this.container = null; |
| 67 | this.websocket = null; |
| 68 | this.pid = null; |
| 69 | this.isConnected = false; |
| 70 | this.serverMode = options.serverMode !== false; // Default true |
| 71 | this.touchSelection = null; |
| 72 | this.touchScrolling = null; |
| 73 | this.parsedAppKeybindings = []; |
| 74 | this.parsedAppKeybindingsVersion = -1; |
| 75 | this.boundNativeSelectionMenuHandler = null; |
| 76 | |
| 77 | this.init(); |
| 78 | } |
| 79 | |
| 80 | init() { |
| 81 | this.terminal = new Xterm(this.options); |
nothing calls this directly
no test coverage detected