From 6ffe4f36ce55413ae0fe2dc2b1bd8e9ddc0bb000 Mon Sep 17 00:00:00 2001 From: Chinmay Dalal Date: Sat, 30 Oct 2021 14:38:20 +0530 Subject: [PATCH 1/4] Add foot --- src/terminal.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/terminal.rs b/src/terminal.rs index b3d54e06..f92d2507 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -86,6 +86,11 @@ fn is_wezterm() -> bool { || std::env::var("TERM").map_or(false, |value| value == "wezterm") } +/// Checks if the current terminal is foot. +fn is_foot() -> bool { + std::env::var("TERM").map_or(false, |value| value == "foot") +} + impl TerminalCapabilities { /// A terminal which supports nothing. pub fn none() -> TerminalCapabilities { @@ -172,6 +177,18 @@ impl TerminalCapabilities { } } + /// Terminal capabilities of foot + /// Foot is a fast, lightweight and minimalistic Wayland terminal emulator + pub fn foot() -> TerminalCapabilities { + TerminalCapabilities { + name: "foot".to_string(), + style: Some(StyleCapability::Ansi(AnsiStyle)), + links: Some(LinkCapability::Osc8(self::osc::Osc8Links)), + image: None, + marks: None, + } + } + /// Detect the capabilities of the current terminal. pub fn detect() -> TerminalCapabilities { if self::iterm2::is_iterm2() { @@ -182,6 +199,8 @@ impl TerminalCapabilities { Self::kitty() } else if is_wezterm() { Self::wezterm() + } else if is_foot() { + Self::foot() } else if get_vte_version().filter(|&v| v >= (50, 0)).is_some() { Self::vte50() } else { From 8e9616f7ac6faed007b91fe7cf042ee8cfb26659 Mon Sep 17 00:00:00 2001 From: Chinmay Dalal Date: Sat, 30 Oct 2021 15:49:58 +0530 Subject: [PATCH 2/4] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 30be6744..d5d8911d 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ Then it | [iTerm2][] | ✓ | ✓ | ✓ | ✓ 2) | ✓ | | [kitty][] | ✓ | ✓ | ✓ | ✓ 2) | | | [WezTerm][] | ✓ | ✓ | ✓ | ✓ 2) | | +| [foot][] | ✓ | ✓ | ✓ | | | 1) VTE is Gnome’s terminal emulation library used by many popular terminal emulators on Linux, including Gnome Terminal, Xfce Terminal, Tilix, etc. 2) SVG images require `rsvg-convert` from librsvg. @@ -53,6 +54,7 @@ Not supported: [ConEmu]: https://conemu.github.io [iterm2]: https://www.iterm2.com [WezTerm]: https://wezfurlong.org/wezterm/ +[foot]: https://codeberg.org/dnkl/foot/ ## Usage From cde6d13607240cc04e576aec6213d053f4065de5 Mon Sep 17 00:00:00 2001 From: Chinmay Dalal Date: Sat, 30 Oct 2021 15:52:52 +0530 Subject: [PATCH 3/4] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8892f1f5..f9874e98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html To publish a new release run `scripts/release` from the project directory. ## [Unreleased] - +- Support for [foot](https://codeberg.org/dnkl/foot/) (see [GH-190]) ## [0.23.2] – 2021-07-18 ### Changed @@ -31,6 +31,7 @@ To publish a new release run `scripts/release` from the project directory. [GH-182]: https://github.com/lunaryorn/mdcat/pull/182 [GH-183]: https://github.com/lunaryorn/mdcat/issues/183 [GH-184]: https://github.com/lunaryorn/mdcat/pull/184 +[GH-190]: https://github.com/lunaryorn/mdcat/pull/190 ## [0.22.4] – 2021-04-15 From 991982e1e53e9d99327c5cbd7771a16fc97eefef Mon Sep 17 00:00:00 2001 From: Chinmay Dalal Date: Sat, 30 Oct 2021 18:51:05 +0530 Subject: [PATCH 4/4] Fix changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9874e98..7149830a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,12 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html To publish a new release run `scripts/release` from the project directory. ## [Unreleased] + +### Added - Support for [foot](https://codeberg.org/dnkl/foot/) (see [GH-190]) + +[GH-190]: https://github.com/lunaryorn/mdcat/pull/190 + ## [0.23.2] – 2021-07-18 ### Changed @@ -31,7 +36,6 @@ To publish a new release run `scripts/release` from the project directory. [GH-182]: https://github.com/lunaryorn/mdcat/pull/182 [GH-183]: https://github.com/lunaryorn/mdcat/issues/183 [GH-184]: https://github.com/lunaryorn/mdcat/pull/184 -[GH-190]: https://github.com/lunaryorn/mdcat/pull/190 ## [0.22.4] – 2021-04-15