mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 02:00:43 +00:00
Fixes monospace font overlapping in terminal+linux
- Also fixes actually using Roboto-Mono, xterm.js now only accepts fontFamily customization via the JS api. (uses `<canvas`). - There is an issue (https://github.com/xtermjs/xterm.js/issues/1170) if linux has to fall back to 'monospace' where things fail to render correctly, so provide a couple of common options so this rarely happens. - If we distribute robo-mono in the webpack bundle that might also work.
This commit is contained in:
@@ -146,6 +146,15 @@ class Terminal extends React.Component {
|
||||
mountTerminal() {
|
||||
Term.applyAddon(fit);
|
||||
this.term = new Term({
|
||||
//
|
||||
// Some linux systems fail to render 'monospace' on `<canvas>` correctly:
|
||||
// https://github.com/xtermjs/xterm.js/issues/1170
|
||||
// `theme.fontFamilies.monospace` doesn't provide many options so we add
|
||||
// some here that are very common. The alternative _might_ be to bundle Roboto-Mono
|
||||
//
|
||||
fontFamily: '"Roboto Mono", "Courier New", "Courier", monospace',
|
||||
// `theme.fontSizes.tiny` (`"12px"`) is a string and we need an int here.
|
||||
fontSize: 12,
|
||||
convertEol: !this.props.pipe.get('raw'),
|
||||
cursorBlink: true,
|
||||
scrollback: 10000,
|
||||
|
||||
Reference in New Issue
Block a user