Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 37b22325 authored by Simon Chan's avatar Simon Chan
Browse files

feat(demo): improve default terminal options

parent 3e9fa260
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -12,7 +12,15 @@ export class AdbTerminal extends AutoDisposable {
    private element = document.createElement('div');

    public terminal: Terminal = new Terminal({
        allowProposedApi: true,
        allowTransparency: true,
        cursorStyle: 'bar',
        cursorBlink: true,
        fontFamily: '"Cascadia Code", Consolas, monospace, "Source Han Sans SC", "Microsoft YaHei"',
        letterSpacing: 1,
        scrollback: 9000,
        smoothScrollDuration: 50,
        overviewRulerWidth: 20,
    });

    public searchAddon = new SearchAddon();
@@ -63,10 +71,6 @@ export class AdbTerminal extends AutoDisposable {
        this.element.style.height = '100%';
        this.element.style.overflow = 'hidden';

        this.terminal.options.fontFamily = '"Cascadia Code", Consolas, monospace, "Source Han Sans SC", "Microsoft YaHei"';
        this.terminal.options.letterSpacing = 1;
        this.terminal.options.cursorStyle = 'bar';
        this.terminal.options.allowProposedApi = true;
        this.terminal.loadAddon(this.searchAddon);
        this.terminal.loadAddon(this.fitAddon);
    }
@@ -76,6 +80,7 @@ export class AdbTerminal extends AutoDisposable {
        if (!this.terminal.element) {
            void this.element.offsetWidth;
            this.terminal.open(this.element);
            // WebGL addon requires terminal to be attached to DOM
            this.terminal.loadAddon(new WebglAddon());
            // WebGL renderer ignores `cursorBlink` set before it initialized
            this.terminal.options.cursorBlink = true;
+4 −6
Original line number Diff line number Diff line
@@ -25,12 +25,10 @@ if (typeof window !== 'undefined') {

const SEARCH_OPTIONS: ISearchOptions = {
    decorations: {
        matchBackground: '#232422',
        matchBorder: '#555753',
        matchOverviewRuler: '#555753',
        activeMatchBackground: '#ef2929',
        activeMatchBorder: '#ffffff',
        activeMatchColorOverviewRuler: '#ef2929'
        matchBackground: '#42557b',
        matchOverviewRuler: '#d18616',
        activeMatchBackground: '#6199ff2f',
        activeMatchColorOverviewRuler: '#d186167e'
    }
};