rginda | 6d39740 | 2012-01-17 10:58:29 -0800 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
rginda | 8ba3364 | 2011-12-14 12:31:31 -0800 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
rginda | cbbd748 | 2012-06-13 15:06:16 -0700 | [diff] [blame] | 5 | 'use strict'; |
| 6 | |
rginda | 8ba3364 | 2011-12-14 12:31:31 -0800 | [diff] [blame] | 7 | /** |
| 8 | * @fileoverview This file implements the hterm.Options class, |
| 9 | * which stores current operating conditions for the terminal. This object is |
| 10 | * used instead of a series of parameters to allow saving/restoring of cursor |
| 11 | * conditions easily, and to provide an easy place for common configuration |
| 12 | * options. |
| 13 | * |
| 14 | * Original code by Cory Maccarrone. |
| 15 | */ |
| 16 | |
| 17 | /** |
| 18 | * Constructor for the hterm.Options class, optionally acting as a copy |
| 19 | * constructor. |
| 20 | * |
rginda | b8bc893 | 2012-04-27 12:45:03 -0700 | [diff] [blame] | 21 | * The defaults are as defined in http://www.vt100.net/docs/vt510-rm/DECSTR |
Zhu Qunying | 30d4071 | 2017-03-14 16:27:00 -0700 | [diff] [blame] | 22 | * except that we enable autowrap (wraparound) by default since that seems to |
rginda | b8bc893 | 2012-04-27 12:45:03 -0700 | [diff] [blame] | 23 | * be what xterm does. |
| 24 | * |
Mike Frysinger | ec4225d | 2020-04-07 05:00:01 -0400 | [diff] [blame] | 25 | * @param {!hterm.Options=} copy Optional instance to copy. |
rginda | 8ba3364 | 2011-12-14 12:31:31 -0800 | [diff] [blame] | 26 | * @constructor |
| 27 | */ |
Mike Frysinger | ec4225d | 2020-04-07 05:00:01 -0400 | [diff] [blame] | 28 | hterm.Options = function(copy = undefined) { |
rginda | 8ba3364 | 2011-12-14 12:31:31 -0800 | [diff] [blame] | 29 | // All attributes in this class are public to allow easy access by the |
| 30 | // terminal. |
| 31 | |
Mike Frysinger | ec4225d | 2020-04-07 05:00:01 -0400 | [diff] [blame] | 32 | this.wraparound = copy ? copy.wraparound : true; |
| 33 | this.reverseWraparound = copy ? copy.reverseWraparound : false; |
| 34 | this.originMode = copy ? copy.originMode : false; |
| 35 | this.autoCarriageReturn = copy ? copy.autoCarriageReturn : false; |
| 36 | this.cursorVisible = copy ? copy.cursorVisible : false; |
| 37 | this.cursorBlink = copy ? copy.cursorBlink : false; |
| 38 | this.insertMode = copy ? copy.insertMode : false; |
| 39 | this.reverseVideo = copy ? copy.reverseVideo : false; |
| 40 | this.bracketedPaste = copy ? copy.bracketedPaste : false; |
rginda | 8ba3364 | 2011-12-14 12:31:31 -0800 | [diff] [blame] | 41 | }; |