From f8cdbd55d8bc9280935a46180d7223422eaa92c3 Mon Sep 17 00:00:00 2001 From: Jakob Rosenberg Date: Mon, 21 Feb 2022 09:47:47 +0100 Subject: [PATCH 1/2] feat: make max scrollback configurable --- lib/config.js | 7 +++++++ lib/views/terminal.js | 2 +- lib/wrappers/settings-wrapper.js | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/config.js b/lib/config.js index 7d9f0e9..885a534 100644 --- a/lib/config.js +++ b/lib/config.js @@ -217,6 +217,13 @@ export default class Config { "Changes the terminal font size.", order: 14, }, + scrollback: { + type: "number", + default: 5000, + title: "Scrollback", + description: "The max number lines to preserve in the terminal.", + order: 15 + }, }; } } diff --git a/lib/views/terminal.js b/lib/views/terminal.js index 5f82a10..89a06ca 100644 --- a/lib/views/terminal.js +++ b/lib/views/terminal.js @@ -30,7 +30,7 @@ export default class Term { rows: this.term_rows.default, cols: 120, rendererType: 'dom', - scrollback: 5000, + scrollback: this.api.config('scrollback') }); this.xterm.loadAddon(this.fit); // for copy-paste with cmd key diff --git a/lib/wrappers/settings-wrapper.js b/lib/wrappers/settings-wrapper.js index be67e87..74e9b9e 100644 --- a/lib/wrappers/settings-wrapper.js +++ b/lib/wrappers/settings-wrapper.js @@ -126,6 +126,7 @@ export default class SettingsWrapper extends EventEmitter { this.auto_connect = this.api.config('auto_connect'); this.py_ignore = this.api.config('py_ignore'); this.fast_upload = this.api.config('fast_upload'); + this.scrollback = this.api.config('scrollback'); this.autoconnect_comport_manufacturers = this.api.config( 'autoconnect_comport_manufacturers', ); @@ -242,6 +243,9 @@ export default class SettingsWrapper extends EventEmitter { if ('font_size' in this.project_config) { this.font_size = this.project_config.font_size; } + if('scrollback' in this.project_config) { + this.scrollback = this.project_config.scrollback + } } getDefaultProjectConfig() { @@ -258,6 +262,7 @@ export default class SettingsWrapper extends EventEmitter { py_ignore: this.api.config('py_ignore'), fast_upload: this.api.config('fast_upload'), font_size: this.api.config('font_size'), + scrollback: this.api.config('scrollback'), }; return config; } From e03711a22a82a65614f0962fcde1437c24ea4c16 Mon Sep 17 00:00:00 2001 From: Jakob Rosenberg Date: Mon, 21 Feb 2022 09:56:28 +0100 Subject: [PATCH 2/2] chore: fix typo --- lib/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/config.js b/lib/config.js index 885a534..04df193 100644 --- a/lib/config.js +++ b/lib/config.js @@ -221,7 +221,7 @@ export default class Config { type: "number", default: 5000, title: "Scrollback", - description: "The max number lines to preserve in the terminal.", + description: "The max number of lines to preserve in the terminal.", order: 15 }, };