2020-04-27 05:32:08 -08:00
|
|
|
import {FontWeight} from 'xterm';
|
|
|
|
|
|
2021-03-05 07:03:35 -09:00
|
|
|
export type ColorMap = {
|
|
|
|
|
black: string;
|
|
|
|
|
blue: string;
|
|
|
|
|
cyan: string;
|
|
|
|
|
green: string;
|
|
|
|
|
lightBlack: string;
|
|
|
|
|
lightBlue: string;
|
|
|
|
|
lightCyan: string;
|
|
|
|
|
lightGreen: string;
|
|
|
|
|
lightMagenta: string;
|
|
|
|
|
lightRed: string;
|
|
|
|
|
lightWhite: string;
|
|
|
|
|
lightYellow: string;
|
|
|
|
|
magenta: string;
|
|
|
|
|
red: string;
|
|
|
|
|
white: string;
|
|
|
|
|
yellow: string;
|
|
|
|
|
};
|
|
|
|
|
|
2020-04-27 05:32:08 -08:00
|
|
|
export type configOptions = {
|
2022-12-25 20:01:04 -09:00
|
|
|
/**
|
|
|
|
|
* if `true` (default), Hyper will update plugins every 5 hours
|
|
|
|
|
* you can also set it to a custom time e.g. `1d` or `2h`
|
|
|
|
|
*/
|
2020-04-27 05:32:08 -08:00
|
|
|
autoUpdatePlugins: boolean | string;
|
2022-12-25 20:01:04 -09:00
|
|
|
/**
|
|
|
|
|
* terminal background color
|
|
|
|
|
*
|
|
|
|
|
* opacity is only supported on macOS
|
|
|
|
|
*/
|
2020-04-27 05:32:08 -08:00
|
|
|
backgroundColor: string;
|
2022-12-25 20:01:04 -09:00
|
|
|
/**
|
|
|
|
|
* Supported Options:
|
|
|
|
|
* 1. 'SOUND' -> Enables the bell as a sound
|
|
|
|
|
* 2. false: turns off the bell
|
|
|
|
|
*/
|
2020-04-27 05:32:08 -08:00
|
|
|
bell: string;
|
2022-12-25 20:01:04 -09:00
|
|
|
/**
|
|
|
|
|
* base64 encoded string of the sound file to use for the bell
|
|
|
|
|
* if null, the default bell will be used
|
|
|
|
|
* @nullable
|
|
|
|
|
*/
|
2020-04-27 05:32:08 -08:00
|
|
|
bellSound: string | null;
|
2022-12-25 20:01:04 -09:00
|
|
|
/**
|
|
|
|
|
* An absolute file path to a sound file on the machine.
|
|
|
|
|
* @nullable
|
|
|
|
|
*/
|
2020-04-27 05:32:08 -08:00
|
|
|
bellSoundURL: string | null;
|
2022-12-25 20:01:04 -09:00
|
|
|
/** border color (window, tabs) */
|
2020-04-27 05:32:08 -08:00
|
|
|
borderColor: string;
|
2022-12-25 20:01:04 -09:00
|
|
|
/**
|
|
|
|
|
* the full list. if you're going to provide the full color palette,
|
|
|
|
|
* including the 6 x 6 color cubes and the grayscale map, just provide
|
|
|
|
|
* an array here instead of a color map object
|
|
|
|
|
*/
|
2021-03-05 07:03:35 -09:00
|
|
|
colors: ColorMap;
|
2022-12-25 20:01:04 -09:00
|
|
|
/** if `true` selected text will automatically be copied to the clipboard */
|
2020-04-27 05:32:08 -08:00
|
|
|
copyOnSelect: boolean;
|
2022-12-25 20:01:04 -09:00
|
|
|
/** custom CSS to embed in the main window */
|
2020-04-27 05:32:08 -08:00
|
|
|
css: string;
|
2022-12-25 20:01:04 -09:00
|
|
|
/** terminal text color under BLOCK cursor */
|
2020-04-27 05:32:08 -08:00
|
|
|
cursorAccentColor: string;
|
2022-12-25 20:01:04 -09:00
|
|
|
/** set to `true` for blinking cursor */
|
2020-04-27 05:32:08 -08:00
|
|
|
cursorBlink: boolean;
|
2022-12-25 20:01:04 -09:00
|
|
|
/** terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) */
|
2020-04-27 05:32:08 -08:00
|
|
|
cursorColor: string;
|
2022-12-25 20:01:04 -09:00
|
|
|
/** `'BEAM'` for |, `'UNDERLINE'` for _, `'BLOCK'` for █ */
|
2020-04-27 05:32:08 -08:00
|
|
|
cursorShape: 'BEAM' | 'UNDERLINE' | 'BLOCK';
|
2022-12-25 20:01:04 -09:00
|
|
|
/** if `true` hyper will be set as the default protocol client for SSH */
|
2020-04-27 05:32:08 -08:00
|
|
|
defaultSSHApp: boolean;
|
2022-12-25 20:01:04 -09:00
|
|
|
/** if `true` hyper will not check for updates */
|
2021-08-02 01:05:47 -08:00
|
|
|
disableAutoUpdates: boolean;
|
2022-12-25 20:01:04 -09:00
|
|
|
/** if `false` Hyper will use ligatures provided by some fonts */
|
2020-04-27 05:32:08 -08:00
|
|
|
disableLigatures: boolean;
|
2022-12-25 20:01:04 -09:00
|
|
|
/** for environment variables */
|
|
|
|
|
env: {[k: string]: string};
|
|
|
|
|
/** font family with optional fallbacks */
|
2020-04-27 05:32:08 -08:00
|
|
|
fontFamily: string;
|
2022-12-25 20:01:04 -09:00
|
|
|
/** default font size in pixels for all tabs */
|
2020-04-27 05:32:08 -08:00
|
|
|
fontSize: number;
|
2022-12-25 20:01:04 -09:00
|
|
|
/** default font weight eg:'normal', '400', 'bold' */
|
2020-04-27 05:32:08 -08:00
|
|
|
fontWeight: FontWeight;
|
2022-12-25 20:01:04 -09:00
|
|
|
/** font weight for bold characters eg:'normal', '600', 'bold' */
|
2020-04-27 05:32:08 -08:00
|
|
|
fontWeightBold: FontWeight;
|
2022-12-25 20:01:04 -09:00
|
|
|
/** color of the text */
|
2020-04-27 05:32:08 -08:00
|
|
|
foregroundColor: string;
|
2023-06-16 06:06:18 -08:00
|
|
|
/**
|
|
|
|
|
* Whether to enable Sixel and iTerm2 inline image protocol support or not.
|
|
|
|
|
*/
|
|
|
|
|
imageSupport: boolean;
|
2022-12-25 20:01:04 -09:00
|
|
|
/** letter spacing as a relative unit */
|
2020-04-27 05:32:08 -08:00
|
|
|
letterSpacing: number;
|
2022-12-25 20:01:04 -09:00
|
|
|
/** line height as a relative unit */
|
2020-04-27 05:32:08 -08:00
|
|
|
lineHeight: number;
|
2022-12-25 20:01:04 -09:00
|
|
|
/**
|
|
|
|
|
* choose either `'vertical'`, if you want the column mode when Option key is hold during selection (Default)
|
|
|
|
|
* or `'force'`, if you want to force selection regardless of whether the terminal is in mouse events mode
|
|
|
|
|
* (inside tmux or vim with mouse mode enabled for example).
|
|
|
|
|
*/
|
2020-04-27 05:32:08 -08:00
|
|
|
macOptionSelectionMode: string;
|
2022-12-25 20:01:04 -09:00
|
|
|
modifierKeys?: {
|
2020-04-27 05:32:08 -08:00
|
|
|
altIsMeta: boolean;
|
|
|
|
|
cmdIsMeta: boolean;
|
|
|
|
|
};
|
2022-12-25 20:01:04 -09:00
|
|
|
/** custom padding (CSS format, i.e.: `top right bottom left` or `top horizontal bottom` or `vertical horizontal` or `all`) */
|
2020-04-27 05:32:08 -08:00
|
|
|
padding: string;
|
2022-12-25 20:01:04 -09:00
|
|
|
/**
|
|
|
|
|
* set to true to preserve working directory when creating splits or tabs
|
|
|
|
|
*/
|
2022-01-08 01:47:38 -09:00
|
|
|
preserveCWD: boolean;
|
2022-12-25 20:01:04 -09:00
|
|
|
/**
|
|
|
|
|
* if `true` on right click selected text will be copied or pasted if no
|
|
|
|
|
* selection is present (`true` by default on Windows and disables the context menu feature)
|
|
|
|
|
*/
|
2020-04-27 05:32:08 -08:00
|
|
|
quickEdit: boolean;
|
2022-12-25 20:01:04 -09:00
|
|
|
/**
|
|
|
|
|
* set to true to enable screen reading apps (like NVDA) to read the contents of the terminal
|
|
|
|
|
*/
|
2020-11-24 04:18:50 -09:00
|
|
|
screenReaderMode: boolean;
|
2020-04-27 05:32:08 -08:00
|
|
|
scrollback: number;
|
2022-12-25 20:01:04 -09:00
|
|
|
/** terminal selection color */
|
2020-04-27 05:32:08 -08:00
|
|
|
selectionColor: string;
|
2022-12-25 20:01:04 -09:00
|
|
|
/**
|
2023-03-31 02:58:13 -08:00
|
|
|
* the shell to run when spawning a new session (e.g. /usr/local/bin/fish)
|
2022-12-25 20:01:04 -09:00
|
|
|
* 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
|
|
|
|
|
*/
|
2020-04-27 05:32:08 -08:00
|
|
|
shell: string;
|
2022-12-25 20:01:04 -09:00
|
|
|
/**
|
2023-03-31 02:58:13 -08:00
|
|
|
* for setting shell arguments (e.g. for using interactive shellArgs: `['-i']`)
|
2022-12-25 20:01:04 -09:00
|
|
|
* by default `['--login']` will be used
|
|
|
|
|
*/
|
2020-04-27 05:32:08 -08:00
|
|
|
shellArgs: string[];
|
2022-12-25 20:01:04 -09:00
|
|
|
/**
|
|
|
|
|
* if you're using a Linux setup which show native menus, set to false
|
|
|
|
|
*
|
|
|
|
|
* default: `true` on Linux, `true` on Windows, ignored on macOS
|
|
|
|
|
*/
|
2020-04-27 05:32:08 -08:00
|
|
|
showHamburgerMenu: boolean | '';
|
2022-12-25 20:01:04 -09:00
|
|
|
/**
|
|
|
|
|
* set to `false` if you want to hide the minimize, maximize and close buttons
|
|
|
|
|
*
|
|
|
|
|
* additionally, set to `'left'` if you want them on the left, like in Ubuntu
|
|
|
|
|
*
|
|
|
|
|
* default: `true` on Windows and Linux, ignored on macOS
|
|
|
|
|
*/
|
|
|
|
|
showWindowControls: boolean | 'left' | '';
|
|
|
|
|
/** custom CSS to embed in the terminal window */
|
2020-04-27 05:32:08 -08:00
|
|
|
termCSS: string;
|
2022-12-25 20:01:04 -09:00
|
|
|
uiFontFamily?: string;
|
|
|
|
|
/** choose either `'stable'` for receiving highly polished, or `'canary'` for less polished but more frequent updates */
|
2020-04-27 05:32:08 -08:00
|
|
|
updateChannel: 'stable' | 'canary';
|
2022-12-25 20:01:04 -09:00
|
|
|
useConpty?: boolean;
|
|
|
|
|
/**
|
|
|
|
|
* Whether to use the WebGL renderer. Set it to false to use canvas-based
|
|
|
|
|
* rendering (slower, but supports transparent backgrounds)
|
|
|
|
|
*/
|
2020-04-27 05:32:08 -08:00
|
|
|
webGLRenderer: boolean;
|
2022-12-25 20:01:04 -09:00
|
|
|
// TODO: does not pick up config changes automatically, need to restart terminal
|
|
|
|
|
/**
|
|
|
|
|
* keypress required for weblink activation: [ctrl | alt | meta | shift]
|
|
|
|
|
*/
|
|
|
|
|
webLinksActivationKey: 'ctrl' | 'alt' | 'meta' | 'shift' | '';
|
|
|
|
|
/** Initial window size in pixels */
|
|
|
|
|
windowSize?: [number, number];
|
|
|
|
|
/** set custom startup directory (must be an absolute path) */
|
2022-01-08 01:27:12 -09:00
|
|
|
workingDirectory: string;
|
2020-04-27 05:32:08 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type rawConfig = {
|
|
|
|
|
config?: configOptions;
|
2022-12-25 20:01:04 -09:00
|
|
|
/**
|
|
|
|
|
* a list of plugins to fetch and install from npm
|
|
|
|
|
* format: [@org/]project[#version]
|
|
|
|
|
* examples:
|
|
|
|
|
* `hyperpower`
|
|
|
|
|
* `@company/project`
|
|
|
|
|
* `project#1.0.1`
|
|
|
|
|
*/
|
2020-04-27 05:32:08 -08:00
|
|
|
plugins?: string[];
|
2022-12-25 20:01:04 -09:00
|
|
|
/**
|
|
|
|
|
* in development, you can create a directory under
|
|
|
|
|
* `plugins/local/` and include it here
|
|
|
|
|
* to load it and avoid it being `npm install`ed
|
|
|
|
|
*/
|
2020-04-27 05:32:08 -08:00
|
|
|
localPlugins?: string[];
|
2022-12-25 20:01:04 -09:00
|
|
|
/**
|
|
|
|
|
* Example
|
|
|
|
|
* 'window:devtools': 'cmd+alt+o',
|
|
|
|
|
*/
|
|
|
|
|
keymaps?: {[k: string]: string | string[]};
|
2020-04-27 05:32:08 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type parsedConfig = {
|
|
|
|
|
config: configOptions;
|
|
|
|
|
plugins: string[];
|
|
|
|
|
localPlugins: string[];
|
|
|
|
|
keymaps: Record<string, string[]>;
|
|
|
|
|
};
|