summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--alacritty/src/event.rs4
-rw-r--r--alacritty_terminal/src/ansi.rs3
-rw-r--r--alacritty_terminal/src/term/mod.rs8
-rw-r--r--docs/escape_support.md3
5 files changed, 16 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5aa9806d..a849fbc6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Escape sequences to report text area size in pixels (`CSI 14 t`) and in characters (`CSI 18 t`)
- Support for single line terminals dimensions
- Right clicking on Wayland's client side decorations will show application menu
+- Escape sequences to enable and disable window urgency hints (`CSI ? 1042 h`, `CSI ? 1042 l`)
### Changed
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs
index e45795dd..a4437f6f 100644
--- a/alacritty/src/event.rs
+++ b/alacritty/src/event.rs
@@ -943,7 +943,9 @@ impl<N: Notify + OnResize> Processor<N> {
TerminalEvent::Bell => {
let bell_command = processor.ctx.config.bell().command.as_ref();
let _ = bell_command.map(|cmd| start_daemon(cmd.program(), cmd.args()));
- processor.ctx.window.set_urgent(!processor.ctx.terminal.is_focused);
+ if processor.ctx.terminal.mode().contains(TermMode::URGENCY_HINTS) {
+ processor.ctx.window.set_urgent(!processor.ctx.terminal.is_focused);
+ }
},
TerminalEvent::ClipboardStore(clipboard_type, content) => {
processor.ctx.clipboard.store(clipboard_type, content);
diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs
index 91dd5f77..5c2c9e57 100644
--- a/alacritty_terminal/src/ansi.rs
+++ b/alacritty_terminal/src/ansi.rs
@@ -402,6 +402,8 @@ pub enum Mode {
SgrMouse = 1006,
/// ?1007
AlternateScroll = 1007,
+ /// ?1042
+ UrgencyHints = 1042,
/// ?1049
SwapScreenAndSetRestoreCursor = 1049,
/// ?2004
@@ -434,6 +436,7 @@ impl Mode {
1005 => Mode::Utf8Mouse,
1006 => Mode::SgrMouse,
1007 => Mode::AlternateScroll,
+ 1042 => Mode::UrgencyHints,
1049 => Mode::SwapScreenAndSetRestoreCursor,
2004 => Mode::BracketedPaste,
_ => {
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs
index a33ac919..59549106 100644
--- a/alacritty_terminal/src/term/mod.rs
+++ b/alacritty_terminal/src/term/mod.rs
@@ -480,13 +480,17 @@ pub mod mode {
const UTF8_MOUSE = 0b0000_0100_0000_0000_0000;
const ALTERNATE_SCROLL = 0b0000_1000_0000_0000_0000;
const VI = 0b0001_0000_0000_0000_0000;
+ const URGENCY_HINTS = 0b0010_0000_0000_0000_0000;
const ANY = std::u32::MAX;
}
}
impl Default for TermMode {
fn default() -> TermMode {
- TermMode::SHOW_CURSOR | TermMode::LINE_WRAP | TermMode::ALTERNATE_SCROLL
+ TermMode::SHOW_CURSOR
+ | TermMode::LINE_WRAP
+ | TermMode::ALTERNATE_SCROLL
+ | TermMode::URGENCY_HINTS
}
}
}
@@ -2132,6 +2136,7 @@ impl<T: EventListener> Handler for Term<T> {
fn set_mode(&mut self, mode: ansi::Mode) {
trace!("Setting mode: {:?}", mode);
match mode {
+ ansi::Mode::UrgencyHints => self.mode.insert(TermMode::URGENCY_HINTS),
ansi::Mode::SwapScreenAndSetRestoreCursor => {
if !self.mode.contains(TermMode::ALT_SCREEN) {
self.swap_alt();
@@ -2182,6 +2187,7 @@ impl<T: EventListener> Handler for Term<T> {
fn unset_mode(&mut self, mode: ansi::Mode) {
trace!("Unsetting mode: {:?}", mode);
match mode {
+ ansi::Mode::UrgencyHints => self.mode.remove(TermMode::URGENCY_HINTS),
ansi::Mode::SwapScreenAndSetRestoreCursor => {
if self.mode.contains(TermMode::ALT_SCREEN) {
self.swap_alt();
diff --git a/docs/escape_support.md b/docs/escape_support.md
index 64ffef89..f1a0337c 100644
--- a/docs/escape_support.md
+++ b/docs/escape_support.md
@@ -56,7 +56,8 @@ brevity.
| `CSI h` | PARTIAL | Only modes `4` and `20` are supported |
| `CSI ? h` | PARTIAL | Supported modes: |
| | | `1`, `3`, `6`, `7`, `12`, `25`, `1000`, `1002` |
-| | | `1004`, `1005`, `1006`, `1007`, `1049`, `2004` |
+| | | `1004`, `1005`, `1006`, `1007`, `1042`, `1049` |
+| | | `2004` |
| `CSI I` | IMPLEMENTED | |
| `CSI J` | IMPLEMENTED | |
| `CSI K` | IMPLEMENTED | |