blob: 4f98cf910e6d130473e9b50e94751026249ead18 [file] [log] [blame]
rginda6d397402012-01-17 10:58:29 -08001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
rginda8ba33642011-12-14 12:31:31 -08002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
rgindacbbd7482012-06-13 15:06:16 -07005'use strict';
6
rginda8ba33642011-12-14 12:31:31 -08007/**
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 *
rgindab8bc8932012-04-27 12:45:03 -070021 * The defaults are as defined in http://www.vt100.net/docs/vt510-rm/DECSTR
Zhu Qunying30d40712017-03-14 16:27:00 -070022 * except that we enable autowrap (wraparound) by default since that seems to
rgindab8bc8932012-04-27 12:45:03 -070023 * be what xterm does.
24 *
Mike Frysingerec4225d2020-04-07 05:00:01 -040025 * @param {!hterm.Options=} copy Optional instance to copy.
rginda8ba33642011-12-14 12:31:31 -080026 * @constructor
27 */
Mike Frysingerec4225d2020-04-07 05:00:01 -040028hterm.Options = function(copy = undefined) {
rginda8ba33642011-12-14 12:31:31 -080029 // All attributes in this class are public to allow easy access by the
30 // terminal.
31
Mike Frysingerec4225d2020-04-07 05:00:01 -040032 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;
rginda8ba33642011-12-14 12:31:31 -080041};