ligatures switch (fixes #51)

This commit is contained in:
Eugene Pankov 2017-07-05 11:26:28 +02:00
parent 7327a7008c
commit 48e8ffd729
4 changed files with 24 additions and 10 deletions

View File

@ -1,3 +1,4 @@
const dataurl = require('dataurl')
import { BehaviorSubject, Subject, Subscription } from 'rxjs'
import 'rxjs/add/operator/bufferTime'
import { Component, NgZone, Inject, Optional, ViewChild, HostBinding, Input } from '@angular/core'
@ -261,6 +262,28 @@ export class TerminalTabComponent extends BaseTabComponent {
preferenceManager.set('cursor-color', config.terminal.colorScheme.cursor)
}
let css = require('../hterm.userCSS.scss')
if (!config.terminal.ligatures) {
css += `
* {
font-feature-settings: "liga" 0;
font-variant-ligatures: none;
}
`
} else {
css += `
* {
font-feature-settings: "liga" 1;
font-variant-ligatures: initial;
}
`
}
preferenceManager.set('user-css', dataurl.convert({
data: css,
mimetype: 'text/css',
charset: 'utf8',
}))
this.hterm.setBracketedPaste(config.terminal.bracketedPaste)
}

View File

@ -7,6 +7,7 @@ export class TerminalConfigProvider extends ConfigProvider {
bell: 'off',
bracketedPaste: false,
background: 'theme',
ligatures: false,
colorScheme: {
__nonStructural: true,
name: 'Material',

View File

@ -1,4 +1,3 @@
const dataurl = require('dataurl')
export const hterm = require('hterm-umdjs')
hterm.hterm.defaultStorage = new hterm.lib.Storage.Memory()
export const preferenceManager = new hterm.hterm.PreferenceManager('default')
@ -16,11 +15,6 @@ hterm.hterm.VT.ESC['k'] = function (parseState) {
parseState.func = parseOSC
}
preferenceManager.set('user-css', dataurl.convert({
data: require('./hterm.userCSS.scss'),
mimetype: 'text/css',
charset: 'utf8',
}))
preferenceManager.set('background-color', '#1D272D')
preferenceManager.set('color-palette-overrides', {
0: '#1D272D',

View File

@ -6,10 +6,6 @@ a:hover {
text-decoration: underline;
}
* {
font-feature-settings: "liga" 0; // disable ligatures (they break monospacing)
}
x-screen {
transition: 0.125s ease background;
}