summaryrefslogtreecommitdiffstats
path: root/alacritty_terminal/src/config/mod.rs
AgeCommit message (Collapse)Author
2023-11-10Remove `alacritty_config` from alacritty_terminalKirill Chibisov
There's no need to force alacritty's user configuration on other users of the crate, thus provide the options actually used by alacritty_terminal itself.
2023-10-25Fix typosPavel Roskin
2023-07-22Add `terminal` config section to control OSCs Kirill Chibisov
Some environments demand certain OSC sequences to be disabled or some escape sequence could require handling which is out of scope of alacritty, but could be done by external script (OSC 777). Added section for now just handles the `OSC 52` sequence and changes its default to be `OnlyCopy`, which is handy for remote copy, but `Paste` is redundant because normal `Paste` hotkey could be used as well. Fixes #3386. Co-authored-by: Christian Duerr <contact@christianduerr.com>
2023-06-17Add errors for deserializing with unknown fieldsChristian Duerr
Currently there are still some places where `Deserialize` is used rather than `ConfigDeserialize`, which means that the built-in warning for unused fields is not emitted automatically. To ensure users don't have invalid configurations, the `#[serde(deny_unknown_fields)]` annotation has been added to these structs, making it a hard error when an unknown field is present.
2023-05-23Switch to VTE's built-in ansi featureAnhad Singh
Co-authored-by: Christian Duerr <contact@christianduerr.com>
2022-10-12Fix clippy warningsChristian Duerr
This patch applies all clippy lints currently present on the latest clippy master than are compatible with our oldstable clippy (only exception is the `_else(||` stuff).
2022-09-17Fix IPC config overriding previous valuesChristian Duerr
Before this patch whenever changing the IPC configuration, all previous configuration options would be discarded. This was the case even when the new option was invalid. This patch ensures that the IPC config is only ever cleared when the `--reset` flag is passed. Invalid IPC config options are logged and discarded. Additionally whenever a new IPC config message is sent, all previous IPC error messages are cleared. Closes #6330.
2022-09-01Add IPC config subcommandChristian Duerr
This patch adds a new mechanism for changing configuration options without editing the configuration file, by sending options to running instances through `alacritty msg`. Each window will load Alacritty's configuration file by default and then accept IPC messages for config updates using the `alacritty msg config` subcommand. By default all windows will be updated, individual windows can be addressed using `alacritty msg config --window-id "$ALACRITTY_WINDOW_ID"`. Each option will replace the config's current value and cannot be reset until Alacritty is restarted or the option is overwritten with a new value. Configuration options are passed in the format `field.subfield=value`, where `value` is interpreted as yaml. Closes #472.
2022-07-01Add `cursor.blink_timeout` config optionKirill Chibisov
This option should prevent extensive power usage due to cursor blinking when there's no user activity being performed. Fixes #5992.
2022-06-02Fix a few minor clippy lintsYuri Astrakhan
2022-02-02Add damage tracking and reporting to compatible compositorsKirill Chibisov
This allows compositors to only process damaged (that is, updated) regions of our window buffer, which for larger window sizes (think 4k) should significantly reduce compositing workload under compositors that support/honor it, which is good for performance, battery life and lower latency over remote connections like VNC. On Wayland, clients are expected to always report correct damage, so this makes us a good citizen there. It can also aid remote desktop (waypipe, rdp, vnc, ...) and other types of screencopy by having damage bubble up correctly. Fixes #3186.
2021-11-22Add parameters to `msg create-window` subcommandKirill Chibisov
Alacritty's `msg create-window` subcommand would previously inherit all the CLI parameters from the original executable. However not only could this lead to unexpected behavior, it also prevents multi-window users from making use of parameters like `-e`, `--working-directory`, or `--hold`. This is solved by adding a JSON-based message format to the IPC socket messages which instructs the Alacritty server on which CLI parameters should be used to create the new window. Fixes #5562. Fixes #5561. Fixes #5560.
2021-02-13Update dependenciesChristian Duerr
This introduces some duplicate dependencies, though they are necessary to build properly without any warnings. Fixes #4735.
2021-01-24Move renderable cell transformation to alacrittyChristian Duerr
This refactors a large chunk of the alacritty_terminal API to expose all data necessary for rendering uniformly through the `renderable_content` call. This also no longer transforms the cells for rendering by a GUI but instead just reports the content from a terminal emulation perspective. The transformation into renderable cells is now done inside the alacritty crate. Since the terminal itself only ever needs to know about modified color RGB values, the configuration for colors was moved to the alacritty UI code.
2021-01-02Fix deserialization of untagged enumsChristian Duerr
Fixes #4634.
2021-01-01Remove Windows WinPTY backendChristian Duerr
2020-12-21Replace serde's derive with custom proc macroChristian Duerr
This replaces the existing `Deserialize` derive from serde with a `ConfigDeserialize` derive. The goal of this new proc macro is to allow a more error-friendly deserialization for the Alacritty configuration file without having to manage a lot of boilerplate code inside the configuration modules. The first part of the derive macro is for struct deserialization. This takes structs which have `Default` implemented and will only replace fields which can be successfully deserialized. Otherwise the `log` crate is used for printing errors. Since this deserialization takes the default value from the struct instead of the value, it removes the necessity for creating new types just to implement `Default` on them for deserialization. Additionally, the struct deserialization also checks for `Option` values and makes sure that explicitly specifying `none` as text literal is allowed for all options. The other part of the derive macro is responsible for deserializing enums. While only enums with Unit variants are supported, it will automatically implement a deserializer for these enums which accepts any form of capitalization. Since this custom derive prevents us from using serde's attributes on fields, some of the attributes have been reimplemented for `ConfigDeserialize`. These include `#[config(flatten)]`, `#[config(skip)]` and `#[config(alias = "alias)]`. The flatten attribute is currently limited to at most one per struct. Additionally the `#[config(deprecated = "optional message")]` attribute allows easily defining uniform deprecation messages for fields on structs.
2020-11-23Add blinking cursor supportDettorer
This adds support for blinking the terminal cursor. This can be controlled either using the configuration file, or using escape sequences. The supported control sequences for changing the blinking state are `CSI Ps SP q` and private mode 12.
2020-11-06Deprecate the WinPTY backendChristian Duerr
2020-08-21Add configuration file importsChristian Duerr
This adds the ability for users to have multiple configuration files which all inherit from each other. The order of imports is chronological, branching out to the deepest children first and overriding every field with that of the configuration files that are loaded at a later point in time. Live config reload watches the directories of all configuration files, allowing edits in any of them to update Alacritty immediately. While the imports are live reloaded, a new configuration file watcher will only be spawned once Alacritty is restarted. Since this might cause loops which would be very difficult to detect, a maximum depth is set to limit the recursion possible with nested configuration files. Fixes #779.
2020-07-11Remove gui dependencies from alacritty_terminalKirill Chibisov
This commit removes font dependency from alacritty_terminal, so it'll simplify the usage of alacritty_terminal as a library, since you won't link to system's libraries anymore. It also moves many alacritty related config options from it. Fixes #3393.
2020-07-10Add option to run command on bell Kirill Chibisov
Fixes #1528.
2020-07-09Add regex scrollback buffer searchChristian Duerr
This adds a new regex search which allows searching the entire scrollback and jumping between matches using the vi mode. All visible matches should be highlighted unless their lines are excessively long. This should help with performance since highlighting is done during render time. Fixes #1017.
2020-06-06Remove copyright notice from filesChristian Duerr
Keeping the license as part of every file bloats up the files unnecessarily and introduces an additional overhead to the creation of new modules. Since cargo already provides excellent dependency management, most of the code-reuse of Alacritty should occur through Rust's dependency management instead of copying it source. If code is copied partially, copying the license from the main license file should be just as easy as copying from the top of the file and making some adjustments based on where it is used is likely necessary anyways.
2020-06-05Fix class and cursor thickness deserializationKirill Chibisov
Fixes #3820.
2020-06-05Refactor Shell, Command, and Launcher to share implKirill Chibisov
2020-05-05Extend style guideline documentationChristian Duerr
2020-04-15Add config option to set cursor thicknessKirill Chibisov
Fixes #3526.
2020-03-18Add modal keyboard motion modeChristian Duerr
This implements a basic mode for navigating inside of Alacritty's history with keyboard bindings. They're bound by default to vi's motion shortcuts but are fully customizable. Since this relies on key bindings only single key bindings are currently supported (so no `ge`, or repetition). Other than navigating the history and moving the viewport, this mode should enable making use of all available selection modes to copy content to the clipboard and launch URLs below the cursor. This also changes the rendering of the block cursor at the side of selections, since previously it could be inverted to be completely invisible. Since that would have caused some troubles with this keyboard selection mode, the block cursor now is no longer inverted when it is at the edges of a selection. Fixes #262.
2020-03-01Remove `tabspaces` config optionChristian Duerr
This completely removes the tabspaces option from the Alacritty configuration, due to frequent misuse of it. Based on some research, none of the terminal emulators support setting the value for tabspaces or read the terminfo to determine init_tabs value at startup. The tested terminal emulators were URxvt, XTerm, and Termite.
2020-01-20Disable drawing bold text bright by defaultKirill Chibisov
Since the assumption is usually that bold text is drawn in bright colors, this might break some applications. However some other terminals have already taken this leap, which should lessen the impact for Alacritty. Since this might still be desired and necessary for certain applications, the config option is just switched to draw with normal colors by default, however the old behavior can still be restored. Fixes #2779.
2020-01-12Fix crash with invalid working directoryChristian Duerr
2020-01-02Clean up Windows PTY string handlingDavid Hewitt
Removes widestring and dunce dependencies, reduces some code duplication and corrects a few typos.
2019-12-21Default to ConPTY instead of WinPTYDavid Hewitt
2019-10-09Add --hold CLI flagValentin Ignatev
This implements --hold flag which keeps Alacritty open after its child process exits. Fixes #1165.
2019-10-06Remove automatic config generationKirill Chibisov
Fixes #2818.
2019-10-05Update to winit/glutin EventLoop 2.0Christian Duerr
This takes the latest glutin master to port Alacritty to the EventLoop 2.0 rework. This changes a big part of the event loop handling by pushing the event loop in a separate thread from the renderer and running both in parallel. Fixes #2796. Fixes #2694. Fixes #2643. Fixes #2625. Fixes #2618. Fixes #2601. Fixes #2564. Fixes #2456. Fixes #2438. Fixes #2334. Fixes #2254. Fixes #2217. Fixes #1789. Fixes #1750. Fixes #1125.
2019-09-28Add `ReceiveChar` action for passing key's textzsugabubus
2019-07-26Fix double-click selecting trailing tabBen Firth
Fixes #2639.
2019-07-10Fix cursor color setting with escape sequenceKirill Chibisov
The cursor rework introduced a regression where cursor color was always picked from a config file, rather then using `ansi::NamedColor::Cursor` for this purpose. This commit also removes `CursorText` option from `NamedColor` enum, since we can't speculate with `CursorText` during runtime. Cursor rework commits: cfc20d4f34dca535654cc32df18e785296af4cc5 371d13f8ef95157c97f7de9964bcbc89d4a8e930 0d060d5d801e3abb55035269138d819d38fc175b
2019-07-07Fix saving of ref testsChristian Duerr
Since ref tests were only stored whenever winit requested the window close, they would not get stored properly when the terminal was closed through Alacritty using `exit`, Ctrl+D or similar. This moves the ref test code to the and of the main entry point, which will always be executed regardless of how the terminal was shutdown.
2019-07-06Allow setting gtk variant and general class on X11Brian Koropoff
2019-06-18Fix redundant static lifetime clippy lintMatthias Krüger
2019-05-10Refactor config parsing filesChristian Duerr
This is a large refactor of the config parsing structure, attempting to reduce the size of the file a bit by splitting it up into different modules with more specific purposes. This also fixes #2279.
2019-05-03Add git hash to version string, and fix crate name (#2397)Nathan Lilienthal
This moves `cli` out of `alacritty_terminal` and into `alacritty` where it belongs, along with the `clap` dependency.
2019-04-28Split alacritty into a separate cratesTheodore Dubois
The crate containing the entry point is called alacritty, and the crate containing everything else is called alacritty_terminal.