aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/main.rs
Commit message (Collapse)AuthorAge
* Replace serde's derive with custom proc macroChristian Duerr2020-12-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Print multiline logs in one write callKirill Chibisov2020-12-10
| | | | Fixes potential split of multiline logs in the multithreaded context by writing them all at once.
* Spawn new alacritty processes in CWD on macOSNathan Lilienthal2020-11-07
| | | | | | On macOS we can use 'proc_pidinfo' to determine the working directory of the terminal foreground process. Fixes #1979.
* Error on warnings when running clippyKirill Chibisov2020-10-29
| | | | | It should simplify tracking of new warnings raised on CI builds and when cross checking. This commit also enables warnings for 'rust_2018_idioms' and 'future_incompatible'.
* Make use of glutin wayland/x11 featuresKirill Chibisov2020-10-12
| | | | This should allow users that are not using Wayland/X11 to reduce the resulted binary size and compilation times.
* Fix feature checking in cross buildsKirill Chibisov2020-10-10
| | | | | Checking for target os in build.rs doesn't work, since build.rs is running for host, so checking should be done in src. Thus moving 'compile_error!' check from build.rs to main.rs.
* Add support for single line terminalsii412020-09-27
| | | | | | | | | | | | | | | | | This changes the minimum terminal dimensions from 2 lines and 2 columns, to 1 line and 2 columns. This also reworks the `SizeInfo` to store the number of columns and lines and consistently has only the terminal lines/columns stored, instead of including the message bar and search in some places of the Alacritty renderer/input. These new changes also make it easy to properly start the selection scrolling as soon as the mouse is over the message bar, instead of waiting until it is beyond it. Fixes #4207. Co-authored-by: Christian Duerr <contact@christianduerr.com>
* Add escape to report text area sizeAyose Cazorla2020-08-28
| | | | This implements the escapes `CSI 14 t` and `CSI 18 t` which report the text area size in pixels and characters.
* Add CLI parameter to override config optionsChristian Duerr2020-08-22
| | | | | | | | This uses the facilities added in 3c3e6870dedad56b270f5b65ea57d5a6e46b1de6 to allow overriding individual configuration file options dynamically from the CLI using the --options/-o parameter. Fixes #1258.
* Add configuration file importsChristian Duerr2020-08-21
| | | | | | | | | | | | | | | | | | | 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.
* Bump minimum supported Rust version to 1.43.0Kirill Chibisov2020-07-28
|
* Remove gui dependencies from alacritty_terminalKirill Chibisov2020-07-11
| | | | | | | | 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.
* Add option to run command on bell Kirill Chibisov2020-07-10
| | | Fixes #1528.
* Add automatic scrolling during selectionChristian Duerr2020-06-18
| | | | | | | | | | | | | This adds a new `Scheduler` which allows for staging events to be processed at a later time. If there is a selection active and the mouse is above or below the window, the viewport will now scroll torwards the direction of the mouse. The amount of lines scrolled depends on the distance of the mouse to the boundaries used for selection scrolling. To make it possible to scroll while in fullscreen, the selection scrolling area includes the padding of the window and is at least 5 pixels high in case there is not enough padding present.
* Remove copypasta dependency from alacritty_terminalKirill Chibisov2020-06-07
|
* Remove copyright notice from filesChristian Duerr2020-06-06
| | | | | | | | | | | | | | 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.
* Extend style guideline documentationChristian Duerr2020-05-05
|
* Log critical errors with error! instead of println!Kirill Chibisov2020-04-12
|
* Use config colors to theme Wayland decorationsKirill Chibisov2020-04-09
| | | Fixes #2092.
* Add debug log for missing configChristian Duerr2020-01-22
| | | | | | | | | | We currently log whenever we fall back to the default config because of an error in the config itself. We also log when the config was successfully loaded and where it was loaded from. The only scenario where no config related message is logged is when there is no configuration file present. Logging this case should make it easier to debug issues like #3240, without requiring any knowledge from maintainers about this edgecase.
* Send PTY resize messages through event loopDavid Hewitt2019-12-14
| | | | | | | This allows us to clean up the Arcs on windows, as well as tidy up the code on unix a little too. Fixes #3086.
* Fix deadlock when closing on Windows using ConptyDavid Hewitt2019-12-12
| | | Fixes #3042.
* Move renderer from alacritty_terminal to alacrittyKirill Chibisov2019-11-23
|
* Fix URL highlightingChristian Duerr2019-11-03
| | | | Fixes #2898. Fixes #2479.
* Fix logged config path separators on WindowsKirill Chibisov2019-10-14
| | | | | | It was discovered that we were logging path with `\\` instead of `\` as separators on Windows due to use of Debug formatting instead of Display for paths.
* Add --hold CLI flagValentin Ignatev2019-10-09
| | | | | | This implements --hold flag which keeps Alacritty open after its child process exits. Fixes #1165.
* Remove automatic config generationKirill Chibisov2019-10-06
| | | | Fixes #2818.
* Update to winit/glutin EventLoop 2.0Christian Duerr2019-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove color from log outputChristian Duerr2019-08-01
| | | Fixes #2474.
* Fix saving of ref testsChristian Duerr2019-07-07
| | | | | | | | | 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.
* Refactor config parsing filesChristian Duerr2019-05-10
| | | | | | | | 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.
* Add git hash to version string, and fix crate name (#2397)Nathan Lilienthal2019-05-03
| | | | This moves `cli` out of `alacritty_terminal` and into `alacritty` where it belongs, along with the `clap` dependency.
* Switch from copypasta to rust-clipboardChristian Duerr2019-04-28
| | | | | | | | | | | This switches our own `copypasta` crate with the more standardized `clipboard` library, which allows us to get rid of the `xclip` dependency on X11. Additionally, this lays the foundation for native Wayland clipboard support once the clipboard crate is updated (or a fork is created). Fixes #5.
* Split alacritty into a separate cratesTheodore Dubois2019-04-28
The crate containing the entry point is called alacritty, and the crate containing everything else is called alacritty_terminal.