diff --git a/CHANGELOG.md b/CHANGELOG.md index f39c0243..77bae7e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,10 @@ -### next +### v1.36.0 - 2024-03-01 + - releases at github should be more `cargo binstall` friendly - Thanks @FrancescElies - improved `--help` +- new `:stage_all_directories` internal - Fix #844 - `:print_tree` is one line shorter, so as to let the original shell command visible without scroll +- fix and document the "kitty-csi-check" optional feature which can be enabled at compilation ### v1.35.0 - 2024-03-01 diff --git a/Cargo.lock b/Cargo.lock index 09cd78d2..e4d16545 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -217,7 +217,7 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "broot" -version = "1.35.1-dev" +version = "1.36.0" dependencies = [ "ahash 0.8.11", "ansi_colours", @@ -270,7 +270,7 @@ dependencies = [ "unicode-width", "uzers", "which", - "xterm-query 0.1.0", + "xterm-query", ] [[package]] @@ -2147,7 +2147,7 @@ dependencies = [ "coolor", "crossterm", "thiserror", - "xterm-query 0.3.0", + "xterm-query", ] [[package]] @@ -2868,16 +2868,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9" -[[package]] -name = "xterm-query" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf3ae9267e2d939a754366532ed14fc9c4eeb08eb4f51884c3036c85e9120b4" -dependencies = [ - "nix 0.22.3", - "thiserror", -] - [[package]] name = "xterm-query" version = "0.3.0" diff --git a/Cargo.toml b/Cargo.toml index 737be720..0fb7ed52 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "broot" -version = "1.35.1-dev" +version = "1.36.0" authors = ["dystroy "] repository = "https://github.com/Canop/broot" homepage = "https://dystroy.org/broot" @@ -66,7 +66,7 @@ trash = "3.1.2" umask = "2.1.0" unicode-width = "0.1.10" which = "4.4.0" -xterm-query = { version = "0.1", optional = true } +xterm-query = { version = "0.3", optional = true } [dev-dependencies] glassbench = "0.4" diff --git a/bacon.toml b/bacon.toml index d12334bd..ee3901e3 100644 --- a/bacon.toml +++ b/bacon.toml @@ -14,7 +14,7 @@ watch = ["tests", "benches", "examples"] command = [ "cargo", "check", "--color", "always", - "--features", "clipboard", + "--features", "clipboard, kitty-csi-check", ] need_stdout = false watch = ["benches"] diff --git a/features.md b/features.md index 3d54e0a7..f2b0e1da 100644 --- a/features.md +++ b/features.md @@ -1,16 +1,27 @@ - This page defines the optional features which may be applied on compilation: * clipboard +* kitty-csi-check Feature gating is usually temporary: they may be removed when a technical problem is solved, when a feature becomes "mainstream", or when it's dropped because no user mentioned using it. ## The "clipboard" feature -This feature allows the `:copy_path` verb which copies the currently selected path into the clipboard. +This feature allows the `:copy_path` verb which copies the currently selected path into the clipboard, as well as copy-pasting from,to,whithin the input. Limits: - the feature doesn't compile right now on some platforms (for example Raspberry) - on some platforms the content leaves the clipboard when you quit broot (so you must paste while broot is still running) + +## The "kitty-csi-check" feature + +The Kitty graphics protocol allows displaying images in high resolution in broot. + +Most terminals don't support it, so support must be verified. + +Doing this with CSI escape sequences is a solution, but it involve delays and should only be enabled when this support can't be determined with [environment variables](https://dystroy.org/broot/launch/#environment-variables). + +Enabling this feature is thus not recommended unless you use a terminal you know support this protocol and isn't recognized by broot. If this happen, please tell me so that we can update one of the fast checks. + diff --git a/src/kitty/detect_support.rs b/src/kitty/detect_support.rs index da364117..59bffce9 100644 --- a/src/kitty/detect_support.rs +++ b/src/kitty/detect_support.rs @@ -61,8 +61,12 @@ pub fn is_kitty_graphics_protocol_supported() -> bool { #[cfg(feature = "kitty-csi-check")] { let start = std::time::Instant::now(); - const TIMEOUT_MS: isize = 400; - let s = match xterm_query::query("\x1b_Gi=31,s=1,v=1,a=q,t=d,f=24;AAAA\x1b\\\x1b[c", TIMEOUT_MS) { + const TIMEOUT_MS: u64 = 200; + let response = xterm_query::query( + "\x1b_Gi=31,s=1,v=1,a=q,t=d,f=24;AAAA\x1b\\\x1b[c", + TIMEOUT_MS, + ); + let s = match response { Err(e) => { debug!("xterm querying failed: {}", e); false