From ae3d1f01a6dcd9a93404d01e8e4574459d37271c Mon Sep 17 00:00:00 2001 From: Jarid Margolin Date: Tue, 29 May 2018 06:11:21 -0400 Subject: [PATCH] Add scrollback option to config (#3038) --- lib/components/term-group.js | 1 + lib/components/term.js | 1 + lib/components/terms.js | 1 + lib/containers/terms.js | 1 + lib/reducers/ui.js | 5 +++++ 5 files changed, 9 insertions(+) diff --git a/lib/components/term-group.js b/lib/components/term-group.js index 38f67c8d..328f959b 100644 --- a/lib/components/term-group.js +++ b/lib/components/term-group.js @@ -58,6 +58,7 @@ class TermGroup_ extends React.PureComponent { const props = getTermProps(uid, this.props, { isTermActive: uid === this.props.activeSession, term: termRef ? termRef.term : null, + scrollback: this.props.scrollback, backgroundColor: this.props.backgroundColor, foregroundColor: this.props.foregroundColor, colors: this.props.colors, diff --git a/lib/components/term.js b/lib/components/term.js index 1bed36b5..b0789139 100644 --- a/lib/components/term.js +++ b/lib/components/term.js @@ -26,6 +26,7 @@ const getTermOptions = props => { const backgroundColor = needTransparency ? 'transparent' : props.backgroundColor; return { macOptionIsMeta: props.modifierKeys.altIsMeta, + scrollback: props.scrollback, cursorStyle: CURSOR_STYLES[props.cursorShape], cursorBlink: props.cursorBlink, fontFamily: props.fontFamily, diff --git a/lib/components/terms.js b/lib/components/terms.js index 66bd8361..0d8a36b1 100644 --- a/lib/components/terms.js +++ b/lib/components/terms.js @@ -88,6 +88,7 @@ export default class Terms extends React.Component { terms: this.terms, activeSession: this.props.activeSession, sessions: this.props.sessions, + scrollback: this.props.scrollback, backgroundColor: this.props.backgroundColor, foregroundColor: this.props.foregroundColor, borderColor: this.props.borderColor, diff --git a/lib/containers/terms.js b/lib/containers/terms.js index ffe49f52..30671dd3 100644 --- a/lib/containers/terms.js +++ b/lib/containers/terms.js @@ -17,6 +17,7 @@ const TermsContainer = connect( sessions, cols: state.ui.cols, rows: state.ui.rows, + scrollback: state.ui.scrollback, termGroups: getRootGroups(state), activeRootGroup: state.termGroups.activeRootGroup, activeSession: state.sessions.activeUid, diff --git a/lib/reducers/ui.js b/lib/reducers/ui.js index 7560bc8d..5627154f 100644 --- a/lib/reducers/ui.js +++ b/lib/reducers/ui.js @@ -31,6 +31,7 @@ const allowedWindowControlsValues = new Set([true, false, 'left']); const initial = Immutable({ cols: null, rows: null, + scrollback: 1000, activeUid: null, cursorColor: '#F81CE5', cursorAccentColor: '#000', @@ -116,6 +117,10 @@ const reducer = (state = initial, action) => { (() => { const ret = {}; + if (config.scrollback) { + ret.scrollback = config.scrollback; + } + if (state.fontSizeOverride && config.fontSize !== state.fontSize) { ret.fontSizeOverride = null; }