update config types to reflect all the options available per profile

This commit is contained in:
Labhansh Agrawal 2023-07-01 01:18:49 +05:30
parent fd20ce660a
commit 30266ac833
2 changed files with 358 additions and 100 deletions

View file

@ -27,6 +27,137 @@
}, },
"Partial<profileConfigOptions>": { "Partial<profileConfigOptions>": {
"properties": { "properties": {
"backgroundColor": {
"description": "terminal background color\n\nopacity is only supported on macOS",
"type": "string"
},
"bell": {
"description": "Supported Options:\n1. 'SOUND' -> Enables the bell as a sound\n2. false: turns off the bell",
"type": "string"
},
"bellSound": {
"description": "base64 encoded string of the sound file to use for the bell\nif null, the default bell will be used",
"type": [
"string",
"null"
]
},
"bellSoundURL": {
"description": "An absolute file path to a sound file on the machine.",
"type": [
"string",
"null"
]
},
"borderColor": {
"description": "border color (window, tabs)",
"type": "string"
},
"colors": {
"description": "the full list. if you're going to provide the full color palette,\nincluding the 6 x 6 color cubes and the grayscale map, just provide\nan array here instead of a color map object",
"properties": {
"black": {
"type": "string"
},
"blue": {
"type": "string"
},
"cyan": {
"type": "string"
},
"green": {
"type": "string"
},
"lightBlack": {
"type": "string"
},
"lightBlue": {
"type": "string"
},
"lightCyan": {
"type": "string"
},
"lightGreen": {
"type": "string"
},
"lightMagenta": {
"type": "string"
},
"lightRed": {
"type": "string"
},
"lightWhite": {
"type": "string"
},
"lightYellow": {
"type": "string"
},
"magenta": {
"type": "string"
},
"red": {
"type": "string"
},
"white": {
"type": "string"
},
"yellow": {
"type": "string"
}
},
"required": [
"black",
"blue",
"cyan",
"green",
"lightBlack",
"lightBlue",
"lightCyan",
"lightGreen",
"lightMagenta",
"lightRed",
"lightWhite",
"lightYellow",
"magenta",
"red",
"white",
"yellow"
],
"type": "object"
},
"copyOnSelect": {
"description": "if `true` selected text will automatically be copied to the clipboard",
"type": "boolean"
},
"css": {
"description": "custom CSS to embed in the main window",
"type": "string"
},
"cursorAccentColor": {
"description": "terminal text color under BLOCK cursor",
"type": "string"
},
"cursorBlink": {
"description": "set to `true` for blinking cursor",
"type": "boolean"
},
"cursorColor": {
"description": "terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)",
"type": "string"
},
"cursorShape": {
"description": "`'BEAM'` for |, `'UNDERLINE'` for _, `'BLOCK'` for █",
"enum": [
"BEAM",
"BLOCK",
"UNDERLINE"
],
"type": "string"
},
"disableLigatures": {
"description": "if `false` Hyper will use ligatures provided by some fonts",
"type": "boolean"
},
"env": { "env": {
"additionalProperties": { "additionalProperties": {
"type": "string" "type": "string"
@ -34,6 +165,80 @@
"description": "for environment variables", "description": "for environment variables",
"type": "object" "type": "object"
}, },
"fontFamily": {
"description": "font family with optional fallbacks",
"type": "string"
},
"fontSize": {
"description": "default font size in pixels for all tabs",
"type": "number"
},
"fontWeight": {
"$ref": "#/definitions/FontWeight",
"description": "default font weight eg:'normal', '400', 'bold'"
},
"fontWeightBold": {
"$ref": "#/definitions/FontWeight",
"description": "font weight for bold characters eg:'normal', '600', 'bold'"
},
"foregroundColor": {
"description": "color of the text",
"type": "string"
},
"imageSupport": {
"description": "Whether to enable Sixel and iTerm2 inline image protocol support or not.",
"type": "boolean"
},
"letterSpacing": {
"description": "letter spacing as a relative unit",
"type": "number"
},
"lineHeight": {
"description": "line height as a relative unit",
"type": "number"
},
"macOptionSelectionMode": {
"description": "choose either `'vertical'`, if you want the column mode when Option key is hold during selection (Default)\nor `'force'`, if you want to force selection regardless of whether the terminal is in mouse events mode\n(inside tmux or vim with mouse mode enabled for example).",
"type": "string"
},
"modifierKeys": {
"properties": {
"altIsMeta": {
"type": "boolean"
},
"cmdIsMeta": {
"type": "boolean"
}
},
"required": [
"altIsMeta",
"cmdIsMeta"
],
"type": "object"
},
"padding": {
"description": "custom padding (CSS format, i.e.: `top right bottom left` or `top horizontal bottom` or `vertical horizontal` or `all`)",
"type": "string"
},
"preserveCWD": {
"description": "set to true to preserve working directory when creating splits or tabs",
"type": "boolean"
},
"quickEdit": {
"description": "if `true` on right click selected text will be copied or pasted if no\nselection is present (`true` by default on Windows and disables the context menu feature)",
"type": "boolean"
},
"screenReaderMode": {
"description": "set to true to enable screen reading apps (like NVDA) to read the contents of the terminal",
"type": "boolean"
},
"scrollback": {
"type": "number"
},
"selectionColor": {
"description": "terminal selection color",
"type": "string"
},
"shell": { "shell": {
"description": "the shell to run when spawning a new session (e.g. /usr/local/bin/fish)\nif left empty, your system's login shell will be used by default\n\nWindows\n- Make sure to use a full path if the binary name doesn't work\n- Remove `--login` in shellArgs\n\nWindows Subsystem for Linux (WSL) - previously Bash on Windows\n- Example: `C:\\\\Windows\\\\System32\\\\wsl.exe`\n\nGit-bash on Windows\n- Example: `C:\\\\Program Files\\\\Git\\\\bin\\\\bash.exe`\n\nPowerShell on Windows\n- Example: `C:\\\\WINDOWS\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe`\n\nCygwin\n- Example: `C:\\\\cygwin64\\\\bin\\\\bash.exe`\n\nGit Bash\n- Example: `C:\\\\Program Files\\\\Git\\\\git-cmd.exe`\nThen Add `--command=usr/bin/bash.exe` to shellArgs", "description": "the shell to run when spawning a new session (e.g. /usr/local/bin/fish)\nif left empty, your system's login shell will be used by default\n\nWindows\n- Make sure to use a full path if the binary name doesn't work\n- Remove `--login` in shellArgs\n\nWindows Subsystem for Linux (WSL) - previously Bash on Windows\n- Example: `C:\\\\Windows\\\\System32\\\\wsl.exe`\n\nGit-bash on Windows\n- Example: `C:\\\\Program Files\\\\Git\\\\bin\\\\bash.exe`\n\nPowerShell on Windows\n- Example: `C:\\\\WINDOWS\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe`\n\nCygwin\n- Example: `C:\\\\cygwin64\\\\bin\\\\bash.exe`\n\nGit Bash\n- Example: `C:\\\\Program Files\\\\Git\\\\git-cmd.exe`\nThen Add `--command=usr/bin/bash.exe` to shellArgs",
"type": "string" "type": "string"
@ -45,6 +250,59 @@
}, },
"type": "array" "type": "array"
}, },
"showHamburgerMenu": {
"description": "if you're using a Linux setup which show native menus, set to false\n\ndefault: `true` on Linux, `true` on Windows, ignored on macOS",
"enum": [
"",
false,
true
]
},
"showWindowControls": {
"description": "set to `false` if you want to hide the minimize, maximize and close buttons\n\nadditionally, set to `'left'` if you want them on the left, like in Ubuntu\n\ndefault: `true` on Windows and Linux, ignored on macOS",
"enum": [
"",
false,
"left",
true
]
},
"termCSS": {
"description": "custom CSS to embed in the terminal window",
"type": "string"
},
"uiFontFamily": {
"type": "string"
},
"webGLRenderer": {
"description": "Whether to use the WebGL renderer. Set it to false to use canvas-based\nrendering (slower, but supports transparent backgrounds)",
"type": "boolean"
},
"webLinksActivationKey": {
"description": "keypress required for weblink activation: [ctrl | alt | meta | shift]",
"enum": [
"",
"alt",
"ctrl",
"meta",
"shift"
],
"type": "string"
},
"windowSize": {
"description": "Initial window size in pixels",
"items": [
{
"type": "number"
},
{
"type": "number"
}
],
"maxItems": 2,
"minItems": 2,
"type": "array"
},
"workingDirectory": { "workingDirectory": {
"description": "set custom startup directory (must be an absolute path)", "description": "set custom startup directory (must be an absolute path)",
"type": "string" "type": "string"
@ -63,6 +321,36 @@
"boolean" "boolean"
] ]
}, },
"defaultSSHApp": {
"description": "if `true` hyper will be set as the default protocol client for SSH",
"type": "boolean"
},
"disableAutoUpdates": {
"description": "if `true` hyper will not check for updates",
"type": "boolean"
},
"updateChannel": {
"description": "choose either `'stable'` for receiving highly polished, or `'canary'` for less polished but more frequent updates",
"enum": [
"canary",
"stable"
],
"type": "string"
},
"useConpty": {
"type": "boolean"
}
},
"required": [
"autoUpdatePlugins",
"defaultSSHApp",
"disableAutoUpdates",
"updateChannel"
],
"type": "object"
},
{
"properties": {
"backgroundColor": { "backgroundColor": {
"description": "terminal background color\n\nopacity is only supported on macOS", "description": "terminal background color\n\nopacity is only supported on macOS",
"type": "string" "type": "string"
@ -190,18 +478,17 @@
], ],
"type": "string" "type": "string"
}, },
"defaultSSHApp": {
"description": "if `true` hyper will be set as the default protocol client for SSH",
"type": "boolean"
},
"disableAutoUpdates": {
"description": "if `true` hyper will not check for updates",
"type": "boolean"
},
"disableLigatures": { "disableLigatures": {
"description": "if `false` Hyper will use ligatures provided by some fonts", "description": "if `false` Hyper will use ligatures provided by some fonts",
"type": "boolean" "type": "boolean"
}, },
"env": {
"additionalProperties": {
"type": "string"
},
"description": "for environment variables",
"type": "object"
},
"fontFamily": { "fontFamily": {
"description": "font family with optional fallbacks", "description": "font family with optional fallbacks",
"type": "string" "type": "string"
@ -276,6 +563,17 @@
"description": "terminal selection color", "description": "terminal selection color",
"type": "string" "type": "string"
}, },
"shell": {
"description": "the shell to run when spawning a new session (e.g. /usr/local/bin/fish)\nif left empty, your system's login shell will be used by default\n\nWindows\n- Make sure to use a full path if the binary name doesn't work\n- Remove `--login` in shellArgs\n\nWindows Subsystem for Linux (WSL) - previously Bash on Windows\n- Example: `C:\\\\Windows\\\\System32\\\\wsl.exe`\n\nGit-bash on Windows\n- Example: `C:\\\\Program Files\\\\Git\\\\bin\\\\bash.exe`\n\nPowerShell on Windows\n- Example: `C:\\\\WINDOWS\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe`\n\nCygwin\n- Example: `C:\\\\cygwin64\\\\bin\\\\bash.exe`\n\nGit Bash\n- Example: `C:\\\\Program Files\\\\Git\\\\git-cmd.exe`\nThen Add `--command=usr/bin/bash.exe` to shellArgs",
"type": "string"
},
"shellArgs": {
"description": "for setting shell arguments (e.g. for using interactive shellArgs: `['-i']`)\nby default `['--login']` will be used",
"items": {
"type": "string"
},
"type": "array"
},
"showHamburgerMenu": { "showHamburgerMenu": {
"description": "if you're using a Linux setup which show native menus, set to false\n\ndefault: `true` on Linux, `true` on Windows, ignored on macOS", "description": "if you're using a Linux setup which show native menus, set to false\n\ndefault: `true` on Linux, `true` on Windows, ignored on macOS",
"enum": [ "enum": [
@ -300,17 +598,6 @@
"uiFontFamily": { "uiFontFamily": {
"type": "string" "type": "string"
}, },
"updateChannel": {
"description": "choose either `'stable'` for receiving highly polished, or `'canary'` for less polished but more frequent updates",
"enum": [
"canary",
"stable"
],
"type": "string"
},
"useConpty": {
"type": "boolean"
},
"webGLRenderer": { "webGLRenderer": {
"description": "Whether to use the WebGL renderer. Set it to false to use canvas-based\nrendering (slower, but supports transparent backgrounds)", "description": "Whether to use the WebGL renderer. Set it to false to use canvas-based\nrendering (slower, but supports transparent backgrounds)",
"type": "boolean" "type": "boolean"
@ -339,10 +626,13 @@
"maxItems": 2, "maxItems": 2,
"minItems": 2, "minItems": 2,
"type": "array" "type": "array"
},
"workingDirectory": {
"description": "set custom startup directory (must be an absolute path)",
"type": "string"
} }
}, },
"required": [ "required": [
"autoUpdatePlugins",
"backgroundColor", "backgroundColor",
"bell", "bell",
"bellSound", "bellSound",
@ -355,9 +645,8 @@
"cursorBlink", "cursorBlink",
"cursorColor", "cursorColor",
"cursorShape", "cursorShape",
"defaultSSHApp",
"disableAutoUpdates",
"disableLigatures", "disableLigatures",
"env",
"fontFamily", "fontFamily",
"fontSize", "fontSize",
"fontWeight", "fontWeight",
@ -373,44 +662,13 @@
"screenReaderMode", "screenReaderMode",
"scrollback", "scrollback",
"selectionColor", "selectionColor",
"shell",
"shellArgs",
"showHamburgerMenu", "showHamburgerMenu",
"showWindowControls", "showWindowControls",
"termCSS", "termCSS",
"updateChannel",
"webGLRenderer", "webGLRenderer",
"webLinksActivationKey" "webLinksActivationKey",
],
"type": "object"
},
{
"properties": {
"env": {
"additionalProperties": {
"type": "string"
},
"description": "for environment variables",
"type": "object"
},
"shell": {
"description": "the shell to run when spawning a new session (e.g. /usr/local/bin/fish)\nif left empty, your system's login shell will be used by default\n\nWindows\n- Make sure to use a full path if the binary name doesn't work\n- Remove `--login` in shellArgs\n\nWindows Subsystem for Linux (WSL) - previously Bash on Windows\n- Example: `C:\\\\Windows\\\\System32\\\\wsl.exe`\n\nGit-bash on Windows\n- Example: `C:\\\\Program Files\\\\Git\\\\bin\\\\bash.exe`\n\nPowerShell on Windows\n- Example: `C:\\\\WINDOWS\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe`\n\nCygwin\n- Example: `C:\\\\cygwin64\\\\bin\\\\bash.exe`\n\nGit Bash\n- Example: `C:\\\\Program Files\\\\Git\\\\git-cmd.exe`\nThen Add `--command=usr/bin/bash.exe` to shellArgs",
"type": "string"
},
"shellArgs": {
"description": "for setting shell arguments (e.g. for using interactive shellArgs: `['-i']`)\nby default `['--login']` will be used",
"items": {
"type": "string"
},
"type": "array"
},
"workingDirectory": {
"description": "set custom startup directory (must be an absolute path)",
"type": "string"
}
},
"required": [
"env",
"shell",
"shellArgs",
"workingDirectory" "workingDirectory"
], ],
"type": "object" "type": "object"

88
lib/config.d.ts vendored
View file

@ -19,49 +19,22 @@ export type ColorMap = {
yellow: string; yellow: string;
}; };
type profileConfigOptions = {
/** for environment variables */
env: {[k: string]: string};
/**
* the shell to run when spawning a new session (e.g. /usr/local/bin/fish)
* if left empty, your system's login shell will be used by default
*
* Windows
* - Make sure to use a full path if the binary name doesn't work
* - Remove `--login` in shellArgs
*
* Windows Subsystem for Linux (WSL) - previously Bash on Windows
* - Example: `C:\\Windows\\System32\\wsl.exe`
*
* Git-bash on Windows
* - Example: `C:\\Program Files\\Git\\bin\\bash.exe`
*
* PowerShell on Windows
* - Example: `C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`
*
* Cygwin
* - Example: `C:\\cygwin64\\bin\\bash.exe`
*
* Git Bash
* - Example: `C:\\Program Files\\Git\\git-cmd.exe`
* Then Add `--command=usr/bin/bash.exe` to shellArgs
*/
shell: string;
/**
* for setting shell arguments (e.g. for using interactive shellArgs: `['-i']`)
* by default `['--login']` will be used
*/
shellArgs: string[];
/** set custom startup directory (must be an absolute path) */
workingDirectory: string;
};
type rootConfigOptions = { type rootConfigOptions = {
/** /**
* if `true` (default), Hyper will update plugins every 5 hours * if `true` (default), Hyper will update plugins every 5 hours
* you can also set it to a custom time e.g. `1d` or `2h` * you can also set it to a custom time e.g. `1d` or `2h`
*/ */
autoUpdatePlugins: boolean | string; autoUpdatePlugins: boolean | string;
/** if `true` hyper will be set as the default protocol client for SSH */
defaultSSHApp: boolean;
/** if `true` hyper will not check for updates */
disableAutoUpdates: boolean;
/** choose either `'stable'` for receiving highly polished, or `'canary'` for less polished but more frequent updates */
updateChannel: 'stable' | 'canary';
useConpty?: boolean;
};
type profileConfigOptions = {
/** /**
* terminal background color * terminal background color
* *
@ -105,12 +78,10 @@ type rootConfigOptions = {
cursorColor: string; cursorColor: string;
/** `'BEAM'` for |, `'UNDERLINE'` for _, `'BLOCK'` for █ */ /** `'BEAM'` for |, `'UNDERLINE'` for _, `'BLOCK'` for █ */
cursorShape: 'BEAM' | 'UNDERLINE' | 'BLOCK'; cursorShape: 'BEAM' | 'UNDERLINE' | 'BLOCK';
/** if `true` hyper will be set as the default protocol client for SSH */
defaultSSHApp: boolean;
/** if `true` hyper will not check for updates */
disableAutoUpdates: boolean;
/** if `false` Hyper will use ligatures provided by some fonts */ /** if `false` Hyper will use ligatures provided by some fonts */
disableLigatures: boolean; disableLigatures: boolean;
/** for environment variables */
env: {[k: string]: string};
/** font family with optional fallbacks */ /** font family with optional fallbacks */
fontFamily: string; fontFamily: string;
/** default font size in pixels for all tabs */ /** default font size in pixels for all tabs */
@ -157,6 +128,36 @@ type rootConfigOptions = {
scrollback: number; scrollback: number;
/** terminal selection color */ /** terminal selection color */
selectionColor: string; selectionColor: string;
/**
* the shell to run when spawning a new session (e.g. /usr/local/bin/fish)
* if left empty, your system's login shell will be used by default
*
* Windows
* - Make sure to use a full path if the binary name doesn't work
* - Remove `--login` in shellArgs
*
* Windows Subsystem for Linux (WSL) - previously Bash on Windows
* - Example: `C:\\Windows\\System32\\wsl.exe`
*
* Git-bash on Windows
* - Example: `C:\\Program Files\\Git\\bin\\bash.exe`
*
* PowerShell on Windows
* - Example: `C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`
*
* Cygwin
* - Example: `C:\\cygwin64\\bin\\bash.exe`
*
* Git Bash
* - Example: `C:\\Program Files\\Git\\git-cmd.exe`
* Then Add `--command=usr/bin/bash.exe` to shellArgs
*/
shell: string;
/**
* for setting shell arguments (e.g. for using interactive shellArgs: `['-i']`)
* by default `['--login']` will be used
*/
shellArgs: string[];
/** /**
* if you're using a Linux setup which show native menus, set to false * if you're using a Linux setup which show native menus, set to false
* *
@ -174,9 +175,6 @@ type rootConfigOptions = {
/** custom CSS to embed in the terminal window */ /** custom CSS to embed in the terminal window */
termCSS: string; termCSS: string;
uiFontFamily?: string; uiFontFamily?: string;
/** choose either `'stable'` for receiving highly polished, or `'canary'` for less polished but more frequent updates */
updateChannel: 'stable' | 'canary';
useConpty?: boolean;
/** /**
* Whether to use the WebGL renderer. Set it to false to use canvas-based * Whether to use the WebGL renderer. Set it to false to use canvas-based
* rendering (slower, but supports transparent backgrounds) * rendering (slower, but supports transparent backgrounds)
@ -189,6 +187,8 @@ type rootConfigOptions = {
webLinksActivationKey: 'ctrl' | 'alt' | 'meta' | 'shift' | ''; webLinksActivationKey: 'ctrl' | 'alt' | 'meta' | 'shift' | '';
/** Initial window size in pixels */ /** Initial window size in pixels */
windowSize?: [number, number]; windowSize?: [number, number];
/** set custom startup directory (must be an absolute path) */
workingDirectory: string;
}; };
export type configOptions = rootConfigOptions & export type configOptions = rootConfigOptions &