diff --git a/lib/config.js b/lib/config.js index 7d9f0e9..04df193 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 of 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; }