mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Merge pull request #4322 from Tyriar/4124
Explain object option edge case
This commit is contained in:
Vendored
+15
-2
@@ -712,17 +712,30 @@ declare module 'xterm' {
|
||||
readonly modes: IModes;
|
||||
|
||||
/**
|
||||
* Gets or sets the terminal options. This supports setting multiple options.
|
||||
* Gets or sets the terminal options. This supports setting multiple
|
||||
* options.
|
||||
*
|
||||
* @example Get a single option
|
||||
* ```ts
|
||||
* console.log(terminal.options.fontSize);
|
||||
* ```
|
||||
*
|
||||
* @example Set a single option
|
||||
* @example Set a single option:
|
||||
* ```ts
|
||||
* terminal.options.fontSize = 12;
|
||||
* ```
|
||||
* Note that for options that are object, a new object must be used in order
|
||||
* to take effect as a reference comparison will be done:
|
||||
* ```ts
|
||||
* const newValue = terminal.options.theme;
|
||||
* newValue.background = '#000000';
|
||||
*
|
||||
* // This won't work
|
||||
* terminal.options.theme = newValue;
|
||||
*
|
||||
* // This will work
|
||||
* terminal.options.theme = { ...newValue };
|
||||
* ```
|
||||
*
|
||||
* @example Set multiple options
|
||||
* ```ts
|
||||
|
||||
Reference in New Issue
Block a user