From 6c884e090c52d063bdb9500f1832183c0af92993 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Sat, 7 Oct 2017 18:07:57 +0200 Subject: [PATCH] blinking cursor (fixes #191) --- .../terminalSettingsTab.component.pug | 77 ++++++++++++------- .../src/components/terminalTab.component.ts | 5 ++ terminus-terminal/src/config.ts | 1 + 3 files changed, 57 insertions(+), 26 deletions(-) diff --git a/terminus-terminal/src/components/terminalSettingsTab.component.pug b/terminus-terminal/src/components/terminalSettingsTab.component.pug index 9f8f28cd..6e23bf1e 100644 --- a/terminus-terminal/src/components/terminalSettingsTab.component.pug +++ b/terminus-terminal/src/components/terminalSettingsTab.component.pug @@ -247,34 +247,59 @@ ) .form-group - label Terminal bell - br - div( - '[(ngModel)]'='config.store.terminal.bell', - (ngModelChange)='config.save()', - ngbRadioGroup - ) - label.btn.btn-secondary(ngbButtonLabel) - input( - type='radio', - ngbButton, - [value]='"off"' + .d-flex + .mr-3 + label Terminal bell + br + div( + '[(ngModel)]'='config.store.terminal.bell', + (ngModelChange)='config.save()', + ngbRadioGroup ) - | Off - label.btn.btn-secondary(ngbButtonLabel) - input( - type='radio', - ngbButton, - [value]='"visual"' + label.btn.btn-secondary(ngbButtonLabel) + input( + type='radio', + ngbButton, + [value]='"off"' + ) + | Off + label.btn.btn-secondary(ngbButtonLabel) + input( + type='radio', + ngbButton, + [value]='"visual"' + ) + | Visual + label.btn.btn-secondary(ngbButtonLabel) + input( + type='radio', + ngbButton, + [value]='"audible"' + ) + | Audible + + div + label Blink cursor + br + div( + '[(ngModel)]'='config.store.terminal.cursorBlink', + (ngModelChange)='config.save()', + ngbRadioGroup ) - | Visual - label.btn.btn-secondary(ngbButtonLabel) - input( - type='radio', - ngbButton, - [value]='"audible"' - ) - | Audible + label.btn.btn-secondary(ngbButtonLabel) + input( + type='radio', + ngbButton, + [value]='false' + ) + | Off + label.btn.btn-secondary(ngbButtonLabel) + input( + type='radio', + ngbButton, + [value]='true' + ) + | On .form-group label Session persistence diff --git a/terminus-terminal/src/components/terminalTab.component.ts b/terminus-terminal/src/components/terminalTab.component.ts index 5984d7d3..1dbbb6a1 100644 --- a/terminus-terminal/src/components/terminalTab.component.ts +++ b/terminus-terminal/src/components/terminalTab.component.ts @@ -322,6 +322,7 @@ export class TerminalTabComponent extends BaseTabComponent { preferenceManager.set('copy-on-select', false) preferenceManager.set('alt-sends-what', 'browser-key') preferenceManager.set('alt-gr-mode', 'ctrl-alt') + preferenceManager.set('cursor-blink', config.terminal.cursorBlink) if (config.terminal.colorScheme.foreground) { preferenceManager.set('foreground-color', config.terminal.colorScheme.foreground) @@ -368,6 +369,10 @@ export class TerminalTabComponent extends BaseTabComponent { beam: hterm.hterm.Terminal.cursorShape.BEAM, }[config.terminal.cursor] this.hterm.applyCursorShape() + this.hterm.setCursorBlink(config.terminal.cursorBlink) + if (config.terminal.cursorBlink) { + this.hterm.onCursorBlink_() + } } zoomIn () { diff --git a/terminus-terminal/src/config.ts b/terminus-terminal/src/config.ts index c7f71ef2..bde73fe6 100644 --- a/terminus-terminal/src/config.ts +++ b/terminus-terminal/src/config.ts @@ -11,6 +11,7 @@ export class TerminalConfigProvider extends ConfigProvider { background: 'theme', ligatures: false, cursor: 'block', + cursorBlink: true, customShell: '', colorScheme: { __nonStructural: true,