diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2017-12-03 21:38:42 +0000 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-12-03 13:38:42 -0800 |
commit | 9bdac6b50aa911cd8f94624a1084a1ba35be6ed4 (patch) | |
tree | 0809e0e65413978c8f906528bee192559a05fa78 /src/config.rs | |
parent | d552d28418ef192724b2b4353863708f31f325d4 (diff) | |
download | alacritty-9bdac6b50aa911cd8f94624a1084a1ba35be6ed4.tar.gz alacritty-9bdac6b50aa911cd8f94624a1084a1ba35be6ed4.zip |
Add cursor style option (#928)
The default cursor can now be configured through the cursor_style field
of the config. Valid options include Block, Underline, and Beam.
The default can be restored by sending \e[0q as in VTE terminals.
Live config reloading is supported for this parameter.
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index 36ac3319..48fcda7a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -25,6 +25,7 @@ use glutin::ModifiersState; use input::{Action, Binding, MouseBinding, KeyBinding}; use index::{Line, Column}; +use ansi::CursorStyle; use util::fmt::Yellow; @@ -275,6 +276,10 @@ pub struct Config { #[serde(default)] hide_cursor_when_typing: bool, + /// Style of the cursor + #[serde(default)] + cursor_style: CursorStyle, + /// Live config reload #[serde(default="true_bool")] live_config_reload: bool, @@ -329,6 +334,7 @@ impl Default for Config { visual_bell: Default::default(), env: Default::default(), hide_cursor_when_typing: Default::default(), + cursor_style: Default::default(), live_config_reload: true, padding: default_padding(), } @@ -1179,6 +1185,12 @@ impl Config { self.hide_cursor_when_typing } + /// Style of the cursor + #[inline] + pub fn cursor_style(&self) -> CursorStyle { + self.cursor_style + } + /// Live config reload #[inline] pub fn live_config_reload(&self) -> bool { |