Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ The terminal has several options you can use to change the behaviour of it. All
| readOnly | Hides the entire prompt, thus setting the terminal to read-only mode. | Boolean | `false` |
| styleEchoBack | Inherit style for command echoes (Terminal outputs of any commands entered) from prompt (Fully or partially, i.e. label or text only), or style them as regular messages. Omitting this prop enables default behaviour. | String<'labelOnly'/'textOnly'/'fullInherit'/'messageInherit'\> | `undefined` |
| welcomeMessage | The terminal welcome message. Set to `false` to disable, `true` to show the default, or supply a string (Or an array of them) to set a custom one. | Boolean/String/Array<String\> | `false` |
| maxOutput | The maximum amount of output lines in the terminal. Set to integer to cap output lines at that amount, set to false for there to be no cap. | Boolean/Number | `false` |

### Re-styling

Expand Down
3 changes: 2 additions & 1 deletion src/Terminal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ export default class Terminal extends Component {
const { stdout } = this.state

if (this.props.locked) stdout.pop()

if (stdout.length > this.props.maxOutput && typeof this.props.maxOutput === "number") stdout.shift()

stdout.push({ message, isEcho: options?.isEcho || false })

/* istanbul ignore next: Covered by interactivity tests */
Expand Down