本文整理汇总了TypeScript中xterm.Terminal.setOption方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Terminal.setOption方法的具体用法?TypeScript Terminal.setOption怎么用?TypeScript Terminal.setOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xterm.Terminal
的用法示例。
在下文中一共展示了Terminal.setOption方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: setTheme
export function setTheme(terminal: Terminal, theme_name: string): void {
let t = color_themes[theme_name];
if (t == null) {
t = color_themes["default"];
if (t == null) {
// can't happen
return;
}
}
const colors = t.colors;
if (colors == null) {
// satisfies typescript
return;
}
const theme: ITheme = {
background: colors[17],
foreground: colors[16],
cursor: colors[16],
cursorAccent: colors[17],
selection: "rgba(128, 128, 160, 0.25)",
black: colors[0],
red: colors[1],
green: colors[2],
yellow: colors[3],
blue: colors[4],
magenta: colors[5],
cyan: colors[6],
white: colors[7],
brightBlack: colors[8],
brightRed: colors[9],
brightGreen: colors[10],
brightYellow: colors[11],
brightBlue: colors[12],
brightMagenta: colors[13],
brightCyan: colors[14],
brightWhite: colors[15]
};
terminal.setOption("theme", theme);
}
示例2: Terminal
const r15: number = t.getOption('tabStopWidth');
const r16: number = t.getOption('scrollback');
const r18: (data: string) => void = t.getOption('handler');
const r19: string = t.getOption('bellSound');
const r20: string = t.getOption('bellStyle');
const r21: boolean = t.getOption('enableBold');
const r22: number = t.getOption('letterSpacing');
const r23: boolean = t.getOption('macOptionIsMeta');
const r24: string = t.getOption('fontWeight');
const r25: string = t.getOption('fontWeightBold');
const r26: boolean = t.getOption('allowTransparency');
const r27: boolean = t.getOption('rightClickSelectsWord');
}
{
const t: Terminal = new Terminal();
t.setOption('cursorStyle', 'bar');
t.setOption('cursorStyle', 'block');
t.setOption('cursorStyle', 'underline');
t.setOption('termName', 'foo');
t.setOption('cancelEvents', true);
t.setOption('convertEol', true);
t.setOption('cursorBlink', true);
t.setOption('debug', true);
t.setOption('disableStdin', true);
t.setOption('enableBold', true);
t.setOption('fontWeight', 'normal');
t.setOption('fontWeight', 'bold');
t.setOption('fontWeightBold', 'normal');
t.setOption('fontWeightBold', 'bold');
t.setOption('popOnBell', true);
t.setOption('screenKeys', true);
示例3:
Object.keys(updated).forEach(key => {
const value = updated[key];
term.setOption(key, value);
});