diff options
| author | Aram Drevekenin <aram@poor.dev> | 2026-07-28 12:05:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-28 12:05:38 +0200 |
| commit | 9969ed10b2cd95cb84ddaf8a783949483e2b038b (patch) | |
| tree | b8f6fe9a11e69440b6d9cb8ef56ee71c4d79fe9c | |
| parent | Nested session handling (#5417) (diff) | |
| download | sl0ppij-9969ed10b2cd95cb84ddaf8a783949483e2b038b.tar.gz sl0ppij-9969ed10b2cd95cb84ddaf8a783949483e2b038b.tar.xz sl0ppij-9969ed10b2cd95cb84ddaf8a783949483e2b038b.zip | |
Dep upgrades for debian (#5420)
* chore(deps): upgrade base64 0.22, colored 3.1, crossterm 0.29, dialoguer 0.11, directories 6.0, highway 1.2, prost 0.12.6, strip-ansi-escapes 0.2.1, suggest 0.5.1
* chore(deps): upgrade miette 7.6, nix 0.30, notify 8.2, notify-debouncer-full 0.5
* vte 0.15
* clap 4.6
* workspaceify plugin deps
* don't send empty fs watch events
87 files changed, 853 insertions, 1418 deletions
@@ -12,18 +12,18 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.17.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "ahash" @@ -39,15 +39,6 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" -dependencies = [ - "memchr", -] - -[[package]] -name = "aho-corasick" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" @@ -92,6 +83,56 @@ dependencies = [ ] [[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.60.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.60.2", +] + +[[package]] name = "anyhow" version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -108,12 +149,6 @@ checksum = "c5d78ce20460b82d3fa150275ed9d55e21064fc7951177baacf86a145c4a4b1f" [[package]] name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - -[[package]] -name = "arrayvec" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" @@ -192,7 +227,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "021e862c184ae977658b36c4500f7feac3221ca5da43e3f25bd04ab6c79a29b5" dependencies = [ "axum-core", - "base64 0.22.1", + "base64", "bytes", "form_urlencoded", "futures-util", @@ -289,17 +324,17 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.65" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11a17d453482a265fd5f8479f2a3f405566e6ca627837aaddb85af8b1ab8ef61" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-link 0.2.1", ] [[package]] @@ -313,12 +348,6 @@ dependencies = [ [[package]] name = "base64" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" - -[[package]] -name = "base64" version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" @@ -345,16 +374,6 @@ dependencies = [ ] [[package]] -name = "bstr" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a246e68bb43f6cd9db24bea052a53e40405417c5fb372e3d1a8a7f770a564ef5" -dependencies = [ - "memchr", - "serde", -] - -[[package]] name = "bumpalo" version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -380,7 +399,7 @@ checksum = "e41cc18551193fe8fa6f15c1e3c799bc5ec9e2cfbfaa8ed46f37013e3e6c173c" dependencies = [ "cap-primitives", "cap-std", - "io-lifetimes 2.0.3", + "io-lifetimes", "windows-sys 0.59.0", ] @@ -393,7 +412,7 @@ dependencies = [ "ambient-authority", "fs-set-times", "io-extras", - "io-lifetimes 2.0.3", + "io-lifetimes", "ipnet", "maybe-owned", "rustix 1.1.2", @@ -420,7 +439,7 @@ checksum = "07c0355ca583dd58f176c3c12489d684163861ede3c9efa6fd8bba314c984189" dependencies = [ "cap-primitives", "io-extras", - "io-lifetimes 2.0.3", + "io-lifetimes", "rustix 1.1.2", ] @@ -463,6 +482,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] +name = "cfg_aliases" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" + +[[package]] name = "chrono" version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -478,51 +503,53 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.4" +version = "4.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d20de3739b4fb45a17837824f40aa1769cc7655d7a83e68739a77fe7b30c87a" +checksum = "d91e0c145792ef73a6ad36d27c75ac09f1832222a3c209689d90f534685ee5b7" dependencies = [ - "atty", - "bitflags 1.3.2", + "clap_builder", "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f09628afdcc538b57f3c6341e9c8e9970f18e4a481690a64974d7023bd33548b" +dependencies = [ + "anstream", + "anstyle", "clap_lex", - "indexmap 1.8.2", - "once_cell", "strsim", - "termcolor", - "textwrap", + "terminal_size 0.4.4", ] [[package]] name = "clap_complete" -version = "3.2.1" +version = "4.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f6ebaab5f25e4f0312dfa07cb30a755204b96e6531457c2cfdecfdf5f2adf40" +checksum = "b1f84a88507dbd05c695f2cb5e8558e747179134005e9893882dec964190ed89" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "3.2.4" +version = "4.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "026baf08b89ffbd332836002ec9378ef0e69648cbfadd68af7cd398ca5bf98f7" +checksum = "d012d2b9d65aca7f18f4d9878a045bc17899bba951561ba5ec3c2ba1eed9a061" dependencies = [ - "heck 0.4.0", - "proc-macro-error", + "heck", "proc-macro2", "quote", - "syn 1.0.96", + "syn 3.0.3", ] [[package]] name = "clap_lex" -version = "0.2.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5538cd660450ebeb4234cfecf8f2284b844ffc4c50531e66d584ad5b91293613" -dependencies = [ - "os_str_bytes", -] +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" [[package]] name = "close_fds" @@ -544,14 +571,18 @@ dependencies = [ ] [[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] name = "colored" -version = "2.0.0" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" +checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" dependencies = [ - "atty", - "lazy_static", - "winapi", + "windows-sys 0.60.2", ] [[package]] @@ -565,8 +596,7 @@ name = "compact-bar" version = "0.1.0" dependencies = [ "ansi_term", - "colored", - "unicode-width 0.1.10", + "unicode-width 0.1.14", "zellij-tile", "zellij-tile-utils", ] @@ -584,8 +614,6 @@ dependencies = [ name = "configuration" version = "0.1.0" dependencies = [ - "ansi_term", - "chrono", "zellij-tile", ] @@ -599,8 +627,8 @@ dependencies = [ "libc", "once_cell", "regex", - "terminal_size", - "unicode-width 0.1.10", + "terminal_size 0.1.17", + "unicode-width 0.1.14", "winapi", ] @@ -710,15 +738,16 @@ dependencies = [ [[package]] name = "crossterm" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" +checksum = "d8b9f2e4c67f833b660cdb0a3523065869fb35570177239812ed4c905aeff87b" dependencies = [ "bitflags 2.11.0", "crossterm_winapi", - "mio 1.0.3", + "document-features", + "mio", "parking_lot 0.12.1", - "rustix 0.38.44", + "rustix 1.1.2", "signal-hook", "signal-hook-mio", "winapi", @@ -821,12 +850,13 @@ dependencies = [ [[package]] name = "dialoguer" -version = "0.10.4" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" +checksum = "658bce805d770f407bc62102fca7c2c64ceef2fbcb2b8bd19d2765ce093980de" dependencies = [ "console", "shell-words", + "thiserror 1.0.61", "zeroize", ] @@ -842,11 +872,11 @@ dependencies = [ [[package]] name = "directories" -version = "5.0.1" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" +checksum = "16f5094c54661b38d03bd7e50df373292118db60b585c08a411c6d840017fe7d" dependencies = [ - "dirs-sys 0.4.1", + "dirs-sys 0.5.0", ] [[package]] @@ -865,20 +895,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" dependencies = [ "libc", - "redox_users", + "redox_users 0.4.3", "winapi", ] [[package]] name = "dirs-sys" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" dependencies = [ "libc", "option-ext", - "redox_users", - "windows-sys 0.48.0", + "redox_users 0.5.2", + "windows-sys 0.60.2", ] [[package]] @@ -905,6 +935,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" [[package]] +name = "document-features" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" +dependencies = [ + "litrs", +] + +[[package]] name = "dunce" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1034,18 +1073,6 @@ dependencies = [ ] [[package]] -name = "filetime" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" -dependencies = [ - "cfg-if", - "libc", - "libredox", - "windows-sys 0.59.0", -] - -[[package]] name = "find-msvc-tools" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1062,7 +1089,6 @@ name = "fixture-plugin-for-tests" version = "0.1.0" dependencies = [ "serde", - "serde_json", "zellij-tile", ] @@ -1109,7 +1135,7 @@ version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "033b337d725b97690d86893f9de22b67b80dcc4e9ad815f348254c38119db8fb" dependencies = [ - "io-lifetimes 2.0.3", + "io-lifetimes", "rustix 0.38.44", "windows-sys 0.52.0", ] @@ -1258,7 +1284,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" dependencies = [ - "unicode-width 0.1.10", + "unicode-width 0.1.14", ] [[package]] @@ -1297,22 +1323,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.1" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" - -[[package]] -name = "globset" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" -dependencies = [ - "aho-corasick 0.7.20", - "bstr", - "fnv", - "log", - "regex", -] +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" [[package]] name = "h2" @@ -1380,12 +1393,6 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" - -[[package]] -name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" @@ -1401,21 +1408,15 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" - -[[package]] -name = "hermit-abi" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "highway" -version = "0.6.4" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3461b968f695ca312b968503261f5a345de0f02a39dbaa3021f20d53b426395d" +checksum = "c706f1711006204c2ba8fb1a7bd55f689bbf7feca9ff40325206b5e140cff6df" [[package]] name = "http" @@ -1642,23 +1643,6 @@ dependencies = [ ] [[package]] -name = "ignore" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" -dependencies = [ - "globset", - "lazy_static", - "log", - "memchr", - "regex", - "same-file", - "thread_local", - "walkdir", - "winapi-util", -] - -[[package]] name = "include_dir" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1699,20 +1683,20 @@ dependencies = [ [[package]] name = "inotify" -version = "0.9.6" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" +checksum = "153be1941a183ec9ccd095ddbe17a8b8d435ef6c76e9e02451b933c3999af2c8" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.11.0", "inotify-sys", "libc", ] [[package]] name = "inotify-sys" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +checksum = "c033f80b2c113cdf91ab7a33faa9cbc014726dcad99880c8609af2a370edf37d" dependencies = [ "libc", ] @@ -1771,23 +1755,12 @@ version = "0.18.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2285ddfe3054097ef4b2fe909ef8c3bcd1ea52a8f0d274416caebeef39f04a65" dependencies = [ - "io-lifetimes 2.0.3", + "io-lifetimes", "windows-sys 0.59.0", ] [[package]] name = "io-lifetimes" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" -dependencies = [ - "hermit-abi 0.3.1", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "io-lifetimes" version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a611371471e98973dbcab4e0ec66c31a10bc356eeb4d54a0e05eac8158fe38c" @@ -1799,22 +1772,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] -name = "is-terminal" -version = "0.4.7" +name = "is_ci" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" -dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes 1.0.10", - "rustix 0.37.28", - "windows-sys 0.48.0", -] +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] -name = "is_ci" -version = "1.1.1" +name = "is_terminal_polyfill" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "isahc" @@ -1892,16 +1859,16 @@ version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8388a371e0e2ede18bbd94e476fcd45b4ac65cefcedf0c06fd13bd8389574a6" dependencies = [ - "miette", + "miette 5.8.0", "nom", "thiserror 1.0.61", ] [[package]] name = "kqueue" -version = "1.0.7" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8fc60ba15bf51257aa9807a48a61013db043fcf3a78cb0d916e8e396dcad98" +checksum = "273c0752728918e0ac4976f2b275b6fefb9ecd400585dec929419f3844cd87b5" dependencies = [ "kqueue-sys", "libc", @@ -1909,11 +1876,11 @@ dependencies = [ [[package]] name = "kqueue-sys" -version = "1.0.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8367585489f01bc55dd27404dcf56b95e6da061a256a666ab23be9ba96a2e587" +checksum = "07293a4e297ac234359b510362495713f75ea345d5307140414f20c69ffeb087" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.11.0", "libc", ] @@ -1922,9 +1889,9 @@ name = "layout-manager" version = "0.1.0" dependencies = [ "fuzzy-matcher", - "miette", - "strip-ansi-escapes 0.2.1", - "unicode-width 0.1.10", + "miette 7.6.0", + "strip-ansi-escapes", + "unicode-width 0.1.14", "zellij-tile", ] @@ -1982,7 +1949,6 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.11.0", "libc", - "redox_syscall 0.5.13", ] [[package]] @@ -2037,12 +2003,6 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "linux-raw-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f" - -[[package]] -name = "linux-raw-sys" version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" @@ -2060,6 +2020,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" [[package]] +name = "litrs" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" + +[[package]] name = "lock_api" version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2132,19 +2098,29 @@ version = "5.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92a992891d5579caa9efd8e601f82e30a1caa79a27a5db075dde30ecb9eab357" dependencies = [ + "miette-derive 5.8.0", + "once_cell", + "thiserror 1.0.61", + "unicode-width 0.1.14", +] + +[[package]] +name = "miette" +version = "7.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" +dependencies = [ "backtrace", "backtrace-ext", - "is-terminal", - "miette-derive", - "once_cell", + "cfg-if", + "miette-derive 7.6.0", "owo-colors", "supports-color", "supports-hyperlinks", "supports-unicode", - "terminal_size", + "terminal_size 0.4.4", "textwrap", - "thiserror 1.0.61", - "unicode-width 0.1.10", + "unicode-width 0.1.14", ] [[package]] @@ -2159,6 +2135,17 @@ dependencies = [ ] [[package]] +name = "miette-derive" +version = "7.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] name = "mime" version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2172,23 +2159,11 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.5.3" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", + "adler2", ] [[package]] @@ -2208,7 +2183,7 @@ name = "mobile" version = "0.1.0" dependencies = [ "fuzzy-matcher", - "unicode-width 0.1.10", + "unicode-width 0.1.14", "zellij-tile", ] @@ -2222,7 +2197,6 @@ checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" name = "multiple-select" version = "0.1.0" dependencies = [ - "fuzzy-matcher", "zellij-tile", ] @@ -2237,15 +2211,14 @@ dependencies = [ [[package]] name = "nix" -version = "0.23.1" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" +checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" dependencies = [ - "bitflags 1.3.2", - "cc", + "bitflags 2.11.0", "cfg-if", + "cfg_aliases", "libc", - "memoffset", ] [[package]] @@ -2260,37 +2233,45 @@ dependencies = [ [[package]] name = "notify" -version = "6.1.1" +version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" +checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3" dependencies = [ "bitflags 2.11.0", - "crossbeam-channel", - "filetime", "fsevent-sys", "inotify", "kqueue", "libc", "log", - "mio 0.8.11", + "mio", + "notify-types", "walkdir", - "windows-sys 0.48.0", + "windows-sys 0.60.2", ] [[package]] name = "notify-debouncer-full" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb7fd166739789c9ff169e654dc1501373db9d80a4c3f972817c8a4d7cf8f34e" +checksum = "d2d88b1a7538054351c8258338df7c931a590513fb3745e8c15eb9ff4199b8d1" dependencies = [ "file-id", "log", "notify", - "parking_lot 0.12.1", + "notify-types", "walkdir", ] [[package]] +name = "notify-types" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42b8cfee0e339a0337359f3c88165702ac6e600dc01c0cc9579a92d62b08477a" +dependencies = [ + "bitflags 2.11.0", +] + +[[package]] name = "ntapi" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2345,9 +2326,9 @@ dependencies = [ [[package]] name = "object" -version = "0.28.4" +version = "0.37.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" dependencies = [ "memchr", ] @@ -2359,6 +2340,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2399,16 +2386,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] -name = "os_str_bytes" -version = "6.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afa" - -[[package]] name = "owo-colors" -version = "3.4.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "decf7381921fea4dcb2549c5667eda59b3ec297ab7e2b5fc33eac69d2e7da87b" +checksum = "d211803b9b6b570f68772237e415a029d5a50c65d382910b879fb19d3271f94d" [[package]] name = "parking" @@ -2470,7 +2451,7 @@ version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d30c53c26bc5b31a98cd02d20f25a7c8567146caf63ed593a9d87b2775291be" dependencies = [ - "base64 0.22.1", + "base64", "serde_core", ] @@ -2593,43 +2574,19 @@ dependencies = [ ] [[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.96", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.11.9" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", "prost-derive", @@ -2637,51 +2594,50 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.11.9" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" +checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", - "heck 0.4.0", + "heck", "itertools", - "lazy_static", "log", "multimap", + "once_cell", "petgraph", "prost", "prost-types", "regex", "tempfile", - "which", ] [[package]] name = "prost-derive" -version = "0.11.9" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn 1.0.96", + "syn 2.0.96", ] [[package]] name = "prost-types" -version = "0.11.9" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ "prost", ] [[package]] name = "quote" -version = "1.0.36" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" dependencies = [ "proc-macro2", ] @@ -2785,23 +2741,25 @@ dependencies = [ ] [[package]] -name = "redox_syscall" -version = "0.5.13" +name = "redox_users" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "bitflags 2.11.0", + "getrandom 0.2.10", + "redox_syscall 0.2.13", + "thiserror 1.0.61", ] [[package]] name = "redox_users" -version = "0.4.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" dependencies = [ "getrandom 0.2.10", - "redox_syscall 0.2.13", - "thiserror 1.0.61", + "libredox", + "thiserror 2.0.12", ] [[package]] @@ -2810,7 +2768,7 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" dependencies = [ - "aho-corasick 1.0.1", + "aho-corasick", "memchr", "regex-syntax", ] @@ -2851,9 +2809,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "b74b56ffa8bb2830709a538c2cbcae9aa062db0d2a42563bfb09bdaae44020eb" [[package]] name = "rustc_version" @@ -2866,20 +2824,6 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "519165d378b97752ca44bbe15047d5d3409e875f39327546b42ac81d7e18c1b6" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes 1.0.10", - "libc", - "linux-raw-sys 0.3.7", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" @@ -3183,11 +3127,9 @@ dependencies = [ name = "session-manager" version = "0.1.0" dependencies = [ - "ansi_term", - "chrono", "fuzzy-matcher", "humantime", - "unicode-width 0.1.10", + "unicode-width 0.1.14", "uuid", "zellij-tile", ] @@ -3218,7 +3160,6 @@ dependencies = [ name = "share" version = "0.1.0" dependencies = [ - "rand 0.9.0", "url", "zellij-tile", ] @@ -3261,7 +3202,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b75a19a7a740b25bc7944bdee6172368f988763b744e3d4dfe753f6b4ece40cc" dependencies = [ "libc", - "mio 1.0.3", + "mio", "signal-hook", ] @@ -3295,7 +3236,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b71b7f6629ac964d60179c1fb00dfb80da265fc3465a17245e26c1eaf678d476" dependencies = [ - "arrayvec 0.7.6", + "arrayvec", "thiserror 1.0.61", ] @@ -3323,12 +3264,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] -name = "smawk" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" - -[[package]] name = "socket2" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3377,14 +3312,13 @@ name = "status-bar" version = "0.1.0" dependencies = [ "ansi_term", - "colored", "lazy_static", - "rand 0.8.5", + "rand 0.9.0", "regex", "serde", "serde_json", "thiserror 1.0.61", - "unicode-width 0.1.10", + "unicode-width 0.1.14", "zellij-tile", "zellij-tile-utils", ] @@ -3393,15 +3327,9 @@ dependencies = [ name = "strider" version = "0.2.0" dependencies = [ - "ansi_term", - "colored", "fuzzy-matcher", - "ignore", "pretty-bytes", - "serde", - "serde_json", - "strip-ansi-escapes 0.1.1", - "unicode-width 0.1.10", + "unicode-width 0.1.14", "zellij-tile", ] @@ -3417,15 +3345,6 @@ dependencies = [ [[package]] name = "strip-ansi-escapes" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "011cbb39cf7c1f62871aea3cc46e5817b0937b49e9447370c93cacbe93a766d8" -dependencies = [ - "vte 0.10.1", -] - -[[package]] -name = "strip-ansi-escapes" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a8f8038e7e7969abb3f1b7c2a811225e9296da208539e0f79c5251d6cac0025" @@ -3435,9 +3354,9 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" @@ -3451,7 +3370,7 @@ version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn 2.0.96", @@ -3465,41 +3384,33 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "suggest" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2558d0d6327d908558f161bc862d365c0d33aa796bdc81c13c0f954868576659" +checksum = "4ea0e0ed5f30fcbe4c59fa9d387c9e853c964109e6d046d2e56c8960d3969fb8" dependencies = [ - "clap", "lev_distance", ] [[package]] name = "supports-color" -version = "2.0.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4950e7174bffabe99455511c39707310e7e9b440364a2fcb1cc21521be57b354" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" dependencies = [ - "is-terminal", "is_ci", ] [[package]] name = "supports-hyperlinks" -version = "2.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84231692eb0d4d41e4cdd0cabfdd2e6cd9e255e65f80c9aa7c98dd502b4233d" -dependencies = [ - "is-terminal", -] +checksum = "e396b6523b11ccb83120b115a0b7366de372751aa6edf19844dfb13a6af97e91" [[package]] name = "supports-unicode" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b6c2cb240ab5dd21ed4906895ee23fe5a48acdbd15a3ce388e7b62a9b66baf7" -dependencies = [ - "is-terminal", -] +checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" @@ -3524,6 +3435,17 @@ dependencies = [ ] [[package]] +name = "syn" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] name = "sync_wrapper" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3564,7 +3486,7 @@ dependencies = [ "cap-fs-ext", "cap-std", "fd-lock", - "io-lifetimes 2.0.3", + "io-lifetimes", "rustix 0.38.44", "windows-sys 0.52.0", "winx", @@ -3575,8 +3497,7 @@ name = "tab-bar" version = "0.1.0" dependencies = [ "ansi_term", - "colored", - "unicode-width 0.1.10", + "unicode-width 0.1.14", "zellij-tile", "zellij-tile-utils", ] @@ -3594,33 +3515,33 @@ dependencies = [ ] [[package]] -name = "termcolor" -version = "1.4.1" +name = "terminal_size" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" dependencies = [ - "winapi-util", + "libc", + "winapi", ] [[package]] name = "terminal_size" -version = "0.1.17" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" dependencies = [ - "libc", - "winapi", + "rustix 1.1.2", + "windows-sys 0.60.2", ] [[package]] name = "textwrap" -version = "0.15.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" dependencies = [ - "smawk", "unicode-linebreak", - "unicode-width 0.1.10", + "unicode-width 0.2.1", ] [[package]] @@ -3734,7 +3655,7 @@ dependencies = [ "backtrace", "bytes", "libc", - "mio 1.0.3", + "mio", "pin-project-lite", "signal-hook-registry", "socket2 0.5.7", @@ -4024,18 +3945,15 @@ checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" [[package]] name = "unicode-linebreak" -version = "0.1.2" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a52dcaab0c48d931f7cc8ef826fa51690a08e1ea55117ef26f89864f532383f" -dependencies = [ - "regex", -] +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-width" @@ -4081,9 +3999,9 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "utf8parse" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936e4b492acfd135421d8dca4b1aa80a7bfc26e702ef3af710e0752684df5372" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" @@ -4129,27 +4047,6 @@ dependencies = [ [[package]] name = "vte" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cbce692ab4ca2f1f3047fcf732430249c0e971bfdd2b234cf2c47ad93af5983" -dependencies = [ - "arrayvec 0.5.2", - "utf8parse", - "vte_generate_state_changes", -] - -[[package]] -name = "vte" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aae21c12ad2ec2d168c236f369c38ff332bc1134f7246350dca641437365045" -dependencies = [ - "utf8parse", - "vte_generate_state_changes", -] - -[[package]] -name = "vte" version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "231fdcd7ef3037e8330d8e17e61011a2c244126acc0a982f4040ac3f9f0bc077" @@ -4158,13 +4055,13 @@ dependencies = [ ] [[package]] -name = "vte_generate_state_changes" -version = "0.1.1" +name = "vte" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d257817081c7dffcdbab24b9e62d2def62e2ff7d00b1c20062551e6cccc145ff" +checksum = "a5924018406ce0063cd67f8e008104968b74b563ee1b85dde3ed1f7cb87d3dbd" dependencies = [ - "proc-macro2", - "quote", + "arrayvec", + "memchr", ] [[package]] @@ -4175,9 +4072,9 @@ checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "walkdir" -version = "2.3.3" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -4212,7 +4109,7 @@ dependencies = [ "cap-time-ext", "fs-set-times", "io-extras", - "io-lifetimes 2.0.3", + "io-lifetimes", "log", "rustix 1.1.2", "system-interface", @@ -4426,7 +4323,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab62083fdcecdd0cac61b8c46e7de4f2629ebe8699fd9ce790d922cc89d50f5f" dependencies = [ "anyhow", - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn 2.0.96", @@ -4974,15 +4871,14 @@ dependencies = [ "interprocess", "isahc", "log", - "miette", + "miette 7.6.0", "names", - "nix", - "rand 0.8.5", + "rand 0.9.0", "regex", "ssh2", "suggest", "thiserror 1.0.61", - "vte 0.11.0", + "vte 0.15.0", "zellij-client", "zellij-server", "zellij-utils", @@ -5009,7 +4905,6 @@ dependencies = [ "lazy_static", "log", "nix", - "notify", "num_cpus", "rcgen", "regex", @@ -5048,7 +4943,7 @@ dependencies = [ "log", "regex", "tokio", - "vte 0.11.0", + "vte 0.15.0", "zellij-client", "zellij-server", "zellij-utils", @@ -5060,9 +4955,9 @@ version = "0.45.0" dependencies = [ "ansi_term", "anyhow", - "arrayvec 0.7.6", + "arrayvec", "async-trait", - "base64 0.13.0", + "base64", "byteorder", "bytes", "chrono", @@ -5094,10 +4989,10 @@ dependencies = [ "tempfile", "tokio", "typetag", - "unicode-width 0.1.10", + "unicode-width 0.1.14", "url", "uuid", - "vte 0.11.0", + "vte 0.15.0", "wasmi", "wasmi_wasi", "windows-sys 0.59.0", @@ -5108,7 +5003,6 @@ dependencies = [ name = "zellij-tile" version = "0.45.0" dependencies = [ - "clap", "prost", "serde", "serde_json", @@ -5130,7 +5024,7 @@ version = "0.45.0" dependencies = [ "anyhow", "backtrace", - "base64 0.13.0", + "base64", "bitflags 2.11.0", "clap", "clap_complete", @@ -5152,7 +5046,7 @@ dependencies = [ "libc", "log", "log4rs", - "miette", + "miette 7.6.0", "names", "nix", "notify", @@ -5164,7 +5058,7 @@ dependencies = [ "serde_json", "sha2", "shellexpand", - "strip-ansi-escapes 0.1.1", + "strip-ansi-escapes", "strum", "strum_macros", "suggest", @@ -5173,7 +5067,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-util", - "unicode-width 0.1.10", + "unicode-width 0.1.14", "url", "uuid", "winapi", @@ -30,17 +30,14 @@ suggest = { workspace = true } thiserror = { workspace = true } isahc = { workspace = true } -[target.'cfg(unix)'.dependencies] -nix = { workspace = true } - [target.'cfg(windows)'.build-dependencies] embed-resource = "3" [dev-dependencies] insta = { version = "1.6.0", features = ["backtrace"] } ssh2 = "0.9.1" -rand = "0.8.0" -regex = "1.8.1" +rand = { workspace = true } +regex = { workspace = true } vte = { workspace = true } [workspace] @@ -81,10 +78,12 @@ rust-version = "1.92" ansi_term = { version = "0.12.1", default-features = false } anyhow = { version = "1.0.70", default-features = false, features = ["backtrace", "std"] } async-trait = { version = "0.1", default-features = false } -clap = { version = "3.2.2", default-features = false, features = ["env", "derive", "color", "std", "suggestions"] } -crossterm = { version = "0.28", default-features = false, features = ["windows"] } +chrono = { version = "0.4.19", default-features = false, features = ["std", "clock"] } +clap = { version = "4.6", default-features = false, features = ["std", "color", "help", "usage", "error-context", "suggestions", "wrap_help", "derive", "env"] } +crossterm = { version = "0.29", default-features = false, features = ["windows"] } daemonize = { package = "daemonix", version = "0.1", default-features = false } -dialoguer = { version = "0.10.4", default-features = false, features = ["password", "completion"] } +dialoguer = { version = "0.11", default-features = false, features = ["password", "completion"] } +fuzzy-matcher = { version = "0.3.7", default-features = false } humantime = { version = "2.1.0", default-features = false } interprocess = { version = "2.2", default-features = false, features = ["tokio"] } isahc = { version = "1.7.2", default-features = false, features = ["http2", "text-decoding"] } @@ -92,19 +91,22 @@ kdl = { version = "4.5.0", default-features = false, features = ["span"] } lazy_static = { version = "1.4.0", default-features = false } libc = { version = "0.2", default-features = false, features = ["std"] } log = { version = "0.4.17", default-features = false } -miette = { version = "5.7.0", default-features = false, features = ["fancy"] } -nix = { version = "0.23.1", default-features = false } -notify-debouncer-full = { version = "0.3.1", default-features = false } -notify = { version = "6.1.1", default-features = false, features = ["macos_kqueue"] } +miette = { version = "7.6", default-features = false, features = ["derive", "fancy"] } +nix = { version = "0.30", default-features = false } +notify-debouncer-full = { version = "0.5", default-features = false } +notify = { version = "8.2", default-features = false, features = ["macos_kqueue"] } num_cpus = { version = "1.16", default-features = false } -prost = { version = "0.11.9", default-features = false, features = ["std", "prost-derive"] } +pretty-bytes = { version = "0.2.2", default-features = false } +prost = { version = "0.12.6", default-features = false, features = ["std", "prost-derive"] } +rand = { version = "0.9", default-features = false, features = ["std", "std_rng", "thread_rng"] } regex = { version = "1.5.5", default-features = false, features = ["perf", "std", "unicode-perl"] } serde = { version = "1.0", default-features = false, features = ["derive", "std"] } serde_json = { version = "1.0", default-features = false, features = ["std"] } signal-hook = { version = "0.3", default-features = false, features = ["iterator"] } +strip-ansi-escapes = { version = "0.2.1", default-features = false } strum = { version = "0.27.2", default-features = false, features = ["std"] } strum_macros = { version = "0.27.2", default-features = false } -suggest = { version = "0.4.0", default-features = false } +suggest = { version = "0.5.1", default-features = false } tempfile = { version = "3.2.0", default-features = false } tokio = { version = "1.40", default-features = false, features = ["fs", "rt-multi-thread", "macros", "time", "process", "signal", "io-util", "io-std", "net"] } thiserror = { version = "1.0.40", default-features = false } @@ -112,7 +114,7 @@ tokio-util = { version = "0.7.15" } unicode-width = { version = "0.1.8", default-features = false } url = { version = "2.2.2", default-features = false, features = ["serde"] } uuid = { version = "1.4.1", default-features = false, features = ["serde", "v4", "std"] } -vte = { version = "0.11.0", default-features = false } +vte = { version = "0.15", default-features = false, features = ["std"] } windows-sys = { version = "0.59", default-features = false } names = { version = "0.14.0", default-features = false } include_dir = { version = "0.7.3", default-features = false } diff --git a/default-plugins/about/Cargo.toml b/default-plugins/about/Cargo.toml index e31b377c..f153d58a 100644 --- a/default-plugins/about/Cargo.toml +++ b/default-plugins/about/Cargo.toml @@ -7,4 +7,4 @@ license.workspace = true [dependencies] zellij-tile = { path = "../../zellij-tile" } -rand = "0.9.0" +rand = { workspace = true } diff --git a/default-plugins/compact-bar/Cargo.toml b/default-plugins/compact-bar/Cargo.toml index 1a3fbbe3..7e14011c 100644 --- a/default-plugins/compact-bar/Cargo.toml +++ b/default-plugins/compact-bar/Cargo.toml @@ -6,8 +6,7 @@ edition.workspace = true license.workspace = true [dependencies] -colored = "2" -ansi_term = "0.12" -unicode-width = "0.1.8" +ansi_term = { workspace = true } +unicode-width = { workspace = true } zellij-tile = { path = "../../zellij-tile" } zellij-tile-utils = { path = "../../zellij-tile-utils" } diff --git a/default-plugins/configuration/Cargo.toml b/default-plugins/configuration/Cargo.toml index a8154f25..a8baf706 100644 --- a/default-plugins/configuration/Cargo.toml +++ b/default-plugins/configuration/Cargo.toml @@ -6,6 +6,4 @@ edition.workspace = true license.workspace = true [dependencies] -ansi_term = "0.12.1" zellij-tile = { path = "../../zellij-tile" } -chrono = "0.4.0" diff --git a/default-plugins/fixture-plugin-for-tests/Cargo.toml b/default-plugins/fixture-plugin-for-tests/Cargo.toml index 5bbf5f30..b20f4fe7 100644 --- a/default-plugins/fixture-plugin-for-tests/Cargo.toml +++ b/default-plugins/fixture-plugin-for-tests/Cargo.toml @@ -6,6 +6,5 @@ edition.workspace = true license.workspace = true [dependencies] -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" +serde = { workspace = true } zellij-tile = { path = "../../zellij-tile" } diff --git a/default-plugins/layout-manager/Cargo.toml b/default-plugins/layout-manager/Cargo.toml index c6f2e961..c6870b7e 100644 --- a/default-plugins/layout-manager/Cargo.toml +++ b/default-plugins/layout-manager/Cargo.toml @@ -7,7 +7,7 @@ license.workspace = true [dependencies] zellij-tile = { path = "../../zellij-tile" } -miette = { version = "5.7.0", features = ["fancy"] } -strip-ansi-escapes = "0.2" -unicode-width = "0.1" -fuzzy-matcher = "0.3" +miette = { workspace = true } +strip-ansi-escapes = { workspace = true } +unicode-width = { workspace = true } +fuzzy-matcher = { workspace = true } diff --git a/default-plugins/mobile/Cargo.toml b/default-plugins/mobile/Cargo.toml index ea50f7f6..cb5cf67c 100644 --- a/default-plugins/mobile/Cargo.toml +++ b/default-plugins/mobile/Cargo.toml @@ -6,5 +6,5 @@ edition.workspace = true [dependencies] zellij-tile = { path = "../../zellij-tile" } -fuzzy-matcher = "0.3.7" -unicode-width = "0.1.10" +fuzzy-matcher = { workspace = true } +unicode-width = { workspace = true } diff --git a/default-plugins/multiple-select/Cargo.toml b/default-plugins/multiple-select/Cargo.toml index e29fa22f..d02ace95 100644 --- a/default-plugins/multiple-select/Cargo.toml +++ b/default-plugins/multiple-select/Cargo.toml @@ -7,4 +7,3 @@ license.workspace = true [dependencies] zellij-tile = { path = "../../zellij-tile" } -fuzzy-matcher = "0.3.7" diff --git a/default-plugins/plugin-manager/Cargo.toml b/default-plugins/plugin-manager/Cargo.toml index 0bf5700a..fc24733f 100644 --- a/default-plugins/plugin-manager/Cargo.toml +++ b/default-plugins/plugin-manager/Cargo.toml @@ -5,6 +5,6 @@ authors = ["Aram Drevekenin <aram@poor.dev>"] edition.workspace = true [dependencies] -uuid = { version = "1.7.0", features = ["v4"] } -fuzzy-matcher = "0.3.7" +uuid = { workspace = true } +fuzzy-matcher = { workspace = true } zellij-tile = { path = "../../zellij-tile" } diff --git a/default-plugins/session-manager/Cargo.toml b/default-plugins/session-manager/Cargo.toml index 064ff365..d6921ea3 100644 --- a/default-plugins/session-manager/Cargo.toml +++ b/default-plugins/session-manager/Cargo.toml @@ -5,10 +5,8 @@ authors = ["Aram Drevekenin <aram@poor.dev>"] edition.workspace = true [dependencies] -ansi_term = "0.12.1" zellij-tile = { path = "../../zellij-tile" } -chrono = "0.4.0" -fuzzy-matcher = "0.3.7" -unicode-width = "0.1.10" -humantime = "2.1.0" -uuid = { version = "1.7.0", features = ["v4"] } +fuzzy-matcher = { workspace = true } +unicode-width = { workspace = true } +humantime = { workspace = true } +uuid = { workspace = true } diff --git a/default-plugins/share/Cargo.toml b/default-plugins/share/Cargo.toml index 4a2db699..3a765b41 100644 --- a/default-plugins/share/Cargo.toml +++ b/default-plugins/share/Cargo.toml @@ -7,5 +7,4 @@ license.workspace = true [dependencies] zellij-tile = { path = "../../zellij-tile" } -url = "2.0" -rand = "0.9.0" +url = { workspace = true } diff --git a/default-plugins/status-bar/Cargo.toml b/default-plugins/status-bar/Cargo.toml index ad6fa2d4..6a95b100 100644 --- a/default-plugins/status-bar/Cargo.toml +++ b/default-plugins/status-bar/Cargo.toml @@ -6,16 +6,15 @@ edition.workspace = true license.workspace = true [dependencies] -colored = "2" -ansi_term = "0.12" -lazy_static = "1.4.0" -rand = "0.8.4" -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -thiserror = "1.0.30" -unicode-width = "0.1.8" +ansi_term = { workspace = true } +lazy_static = { workspace = true } +rand = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +thiserror = { workspace = true } +unicode-width = { workspace = true } zellij-tile = { path = "../../zellij-tile" } zellij-tile-utils = { path = "../../zellij-tile-utils" } [dev-dependencies] -regex = "1" +regex = { workspace = true } diff --git a/default-plugins/status-bar/src/tip/utils.rs b/default-plugins/status-bar/src/tip/utils.rs index 17b0d40d..96fed82b 100644 --- a/default-plugins/status-bar/src/tip/utils.rs +++ b/default-plugins/status-bar/src/tip/utils.rs @@ -1,6 +1,6 @@ use std::path::PathBuf; -use rand::prelude::{IteratorRandom, SliceRandom}; +use rand::prelude::{IndexedRandom, IteratorRandom}; use zellij_tile::prelude::get_zellij_version; @@ -15,7 +15,7 @@ macro_rules! get_name_and_caching { return name; }}; ($cache:expr, $from:expr) => {{ - let name = $from.choose(&mut rand::thread_rng()).unwrap().to_string(); + let name = $from.choose(&mut rand::rng()).unwrap().to_string(); $cache.caching(name.clone()).unwrap(); return name; }}; @@ -30,10 +30,7 @@ macro_rules! populate_cache { } pub fn get_random_tip_name() -> String { - TIPS.keys() - .choose(&mut rand::thread_rng()) - .unwrap() - .to_string() + TIPS.keys().choose(&mut rand::rng()).unwrap().to_string() } pub fn get_cached_tip_name() -> String { diff --git a/default-plugins/strider/Cargo.toml b/default-plugins/strider/Cargo.toml index 153c75af..1f5c9af7 100644 --- a/default-plugins/strider/Cargo.toml +++ b/default-plugins/strider/Cargo.toml @@ -7,13 +7,7 @@ description = "A simplified ranger clone written as a Zellij plugin" license.workspace = true [dependencies] -colored = "2.0.0" zellij-tile = { path = "../../zellij-tile" } -pretty-bytes = "0.2.2" -ignore = "0.4.20" -fuzzy-matcher = "0.3.7" -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -unicode-width = "0.1.8" -ansi_term = "0.12.1" -strip-ansi-escapes = "0.1.1" +pretty-bytes = { workspace = true } +fuzzy-matcher = { workspace = true } +unicode-width = { workspace = true } diff --git a/default-plugins/tab-bar/Cargo.toml b/default-plugins/tab-bar/Cargo.toml index 3288253a..2c47b939 100644 --- a/default-plugins/tab-bar/Cargo.toml +++ b/default-plugins/tab-bar/Cargo.toml @@ -6,8 +6,7 @@ edition.workspace = true license.workspace = true [dependencies] -colored = "2" -ansi_term = "0.12" -unicode-width = "0.1.8" +ansi_term = { workspace = true } +unicode-width = { workspace = true } zellij-tile = { path = "../../zellij-tile" } zellij-tile-utils = { path = "../../zellij-tile-utils" }
\ No newline at end of file diff --git a/src/tests/e2e/remote_runner.rs b/src/tests/e2e/remote_runner.rs index 9f6eec44..3d1115db 100644 --- a/src/tests/e2e/remote_runner.rs +++ b/src/tests/e2e/remote_runner.rs @@ -206,9 +206,7 @@ fn read_from_channel( should_sleep = true; }, Ok(count) => { - for byte in buf.iter().take(count) { - vte_parser.advance(&mut terminal_output.grid, *byte); - } + vte_parser.advance(&mut terminal_output.grid, &buf[..count]); let current_snapshot = take_snapshot(&mut terminal_output); let mut last_snapshot = last_snapshot.lock().unwrap(); *cursor_coordinates.lock().unwrap() = terminal_output diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index dbee94d2..cb4f4d6e 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -7,7 +7,7 @@ edition.workspace = true [dependencies] anyhow = { workspace = true } serde_json = { workspace = true } -prost-build = { version = "0.11.9", default-features = false } +prost-build = { version = "0.12.6", default-features = false } toml = { version = "0.5", default-features = false } which = { version = "4.2", default-features = false } xflags = { version = "0.3.2", default-features = false } diff --git a/zellij-client/Cargo.toml b/zellij-client/Cargo.toml index 70d313a2..3665ad3e 100644 --- a/zellij-client/Cargo.toml +++ b/zellij-client/Cargo.toml @@ -26,7 +26,6 @@ dialoguer = { workspace = true } interprocess = { workspace = true } lazy_static = { workspace = true } log = { workspace = true } -notify = { workspace = true } num_cpus = { workspace = true } regex = { workspace = true } serde = { workspace = true } @@ -53,7 +52,7 @@ signal-hook = { workspace = true } [target.'cfg(unix)'.dependencies] daemonize = { workspace = true } -nix = { workspace = true } +nix = { workspace = true, features = ["fs"] } [target.'cfg(windows)'.dependencies] crossterm = { workspace = true } diff --git a/zellij-client/src/remote_attach/mod.rs b/zellij-client/src/remote_attach/mod.rs index 99f8b92f..26228cfb 100644 --- a/zellij-client/src/remote_attach/mod.rs +++ b/zellij-client/src/remote_attach/mod.rs @@ -115,6 +115,12 @@ fn try_to_connect_with_saved_session_token( Ok(None) } +fn dialoguer_error_to_client_error(error: dialoguer::Error) -> RemoteClientError { + match error { + dialoguer::Error::IO(error) => RemoteClientError::IoError(error), + } +} + fn authenticate_with_retry( runtime: Handle, remote_session_url: &str, @@ -136,7 +142,7 @@ fn authenticate_with_retry( None => Password::new() .with_prompt("Enter authentication token") .interact() - .map_err(|e| RemoteClientError::IoError(e))?, + .map_err(dialoguer_error_to_client_error)?, }; let ca_cert_owned = ca_cert.map(|p| p.to_path_buf()); @@ -182,7 +188,7 @@ fn authenticate_with_retry( return Err(RemoteClientError::InvalidAuthToken); }, Err(e) => { - return Err(RemoteClientError::IoError(e)); + return Err(dialoguer_error_to_client_error(e)); }, } }, diff --git a/zellij-integration-tests/src/client_screen.rs b/zellij-integration-tests/src/client_screen.rs index 7bdbc9be..81ce1623 100644 --- a/zellij-integration-tests/src/client_screen.rs +++ b/zellij-integration-tests/src/client_screen.rs @@ -276,9 +276,7 @@ impl std::fmt::Display for GridSnapshot { fn render_bytes(bytes: &[u8], win_size: Size) -> GridSnapshot { let mut terminal_pane = build_terminal_pane(win_size); let mut vte_parser = vte::Parser::new(); - for &byte in bytes { - vte_parser.advance(&mut terminal_pane.grid, byte); - } + vte_parser.advance(&mut terminal_pane.grid, bytes); let cursor = terminal_pane .cursor_coordinates() diff --git a/zellij-server/Cargo.toml b/zellij-server/Cargo.toml index 859b7433..3b23631a 100644 --- a/zellij-server/Cargo.toml +++ b/zellij-server/Cargo.toml @@ -13,12 +13,12 @@ ansi_term = { workspace = true } anyhow = { workspace = true } arrayvec = { version = "0.7.2", default-features = false, features = ["std"] } async-trait = { version = "0.1.50", default-features = false } -base64 = { version = "0.13.0", default-features = false, features = ["std"] } +base64 = { version = "0.22", default-features = false, features = ["std"] } byteorder = { version = "1.4.3", default-features = false, features = ["std"] } bytes = { version = "1.6.0", default-features = false, features = ["std"] } -chrono = { version = "0.4.19", default-features = false, features = ["std", "clock"] } +chrono = { workspace = true } crossbeam = { version = "0.8", default-features = false, features = ["crossbeam-channel", "std"] } -highway = { version = "0.6.4", default-features = false, features = ["std"] } +highway = { version = "=1.2.0", default-features = false, features = ["std"] } interprocess = { workspace = true } isahc = { workspace = true } kasuari = { version = "0.4.12", default-features = false } @@ -55,7 +55,7 @@ features = ["std"] close_fds = "0.3.2" daemonize = { workspace = true } libc = { workspace = true } -nix = { workspace = true } +nix = { workspace = true, features = ["fs", "process", "signal", "term"] } signal-hook = { workspace = true } [target.'cfg(windows)'.dependencies] diff --git a/zellij-server/src/os_input_output_unix.rs b/zellij-server/src/os_input_output_unix.rs index 1ce8033b..bfebd7b5 100644 --- a/zellij-server/src/os_input_output_unix.rs +++ b/zellij-server/src/os_input_output_unix.rs @@ -20,7 +20,7 @@ use std::{ collections::BTreeMap, fs::File, io, - os::fd::FromRawFd, + os::fd::{BorrowedFd, FromRawFd, IntoRawFd}, os::unix::{ io::{AsRawFd, RawFd}, process::CommandExt, @@ -53,11 +53,13 @@ struct RawFdAsyncReader { impl RawFdAsyncReader { fn new(fd: RawFd) -> io::Result<Self> { // Set O_NONBLOCK so AsyncFd can use epoll correctly - let flags = - fcntl(fd, FcntlArg::F_GETFL).map_err(|e| io::Error::from_raw_os_error(e as i32))?; + let borrowed_fd = unsafe { BorrowedFd::borrow_raw(fd) }; + let flags = fcntl(borrowed_fd, FcntlArg::F_GETFL) + .map_err(|e| io::Error::from_raw_os_error(e as i32))?; let mut oflags = OFlag::from_bits_truncate(flags); oflags.insert(OFlag::O_NONBLOCK); - fcntl(fd, FcntlArg::F_SETFL(oflags)).map_err(|e| io::Error::from_raw_os_error(e as i32))?; + fcntl(borrowed_fd, FcntlArg::F_SETFL(oflags)) + .map_err(|e| io::Error::from_raw_os_error(e as i32))?; let file = unsafe { File::from_raw_fd(fd) }; Ok(Self { @@ -195,8 +197,8 @@ fn handle_openpty( }; // primary side of pty and child fd - let pid_primary = open_pty_res.master; - let pid_secondary = open_pty_res.slave; + let pid_primary = open_pty_res.master.into_raw_fd(); + let pid_secondary = open_pty_res.slave.into_raw_fd(); if !command_exists(&cmd) { return Err(ZellijError::CommandNotFound { @@ -291,7 +293,7 @@ pub(crate) struct UnixPtyBackend { fn try_write_to_fd(fd: RawFd, buf: &[u8]) -> Result<usize> { let mut written = 0; while written < buf.len() { - match unistd::write(fd, &buf[written..]) { + match unistd::write(unsafe { BorrowedFd::borrow_raw(fd) }, &buf[written..]) { Ok(0) => break, // fd returned 0 on non-empty buf; treat like EAGAIN Ok(n) => written += n, Err(nix::errno::Errno::EINTR) => continue, @@ -304,7 +306,7 @@ fn try_write_to_fd(fd: RawFd, buf: &[u8]) -> Result<usize> { impl UnixPtyBackend { pub fn new() -> Result<Self, io::Error> { - let current_termios = termios::tcgetattr(0).ok(); + let current_termios = termios::tcgetattr(io::stdin()).ok(); if current_termios.is_none() { log::warn!("Starting a server without a controlling terminal, using the default termios configuration."); } @@ -409,14 +411,18 @@ impl UnixPtyBackend { .with_context(err_context)? .get(&terminal_id) { - Some(Some(fd)) => termios::tcdrain(*fd).with_context(err_context), + Some(Some(fd)) => { + termios::tcdrain(unsafe { BorrowedFd::borrow_raw(*fd) }).with_context(err_context) + }, _ => Err(anyhow!("could not find raw file descriptor")).with_context(err_context), } } pub fn tcgetpgrp(&self, terminal_id: u32) -> Option<i32> { match self.terminal_id_to_raw_fd.lock().ok()?.get(&terminal_id) { - Some(Some(fd)) => unistd::tcgetpgrp(*fd).ok().map(|pgid| pgid.as_raw()), + Some(Some(fd)) => unistd::tcgetpgrp(unsafe { BorrowedFd::borrow_raw(*fd) }) + .ok() + .map(|pgid| pgid.as_raw()), _ => None, } } @@ -475,22 +481,27 @@ mod tests { #[test] fn try_write_to_fd_returns_partial_on_full_buffer() { let pty = openpty(None, &None).expect("openpty failed"); + let master_fd = pty.master.into_raw_fd(); + let slave_fd = pty.slave.into_raw_fd(); + let borrowed_master = unsafe { BorrowedFd::borrow_raw(master_fd) }; + let borrowed_slave = unsafe { BorrowedFd::borrow_raw(slave_fd) }; - let mut attrs = termios::tcgetattr(pty.slave).expect("tcgetattr failed"); + let mut attrs = termios::tcgetattr(borrowed_slave).expect("tcgetattr failed"); termios::cfmakeraw(&mut attrs); - termios::tcsetattr(pty.slave, termios::SetArg::TCSANOW, &attrs).expect("tcsetattr failed"); + termios::tcsetattr(borrowed_slave, termios::SetArg::TCSANOW, &attrs) + .expect("tcsetattr failed"); // O_NONBLOCK so write() returns EAGAIN instead of blocking - let flags = fcntl(pty.master, FcntlArg::F_GETFL).expect("F_GETFL"); + let flags = fcntl(borrowed_master, FcntlArg::F_GETFL).expect("F_GETFL"); let mut oflags = OFlag::from_bits_truncate(flags); oflags.insert(OFlag::O_NONBLOCK); - fcntl(pty.master, FcntlArg::F_SETFL(oflags)).expect("F_SETFL"); + fcntl(borrowed_master, FcntlArg::F_SETFL(oflags)).expect("F_SETFL"); // Fill most of the buffer, leaving some space let chunk = vec![0x42u8; 1024]; let mut total_filled = 0; loop { - match super::try_write_to_fd(pty.master, &chunk) { + match super::try_write_to_fd(master_fd, &chunk) { Ok(0) => break, Ok(n) => total_filled += n, Err(e) => panic!("unexpected error filling buffer: {e}"), @@ -503,7 +514,7 @@ mod tests { // Read a small amount from the slave to free partial space let mut drain = vec![0u8; 512]; - let slave_file = unsafe { std::fs::File::from_raw_fd(pty.slave) }; + let slave_file = unsafe { std::fs::File::from_raw_fd(slave_fd) }; let mut slave_reader = std::io::BufReader::new(&slave_file); let drained = slave_reader.read(&mut drain).expect("slave read failed"); assert!(drained > 0, "should have drained some bytes"); @@ -513,7 +524,7 @@ mod tests { // Now write more than the freed space — should get a partial write let size = 128 * 1024; let data: Vec<u8> = (0..size).map(|i| (i % 256) as u8).collect(); - let written = super::try_write_to_fd(pty.master, &data) + let written = super::try_write_to_fd(master_fd, &data) .expect("try_write_to_fd should not error on EAGAIN"); assert!( @@ -522,8 +533,8 @@ mod tests { ); unsafe { - libc::close(pty.master); - libc::close(pty.slave); + libc::close(master_fd); + libc::close(slave_fd); } } @@ -532,20 +543,25 @@ mod tests { #[test] fn try_write_to_fd_returns_zero_on_stuck_pty() { let pty = openpty(None, &None).expect("openpty failed"); + let master_fd = pty.master.into_raw_fd(); + let slave_fd = pty.slave.into_raw_fd(); + let borrowed_master = unsafe { BorrowedFd::borrow_raw(master_fd) }; + let borrowed_slave = unsafe { BorrowedFd::borrow_raw(slave_fd) }; - let mut attrs = termios::tcgetattr(pty.slave).expect("tcgetattr failed"); + let mut attrs = termios::tcgetattr(borrowed_slave).expect("tcgetattr failed"); termios::cfmakeraw(&mut attrs); - termios::tcsetattr(pty.slave, termios::SetArg::TCSANOW, &attrs).expect("tcsetattr failed"); + termios::tcsetattr(borrowed_slave, termios::SetArg::TCSANOW, &attrs) + .expect("tcsetattr failed"); - let flags = fcntl(pty.master, FcntlArg::F_GETFL).expect("F_GETFL"); + let flags = fcntl(borrowed_master, FcntlArg::F_GETFL).expect("F_GETFL"); let mut oflags = OFlag::from_bits_truncate(flags); oflags.insert(OFlag::O_NONBLOCK); - fcntl(pty.master, FcntlArg::F_SETFL(oflags)).expect("F_SETFL"); + fcntl(borrowed_master, FcntlArg::F_SETFL(oflags)).expect("F_SETFL"); // Fill the buffer completely — keep writing until we get Ok(0) let fill = vec![0x42u8; 1024]; loop { - match super::try_write_to_fd(pty.master, &fill) { + match super::try_write_to_fd(master_fd, &fill) { Ok(0) => break, Ok(_) => continue, Err(e) => panic!("unexpected error filling buffer: {e}"), @@ -553,14 +569,14 @@ mod tests { } // Now the buffer is full — next write should return Ok(0) - let written = super::try_write_to_fd(pty.master, &[0x01, 0x02, 0x03]) + let written = super::try_write_to_fd(master_fd, &[0x01, 0x02, 0x03]) .expect("try_write_to_fd should not error on EAGAIN"); assert_eq!(written, 0, "expected zero bytes written on full buffer"); unsafe { - libc::close(pty.master); - libc::close(pty.slave); + libc::close(master_fd); + libc::close(slave_fd); } } } diff --git a/zellij-server/src/panes/grid.rs b/zellij-server/src/panes/grid.rs index 7ccd7599..30402973 100644 --- a/zellij-server/src/panes/grid.rs +++ b/zellij-server/src/panes/grid.rs @@ -1,4 +1,7 @@ use super::sixel::{PixelRect, SixelGrid, SixelImageStore}; +use base64::alphabet::STANDARD as BASE64_STANDARD_ALPHABET; +use base64::engine::general_purpose::{GeneralPurpose, GeneralPurposeConfig}; +use base64::engine::{DecodePaddingMode, Engine as _}; use std::borrow::Cow; use std::cell::RefCell; use std::collections::BTreeMap; @@ -30,6 +33,11 @@ use zellij_utils::{ const TABSTOP_WIDTH: usize = 8; // TODO: is this always right? pub const MAX_TITLE_STACK_SIZE: usize = 1000; +const BASE64_DECODER: GeneralPurpose = GeneralPurpose::new( + &BASE64_STANDARD_ALPHABET, + GeneralPurposeConfig::new().with_decode_padding_mode(DecodePaddingMode::Indifferent), +); + /// Rewrites OSC 99 metadata for multiplexer forwarding: /// /// 1. Namespaces the `i=` value with a pane ID prefix and flags so responses @@ -3740,7 +3748,7 @@ impl Perform for Grid { // TBD: paste from own clipboard - currently unsupported }, base64 => { - if let Ok(bytes) = base64::decode(base64) { + if let Ok(bytes) = BASE64_DECODER.decode(base64) { if let Ok(string) = String::from_utf8(bytes) { self.pending_clipboard_update = Some(string); } @@ -4544,6 +4552,10 @@ impl Perform for Grid { }, } } + + fn terminated(&self) -> bool { + !self.pending_forwarded_queries.is_empty() + } } #[derive(Clone)] diff --git a/zellij-server/src/panes/plugin_pane.rs b/zellij-server/src/panes/plugin_pane.rs index 8eec16fc..e1adc89a 100644 --- a/zellij-server/src/panes/plugin_pane.rs +++ b/zellij-server/src/panes/plugin_pane.rs @@ -246,9 +246,7 @@ impl Pane for PluginPane { .entry(client_id) .or_insert_with(|| vte::Parser::new()); - for &byte in &vte_bytes { - vte_parser.advance(grid, byte); - } + vte_parser.advance(grid, &vte_bytes); self.should_render.insert(client_id, true); } diff --git a/zellij-server/src/panes/terminal_pane.rs b/zellij-server/src/panes/terminal_pane.rs index cdf269dd..22d8431a 100644 --- a/zellij-server/src/panes/terminal_pane.rs +++ b/zellij-server/src/panes/terminal_pane.rs @@ -229,16 +229,11 @@ impl Pane for TerminalPane { self.pending_pty_input.extend(bytes); return; } - let mut iter = bytes.into_iter(); - while let Some(byte) = iter.next() { - self.vte_parser.advance(&mut self.grid, byte); - if !self.grid.pending_forwarded_queries.is_empty() { - // Grid produced a forward. Stop feeding; queue the - // un-fed remainder so Tab can replay it after the - // reply. - self.pending_pty_input.extend(iter); - break; - } + let consumed = self + .vte_parser + .advance_until_terminated(&mut self.grid, &bytes); + if consumed < bytes.len() { + self.pending_pty_input.extend(&bytes[consumed..]); } } fn cursor_coordinates(&self, client_id: Option<ClientId>) -> Option<(usize, usize, bool)> { diff --git a/zellij-server/src/panes/unit/grid_tests.rs b/zellij-server/src/panes/unit/grid_tests.rs index 2029a4b4..ce78f706 100644 --- a/zellij-server/src/panes/unit/grid_tests.rs +++ b/zellij-server/src/panes/unit/grid_tests.rs @@ -51,9 +51,7 @@ fn vttest1_0() { ); let fixture_name = "vttest1-0"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -84,9 +82,7 @@ fn vttest1_1() { ); let fixture_name = "vttest1-1"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -117,9 +113,7 @@ fn vttest1_2() { ); let fixture_name = "vttest1-2"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -150,9 +144,7 @@ fn vttest1_3() { ); let fixture_name = "vttest1-3"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -183,9 +175,7 @@ fn vttest1_4() { ); let fixture_name = "vttest1-4"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -216,9 +206,7 @@ fn vttest1_5() { ); let fixture_name = "vttest1-5"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -249,9 +237,7 @@ fn vttest2_0() { ); let fixture_name = "vttest2-0"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -282,9 +268,7 @@ fn vttest2_1() { ); let fixture_name = "vttest2-1"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -315,9 +299,7 @@ fn vttest2_2() { ); let fixture_name = "vttest2-2"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -348,9 +330,7 @@ fn vttest2_3() { ); let fixture_name = "vttest2-3"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -381,9 +361,7 @@ fn vttest2_4() { ); let fixture_name = "vttest2-4"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -414,9 +392,7 @@ fn vttest2_5() { ); let fixture_name = "vttest2-5"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -447,9 +423,7 @@ fn vttest2_6() { ); let fixture_name = "vttest2-6"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -480,9 +454,7 @@ fn vttest2_7() { ); let fixture_name = "vttest2-7"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -513,9 +485,7 @@ fn vttest2_8() { ); let fixture_name = "vttest2-8"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -546,9 +516,7 @@ fn vttest2_9() { ); let fixture_name = "vttest2-9"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -579,9 +547,7 @@ fn vttest2_10() { ); let fixture_name = "vttest2-10"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -612,9 +578,7 @@ fn vttest2_11() { ); let fixture_name = "vttest2-11"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -645,9 +609,7 @@ fn vttest2_12() { ); let fixture_name = "vttest2-12"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -678,9 +640,7 @@ fn vttest2_13() { ); let fixture_name = "vttest2-13"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -711,9 +671,7 @@ fn vttest2_14() { ); let fixture_name = "vttest2-14"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -744,9 +702,7 @@ fn vttest3_0() { ); let fixture_name = "vttest3-0"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -777,9 +733,7 @@ fn vttest8_0() { ); let fixture_name = "vttest8-0"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -810,9 +764,7 @@ fn vttest8_1() { ); let fixture_name = "vttest8-1"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -843,9 +795,7 @@ fn vttest8_2() { ); let fixture_name = "vttest8-2"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -876,9 +826,7 @@ fn vttest8_3() { ); let fixture_name = "vttest8-3"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -909,9 +857,7 @@ fn vttest8_4() { ); let fixture_name = "vttest8-4"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -942,9 +888,7 @@ fn vttest8_5() { ); let fixture_name = "vttest8-5"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -975,9 +919,7 @@ fn csi_b() { ); let fixture_name = "csi-b"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1008,9 +950,7 @@ fn csi_capital_i() { ); let fixture_name = "csi-capital-i"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1041,9 +981,7 @@ fn csi_capital_z() { ); let fixture_name = "csi-capital-z"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1074,9 +1012,7 @@ fn terminal_reports() { ); let fixture_name = "terminal_reports"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid.pending_messages_to_pty)); } @@ -1107,9 +1043,7 @@ fn wide_characters() { ); let fixture_name = "wide_characters"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1140,9 +1074,7 @@ fn wide_characters_line_wrap() { ); let fixture_name = "wide_characters_line_wrap"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1173,9 +1105,7 @@ fn insert_character_in_line_with_wide_character() { ); let fixture_name = "wide_characters_middle_line_insert"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1206,9 +1136,7 @@ fn delete_char_in_middle_of_line_with_widechar() { ); let fixture_name = "wide-chars-delete-middle"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1239,9 +1167,7 @@ fn delete_char_in_middle_of_line_with_multiple_widechars() { ); let fixture_name = "wide-chars-delete-middle-after-multi"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1272,9 +1198,7 @@ fn fish_wide_characters_override_clock() { ); let fixture_name = "fish_wide_characters_override_clock"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1305,9 +1229,7 @@ fn bash_delete_wide_characters() { ); let fixture_name = "bash_delete_wide_characters"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1338,9 +1260,7 @@ fn delete_wide_characters_before_cursor() { ); let fixture_name = "delete_wide_characters_before_cursor"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1371,9 +1291,7 @@ fn delete_wide_characters_before_cursor_when_cursor_is_on_wide_character() { ); let fixture_name = "delete_wide_characters_before_cursor_when_cursor_is_on_wide_character"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1404,9 +1322,7 @@ fn delete_wide_character_under_cursor() { ); let fixture_name = "delete_wide_character_under_cursor"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1437,9 +1353,7 @@ fn replace_wide_character_under_cursor() { ); let fixture_name = "replace_wide_character_under_cursor"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1470,9 +1384,7 @@ fn wrap_wide_characters() { ); let fixture_name = "wide_characters_full"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1503,9 +1415,7 @@ fn wrap_wide_characters_on_size_change() { ); let fixture_name = "wide_characters_full"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); grid.change_size(21, 90); assert_snapshot!(format!("{:?}", grid)); } @@ -1537,9 +1447,7 @@ fn unwrap_wide_characters_on_size_change() { ); let fixture_name = "wide_characters_full"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); grid.change_size(21, 90); grid.change_size(21, 93); assert_snapshot!(format!("{:?}", grid)); @@ -1572,9 +1480,7 @@ fn wrap_wide_characters_in_the_middle_of_the_line() { ); let fixture_name = "wide_characters_line_middle"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1605,9 +1511,7 @@ fn wrap_wide_characters_at_the_end_of_the_line() { ); let fixture_name = "wide_characters_line_end"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1638,9 +1542,7 @@ fn copy_selected_text_from_viewport() { ); let fixture_name = "grid_copy"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); grid.start_selection(&Position::new(23, 6)); // check for widechar, 📦 occupies columns 34, 35, and gets selected even if only the first column is selected @@ -1679,9 +1581,7 @@ fn copy_wrapped_selected_text_from_viewport() { ); let fixture_name = "grid_copy_wrapped"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); grid.start_selection(&Position::new(5, 0)); grid.end_selection(&Position::new(8, 42)); @@ -1719,9 +1619,7 @@ fn copy_selected_text_from_lines_above() { ); let fixture_name = "grid_copy"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); grid.start_selection(&Position::new(-2, 10)); // check for widechar, 📦 occupies columns 34, 35, and gets selected even if only the first column is selected @@ -1760,9 +1658,7 @@ fn copy_selected_text_from_lines_below() { ); let fixture_name = "grid_copy"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); grid.move_viewport_up(40); @@ -1809,9 +1705,7 @@ fn run_bandwhich_from_fish_shell() { ); let fixture_name = "fish_and_bandwhich"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1842,9 +1736,7 @@ fn fish_tab_completion_options() { ); let fixture_name = "fish_tab_completion_options"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1881,9 +1773,7 @@ pub fn fish_select_tab_completion_options() { ); let fixture_name = "fish_select_tab_completion_options"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1924,9 +1814,7 @@ pub fn vim_scroll_region_down() { ); let fixture_name = "vim_scroll_region_down"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -1964,9 +1852,7 @@ pub fn vim_ctrl_d() { ); let fixture_name = "vim_ctrl_d"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -2003,9 +1889,7 @@ pub fn vim_ctrl_u() { ); let fixture_name = "vim_ctrl_u"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -2036,9 +1920,7 @@ pub fn htop() { ); let fixture_name = "htop"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -2069,9 +1951,7 @@ pub fn htop_scrolling() { ); let fixture_name = "htop_scrolling"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -2102,9 +1982,7 @@ pub fn htop_right_scrolling() { ); let fixture_name = "htop_right_scrolling"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -2145,9 +2023,7 @@ pub fn vim_overwrite() { ); let fixture_name = "vim_overwrite"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -2180,9 +2056,7 @@ pub fn clear_scroll_region() { ); let fixture_name = "clear_scroll_region"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -2213,9 +2087,7 @@ pub fn display_tab_characters_properly() { ); let fixture_name = "tab_characters"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -2246,9 +2118,7 @@ pub fn neovim_insert_mode() { ); let fixture_name = "nvim_insert"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -2279,9 +2149,7 @@ pub fn bash_cursor_linewrap() { ); let fixture_name = "bash_cursor_linewrap"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -2314,9 +2182,7 @@ pub fn fish_paste_multiline() { ); let fixture_name = "fish_paste_multiline"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -2347,9 +2213,7 @@ pub fn git_log() { ); let fixture_name = "git_log"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -2382,9 +2246,7 @@ pub fn git_diff_scrollup() { ); let fixture_name = "git_diff_scrollup"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -2415,9 +2277,7 @@ pub fn emacs_longbuf() { ); let fixture_name = "emacs_longbuf_tutorial"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -2448,9 +2308,7 @@ pub fn top_and_quit() { ); let fixture_name = "top_and_quit"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -2488,9 +2346,7 @@ pub fn exa_plus_omf_theme() { ); let fixture_name = "exa_plus_omf_theme"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -2521,9 +2377,7 @@ pub fn scroll_up() { ); let fixture_name = "scrolling"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); grid.scroll_up_one_line(); assert_snapshot!(format!("{:?}", grid)); } @@ -2555,9 +2409,7 @@ pub fn scroll_down() { ); let fixture_name = "scrolling"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); grid.scroll_up_one_line(); grid.scroll_down_one_line(); assert_snapshot!(format!("{:?}", grid)); @@ -2590,9 +2442,7 @@ pub fn scroll_up_with_line_wraps() { ); let fixture_name = "scrolling"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); grid.scroll_up_one_line(); assert_snapshot!(format!("{:?}", grid)); } @@ -2624,9 +2474,7 @@ pub fn scroll_down_with_line_wraps() { ); let fixture_name = "scrolling"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); grid.scroll_up_one_line(); grid.scroll_down_one_line(); assert_snapshot!(format!("{:?}", grid)); @@ -2659,9 +2507,7 @@ pub fn scroll_up_decrease_width_and_scroll_down() { ); let fixture_name = "scrolling"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); for _ in 0..10 { grid.scroll_up_one_line(); } @@ -2699,9 +2545,7 @@ pub fn scroll_up_increase_width_and_scroll_down() { ); let fixture_name = "scrolling"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); for _ in 0..10 { grid.scroll_up_one_line(); } @@ -2738,9 +2582,7 @@ fn saved_cursor_across_resize() { explicitly_disable_kitty_keyboard_protocol, ); let mut parse = |s, grid: &mut Grid| { - for b in Vec::from(s) { - vte_parser.advance(&mut *grid, b) - } + vte_parser.advance(&mut *grid, &Vec::from(s)); }; let content = " \rLine 1 >fill to 20_< @@ -2787,9 +2629,7 @@ fn saved_cursor_across_resize_longline() { explicitly_disable_kitty_keyboard_protocol, ); let mut parse = |s, grid: &mut Grid| { - for b in Vec::from(s) { - vte_parser.advance(&mut *grid, b) - } + vte_parser.advance(&mut *grid, &Vec::from(s)); }; let content = " \rLine 1 >fill \u{1b}[sto 20_<"; @@ -2829,9 +2669,7 @@ fn saved_cursor_across_resize_rewrap() { explicitly_disable_kitty_keyboard_protocol, ); let mut parse = |s, grid: &mut Grid| { - for b in Vec::from(s) { - vte_parser.advance(&mut *grid, b) - } + vte_parser.advance(&mut *grid, &Vec::from(s)); }; let content = " \r12345678123456781234567\u{1b}[s812345678"; // 4*8 chars @@ -2872,9 +2710,7 @@ pub fn move_cursor_below_scroll_region() { ); let fixture_name = "move_cursor_below_scroll_region"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -2905,9 +2741,7 @@ pub fn insert_wide_characters_in_existing_line() { ); let fixture_name = "chinese_characters_line_middle"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -2944,9 +2778,7 @@ pub fn full_screen_scroll_region_and_scroll_up() { ); let fixture_name = "scroll_region_full_screen"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); grid.scroll_up_one_line(); grid.scroll_up_one_line(); grid.scroll_up_one_line(); @@ -2980,9 +2812,7 @@ pub fn ring_bell() { ); let fixture_name = "ring_bell"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert!(grid.ring_bell); } @@ -3013,9 +2843,7 @@ pub fn alternate_screen_change_size() { ); let fixture_name = "alternate_screen_change_size"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); // no scrollback in alternate screen assert_eq!(grid.scrollback_position_and_length(), (0, 0)); grid.change_size(10, 10); @@ -3050,9 +2878,7 @@ pub fn fzf_fullscreen() { ); let fixture_name = "fzf_fullscreen"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -3087,9 +2913,7 @@ pub fn replace_multiple_wide_characters_under_cursor() { ); let fixture_name = "replace_multiple_wide_characters"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -3124,9 +2948,7 @@ pub fn replace_non_wide_characters_with_wide_characters() { ); let fixture_name = "replace_non_wide_characters_with_wide_characters"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -3157,9 +2979,7 @@ pub fn scroll_down_ansi() { ); let fixture_name = "scroll_down"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -3189,9 +3009,7 @@ pub fn ansi_capital_t() { explicitly_disable_kitty_keyboard_protocol, ); let content = "foo\u{1b}[14Tbar".as_bytes(); - for byte in content { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -3221,9 +3039,7 @@ pub fn ansi_capital_s() { explicitly_disable_kitty_keyboard_protocol, ); let content = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfoo\u{1b}[14Sbar".as_bytes(); - for byte in content { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -3257,9 +3073,7 @@ fn terminal_pixel_size_reports() { ); let fixture_name = "terminal_pixel_size_reports"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); // CSI 14t and CSI 16t are forwarded to the host; Zellij no longer // synthesises local replies from character_cell_size for these. assert!(grid.pending_messages_to_pty.is_empty()); @@ -3300,9 +3114,7 @@ fn terminal_pixel_size_reports_in_unsupported_terminals() { ); let fixture_name = "terminal_pixel_size_reports"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); // Forwarding is independent of character_cell_size availability — // the host terminal is authoritative for these queries regardless // of what Zellij knows locally. @@ -3343,9 +3155,7 @@ pub fn ansi_csi_at_sign() { explicitly_disable_kitty_keyboard_protocol, ); let content = "foo\u{1b}[2D\u{1b}[2@".as_bytes(); - for byte in content { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -3379,9 +3189,7 @@ pub fn sixel_images_are_reaped_when_scrolled_off() { explicitly_disable_kitty_keyboard_protocol, ); let pane_content = read_fixture("sixel-image-500px.six"); - for byte in pane_content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &pane_content); for _ in 0..10_051 { // scrollbuffer limit + viewport height grid.add_canonical_line(); @@ -3424,9 +3232,7 @@ pub fn sixel_images_are_reaped_when_resetting() { explicitly_disable_kitty_keyboard_protocol, ); let pane_content = read_fixture("sixel-image-500px.six"); - for byte in pane_content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &pane_content); grid.reset_terminal_state(); let _ = grid.read_changes(0, 0); // we do this because this is where the images are reaped assert_eq!( @@ -3467,20 +3273,14 @@ pub fn sixel_image_in_alternate_buffer() { ); let move_to_alternate_screen = "\u{1b}[?1049h"; - for byte in move_to_alternate_screen.as_bytes() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, move_to_alternate_screen.as_bytes()); let pane_content = read_fixture("sixel-image-500px.six"); - for byte in pane_content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &pane_content); assert_snapshot!(format!("{:?}", grid)); // should include the image // let move_away_from_alternate_screen = "\u{1b}[?1049l"; - for byte in move_away_from_alternate_screen.as_bytes() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, move_away_from_alternate_screen.as_bytes()); assert_snapshot!(format!("{:?}", grid)); // should note include the image assert_eq!( sixel_image_store.borrow().image_count(), @@ -3521,45 +3321,33 @@ pub fn sixel_with_image_scrolling_decsdm() { // enter DECSDM let move_to_decsdm = "\u{1b}[?80h"; - for byte in move_to_decsdm.as_bytes() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, move_to_decsdm.as_bytes()); // write some text let mut text_to_fill_pane = String::new(); for i in 0..10 { writeln!(&mut text_to_fill_pane, "\rline {}", i + 1).unwrap(); } - for byte in text_to_fill_pane.as_bytes() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, text_to_fill_pane.as_bytes()); // render a sixel image (will appear on the top left and partially cover the text) let pane_content = read_fixture("sixel-image-100px.six"); - for byte in pane_content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &pane_content); // image should be on the top left corner of the grid assert_snapshot!(format!("{:?}", grid)); // leave DECSDM let move_away_from_decsdm = "\u{1b}[?80l"; - for byte in move_away_from_decsdm.as_bytes() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, move_away_from_decsdm.as_bytes()); // Go down to the beginning of the next line let mut go_down_once = String::new(); writeln!(&mut go_down_once, "\n\r").unwrap(); - for byte in go_down_once.as_bytes() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, go_down_once.as_bytes()); // render another sixel image, should appear under the cursor let pane_content = read_fixture("sixel-image-100px.six"); - for byte in pane_content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &pane_content); // image should appear in cursor position assert_snapshot!(format!("{:?}", grid)); @@ -3591,9 +3379,7 @@ pub fn osc_4_background_query() { explicitly_disable_kitty_keyboard_protocol, ); let content = "\u{1b}]10;?\u{1b}\\"; - for byte in content.as_bytes() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, content.as_bytes()); // Post-refactor: OSC 10;? is forwarded to the host, not answered // from Zellij's cached palette. pending_messages_to_pty must stay // empty. @@ -3632,9 +3418,7 @@ pub fn osc_4_foreground_query() { explicitly_disable_kitty_keyboard_protocol, ); let content = "\u{1b}]11;?\u{1b}\\"; - for byte in content.as_bytes() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, content.as_bytes()); assert!(grid.pending_messages_to_pty.is_empty()); let forwarded_string: String = grid .pending_forwarded_queries @@ -3672,9 +3456,7 @@ pub fn osc_4_color_query() { explicitly_disable_kitty_keyboard_protocol, ); let content = "\u{1b}]4;222;?\u{1b}\\"; - for byte in content.as_bytes() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, content.as_bytes()); // OSC 4;N;? is forwarded to the host for the real palette value. assert!(grid.pending_messages_to_pty.is_empty()); let forwarded_string: String = grid @@ -3711,9 +3493,7 @@ pub fn xtsmgraphics_color_register_count() { explicitly_disable_kitty_keyboard_protocol, ); let content = "\u{1b}[?1;1;S\u{1b}\\"; - for byte in content.as_bytes() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, content.as_bytes()); let message_string = grid .pending_messages_to_pty .iter() @@ -3755,9 +3535,7 @@ pub fn xtsmgraphics_pixel_graphics_geometry() { explicitly_disable_kitty_keyboard_protocol, ); let content = "\u{1b}[?2;1;S\u{1b}\\"; - for byte in content.as_bytes() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, content.as_bytes()); let message_string = grid .pending_messages_to_pty .iter() @@ -3800,36 +3578,28 @@ pub fn cursor_hide_persists_through_alternate_screen() { ); let hide_cursor = "\u{1b}[?25l"; - for byte in hide_cursor.as_bytes() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, hide_cursor.as_bytes()); assert!( matches!(grid.cursor_coordinates(), Some((_, _, false))), "Cursor hidden properly" ); let move_to_alternate_screen = "\u{1b}[?1049h"; - for byte in move_to_alternate_screen.as_bytes() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, move_to_alternate_screen.as_bytes()); assert!( matches!(grid.cursor_coordinates(), Some((_, _, false))), "Cursor still hidden in alternate screen" ); let show_cursor = "\u{1b}[?25h"; - for byte in show_cursor.as_bytes() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, show_cursor.as_bytes()); assert!( matches!(grid.cursor_coordinates(), Some((_, _, true))), "Cursor shown" ); let move_away_from_alternate_screen = "\u{1b}[?1049l"; - for byte in move_away_from_alternate_screen.as_bytes() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, move_away_from_alternate_screen.as_bytes()); assert!( matches!(grid.cursor_coordinates(), Some((_, _, true))), "Cursor still shown away from alternate screen" @@ -3863,9 +3633,7 @@ fn table_ui_component() { ); let fixture_name = "table-ui-component"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -3896,9 +3664,7 @@ fn table_ui_component_with_coordinates() { ); let fixture_name = "table-ui-component-with-coordinates"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -3929,9 +3695,7 @@ fn ribbon_ui_component() { ); let fixture_name = "ribbon-ui-component"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -3962,9 +3726,7 @@ fn ribbon_ui_component_with_coordinates() { ); let fixture_name = "ribbon-ui-component-with-coordinates"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -3995,9 +3757,7 @@ fn nested_list_ui_component() { ); let fixture_name = "nested-list-ui-component"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -4028,9 +3788,7 @@ fn nested_list_ui_component_with_coordinates() { ); let fixture_name = "nested-list-ui-component-with-coordinates"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -4061,9 +3819,7 @@ fn text_ui_component() { ); let fixture_name = "text-ui-component"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -4094,9 +3850,7 @@ fn text_ui_component_with_coordinates() { ); let fixture_name = "text-ui-component-with-coordinates"; let content = read_fixture(fixture_name); - for byte in content { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -4134,9 +3888,7 @@ fn cannot_escape_scroll_region() { explicitly_disable_kitty_keyboard_protocol, ); let content = "\u{1b}[1;42r\u{1b}[42;1HHi there!".as_bytes(); - for byte in content { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, &content); assert_snapshot!(format!("{:?}", grid)); } @@ -4169,9 +3921,7 @@ fn preserve_background_color_on_resize() { ); let mut parse = |s, grid: &mut Grid| { - for b in Vec::from(s) { - vte_parser.advance(&mut *grid, b) - } + vte_parser.advance(&mut *grid, &Vec::from(s)); }; // Write text with red background that extends to end of line @@ -4250,9 +4000,7 @@ fn create_grid_with_content(content: &str) -> Grid { true, false, ); - for byte in content.as_bytes() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, content.as_bytes()); grid } @@ -4426,9 +4174,7 @@ fn osc_11_set_and_query_pane_default_bg() { // Set background via OSC 11 let set_bg = b"\x1b]11;#001a3a\x07"; - for byte in set_bg.iter() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, set_bg); assert_eq!(grid.pane_default_bg, Some((0, 26, 58))); @@ -4439,9 +4185,7 @@ fn osc_11_set_and_query_pane_default_bg() { // `rgb:RRRR/GGGG/BBBB` form with each 8-bit channel widened by // repetition (0x00 → 0x0000, 0x1a → 0x1a1a, 0x3a → 0x3a3a). let query_bg = b"\x1b]11;?\x07"; - for byte in query_bg.iter() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, query_bg); assert!( grid.pending_forwarded_queries.is_empty(), @@ -4477,9 +4221,7 @@ fn osc_10_set_and_query_pane_default_fg() { // Set foreground via OSC 10 let set_fg = b"\x1b]10;#00e000\x07"; - for byte in set_fg.iter() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, set_fg); assert_eq!(grid.pane_default_fg, Some((0, 224, 0))); @@ -4487,9 +4229,7 @@ fn osc_10_set_and_query_pane_default_fg() { // so the query is answered locally (see OSC 11 equivalent test for // the short-circuit rationale). let query_fg = b"\x1b]10;?\x07"; - for byte in query_fg.iter() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, query_fg); assert!( grid.pending_forwarded_queries.is_empty(), @@ -4525,30 +4265,22 @@ fn osc_110_111_reset_pane_default_colors() { // Set both fg and bg let set_fg = b"\x1b]10;#00e000\x07"; - for byte in set_fg.iter() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, set_fg); let set_bg = b"\x1b]11;#001a3a\x07"; - for byte in set_bg.iter() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, set_bg); assert_eq!(grid.pane_default_fg, Some((0, 224, 0))); assert_eq!(grid.pane_default_bg, Some((0, 26, 58))); // Reset foreground via OSC 110 let reset_fg = b"\x1b]110\x07"; - for byte in reset_fg.iter() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, reset_fg); assert_eq!(grid.pane_default_fg, None); assert_eq!(grid.pane_default_bg, Some((0, 26, 58))); // Reset background via OSC 111 let reset_bg = b"\x1b]111\x07"; - for byte in reset_bg.iter() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, reset_bg); assert_eq!(grid.pane_default_fg, None); assert_eq!(grid.pane_default_bg, None); } @@ -4578,9 +4310,7 @@ fn osc_11_set_bg_produces_ansi_in_render_output() { // Set background via OSC 11 let set_bg = b"\x1b]11;#001a3a\x07"; - for byte in set_bg.iter() { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, set_bg); assert_eq!(grid.pane_default_bg, Some((0, 26, 58))); @@ -4844,9 +4574,7 @@ fn plugin_highlight_at_wrapped_line() { // Feed a long string that wraps: "abcdefghij" fills row 0, "klmnopqrst" fills row 1 let content = "abcdefghijklmnopqrst"; let mut vte_parser = vte::Parser::new(); - for &byte in content.as_bytes() { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, content.as_bytes()); // Set a highlight for "jklm" which spans the wrap boundary let highlights = vec![create_highlight( @@ -5003,9 +4731,7 @@ fn create_grid_with_scrollback() -> Grid { let mut parser = vte::Parser::new(); for i in 0..25 { let line = format!("scrollback line {}\r\n", i); - for byte in line.as_bytes() { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, line.as_bytes()); } grid } @@ -5095,9 +4821,7 @@ fn create_grid_with_colored_scrollback() -> Grid { let mut parser = vte::Parser::new(); for i in 0..25 { let line = format!("\x1b[31mred line {}\x1b[0m\r\n", i); - for byte in line.as_bytes() { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, line.as_bytes()); } grid } @@ -5447,17 +5171,13 @@ fn create_grid_with_size_and_raw(rows: usize, cols: usize, content: &[u8]) -> Gr true, false, ); - for byte in content { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, &content); grid } fn feed_bytes(grid: &mut Grid, bytes: &[u8]) { let mut vte_parser = vte::Parser::new(); - for byte in bytes { - vte_parser.advance(grid, *byte); - } + vte_parser.advance(grid, bytes); } // All tests below use a 10-row, 40-col grid with scroll region 1;8 @@ -5919,9 +5639,7 @@ fn csi_14t_forwards_to_host_not_local() { // the terminal's real window pixel dimensions. let mut parser = vte::Parser::new(); let mut grid = new_grid_for_forwarding_test(); - for byte in b"\x1b[14t" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b[14t"); assert!( grid.pending_messages_to_pty.is_empty(), "local reply path must not fire for 14t" @@ -5938,9 +5656,7 @@ fn csi_14t_forwards_to_host_not_local() { fn csi_16t_forwards_to_host_not_local() { let mut parser = vte::Parser::new(); let mut grid = new_grid_for_forwarding_test(); - for byte in b"\x1b[16t" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b[16t"); assert!(grid.pending_messages_to_pty.is_empty()); assert_eq!(grid.pending_forwarded_queries.len(), 1); assert_eq!( @@ -5955,9 +5671,7 @@ fn csi_18t_still_answered_locally() { // authoritative for this, do NOT forward. let mut parser = vte::Parser::new(); let mut grid = new_grid_for_forwarding_test(); - for byte in b"\x1b[18t" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b[18t"); assert_eq!(grid.pending_messages_to_pty.len(), 1); assert!(grid.pending_forwarded_queries.is_empty()); } @@ -5968,9 +5682,7 @@ fn osc_11_set_stays_local() { // to track it for its own rendering. let mut parser = vte::Parser::new(); let mut grid = new_grid_for_forwarding_test(); - for byte in b"\x1b]11;rgb:ffff/ffff/ffff\x07" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b]11;rgb:ffff/ffff/ffff\x07"); assert!(grid.pending_messages_to_pty.is_empty()); assert!( grid.pending_forwarded_queries.is_empty(), @@ -5986,9 +5698,7 @@ fn osc_11_query_without_override_forwards_to_host() { let mut parser = vte::Parser::new(); let mut grid = new_grid_for_forwarding_test(); assert!(grid.pane_default_bg.is_none()); - for byte in b"\x1b]11;?\x07" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b]11;?\x07"); assert!( grid.pending_messages_to_pty.is_empty(), "no override → no local reply" @@ -6005,9 +5715,7 @@ fn osc_10_query_without_override_forwards_to_host() { let mut parser = vte::Parser::new(); let mut grid = new_grid_for_forwarding_test(); assert!(grid.pane_default_fg.is_none()); - for byte in b"\x1b]10;?\x07" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b]10;?\x07"); assert!(grid.pending_messages_to_pty.is_empty()); assert_eq!(grid.pending_forwarded_queries.len(), 1); assert!(matches!( @@ -6027,12 +5735,8 @@ fn set_pane_default_colors_short_circuits_osc_queries() { let mut grid = new_grid_for_forwarding_test(); grid.set_pane_default_colors(Some("#ff8040".to_string()), Some("#102030".to_string())); - for byte in b"\x1b]10;?\x07" { - parser.advance(&mut grid, *byte); - } - for byte in b"\x1b]11;?\x07" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b]10;?\x07"); + parser.advance(&mut grid, b"\x1b]11;?\x07"); assert!( grid.pending_forwarded_queries.is_empty(), @@ -6052,15 +5756,11 @@ fn osc_11_override_short_circuits_only_the_overridden_channel() { // populated, an OSC 10 query (fg) still goes to the host. let mut parser = vte::Parser::new(); let mut grid = new_grid_for_forwarding_test(); - for byte in b"\x1b]11;rgb:1010/2020/3030\x07" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b]11;rgb:1010/2020/3030\x07"); assert!(grid.pane_default_bg.is_some()); assert!(grid.pane_default_fg.is_none()); - for byte in b"\x1b]10;?\x07" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b]10;?\x07"); assert!( grid.pending_messages_to_pty.is_empty(), "fg has no override → must forward" @@ -6076,9 +5776,7 @@ fn csi_2026_dollar_p_stays_local() { // own frames, so individual panes are treated as "not enabled"). let mut parser = vte::Parser::new(); let mut grid = new_grid_for_forwarding_test(); - for byte in b"\x1b[?2026$p" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b[?2026$p"); assert!( grid.pending_forwarded_queries.is_empty(), "CSI ?2026$p is emulated locally, must not forward" @@ -6097,9 +5795,7 @@ fn csi_2031_dollar_p_when_disabled_replies_reset() { // is reset, so the DECRPM reply must report value=2. let mut parser = vte::Parser::new(); let mut grid = new_grid_for_forwarding_test(); - for byte in b"\x1b[?2031$p" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b[?2031$p"); assert!( grid.pending_forwarded_queries.is_empty(), "CSI ?2031$p is answered locally, must not forward" @@ -6117,9 +5813,7 @@ fn csi_2031_dollar_p_when_enabled_replies_set() { // pane, a DECRQM probe must report value=1 (set). let mut parser = vte::Parser::new(); let mut grid = new_grid_for_forwarding_test(); - for byte in b"\x1b[?2031h\x1b[?2031$p" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b[?2031h\x1b[?2031$p"); assert!( grid.pending_forwarded_queries.is_empty(), "CSI ?2031$p is answered locally, must not forward" @@ -6141,9 +5835,7 @@ fn csi_22t_and_23t_stay_local() { let mut grid = new_grid_for_forwarding_test(); grid.set_title("hello".to_string()); - for byte in b"\x1b[22;0t" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b[22;0t"); assert!( grid.pending_forwarded_queries.is_empty(), "22t is a stack op, not a query" @@ -6155,9 +5847,7 @@ fn csi_22t_and_23t_stay_local() { // The push actually landed on Zellij's per-pane stack: restore it. grid.set_title("different".to_string()); - for byte in b"\x1b[23;0t" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b[23;0t"); assert!( grid.pending_forwarded_queries.is_empty(), "23t is a stack op, not a query" @@ -6179,9 +5869,7 @@ fn osc_4_set_stays_local() { // the query form (`OSC 4;N;?`) ever forwards to the host. let mut parser = vte::Parser::new(); let mut grid = new_grid_for_forwarding_test(); - for byte in b"\x1b]4;5;rgb:ffff/0000/0000\x07" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b]4;5;rgb:ffff/0000/0000\x07"); assert!( grid.pending_forwarded_queries.is_empty(), "OSC 4 set must not forward" @@ -6204,16 +5892,12 @@ fn decset_2031_enables_color_palette_notification() { !grid.color_palette_notification_enabled, "default state must be disabled" ); - for byte in b"\x1b[?2031h" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b[?2031h"); assert!( grid.color_palette_notification_enabled, "DECSET 2031 must enable the flag" ); - for byte in b"\x1b[?2031l" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b[?2031l"); assert!( !grid.color_palette_notification_enabled, "DECRST 2031 must disable the flag" @@ -6256,9 +5940,7 @@ fn csi_996n_pushes_color_palette_mode_query_to_forwarded_queries() { use crate::host_query::HostQuery; let mut parser = vte::Parser::new(); let mut grid = new_grid_for_forwarding_test(); - for byte in b"\x1b[?996n" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b[?996n"); assert_eq!( grid.pending_forwarded_queries, vec![HostQuery::ColorPaletteMode], @@ -6276,9 +5958,7 @@ fn csi_5n_status_query_still_handled_locally() { let mut grid = new_grid_for_forwarding_test(); // Plain DSR 5 (no `?` intermediate) is not the new theme query and // must continue to receive its `\e[0n` "all good" reply locally. - for byte in b"\x1b[5n" { - parser.advance(&mut grid, *byte); - } + parser.advance(&mut grid, b"\x1b[5n"); assert!( grid.pending_forwarded_queries.is_empty(), "DSR 5 is not a forwarded query" @@ -6322,9 +6002,10 @@ fn nested_session_frame_is_staged_for_dispatch() { let mut vte_parser = vte::Parser::new(); let mut grid = new_grid_for_nested_frames(); let message = nested_announce_message(); - for byte in zellij_utils::nested_session::encode_frame(&message) { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance( + &mut grid, + &zellij_utils::nested_session::encode_frame(&message), + ); assert_eq!(grid.pending_nested_session_messages, vec![message]); } @@ -6335,13 +6016,9 @@ fn nested_session_frame_split_across_feeds_is_staged() { let message = nested_announce_message(); let frame = zellij_utils::nested_session::encode_frame(&message); let (first_half, second_half) = frame.split_at(frame.len() / 2); - for byte in first_half { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, first_half); assert!(grid.pending_nested_session_messages.is_empty()); - for byte in second_half { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, second_half); assert_eq!(grid.pending_nested_session_messages, vec![message]); } @@ -6349,9 +6026,7 @@ fn nested_session_frame_split_across_feeds_is_staged() { fn dcs_with_wrong_magic_param_is_not_staged() { let mut vte_parser = vte::Parser::new(); let mut grid = new_grid_for_nested_frames(); - for byte in b"\x1bP26662nAAAA\x1b\\" { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, b"\x1bP26662nAAAA\x1b\\"); assert!(grid.pending_nested_session_messages.is_empty()); } @@ -6359,9 +6034,7 @@ fn dcs_with_wrong_magic_param_is_not_staged() { fn dcs_with_intermediates_is_not_staged() { let mut vte_parser = vte::Parser::new(); let mut grid = new_grid_for_nested_frames(); - for byte in b"\x1bP26661$nAAAA\x1b\\" { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, b"\x1bP26661$nAAAA\x1b\\"); assert!(grid.pending_nested_session_messages.is_empty()); } @@ -6369,9 +6042,7 @@ fn dcs_with_intermediates_is_not_staged() { fn dcs_n_without_params_is_not_staged() { let mut vte_parser = vte::Parser::new(); let mut grid = new_grid_for_nested_frames(); - for byte in b"\x1bPnAAAA\x1b\\" { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, b"\x1bPnAAAA\x1b\\"); assert!(grid.pending_nested_session_messages.is_empty()); } @@ -6379,9 +6050,7 @@ fn dcs_n_without_params_is_not_staged() { fn nested_session_frame_with_garbage_payload_is_dropped() { let mut vte_parser = vte::Parser::new(); let mut grid = new_grid_for_nested_frames(); - for byte in b"\x1bP26661n!!!not-base64!!!\x1b\\" { - vte_parser.advance(&mut grid, *byte); - } + vte_parser.advance(&mut grid, b"\x1bP26661n!!!not-base64!!!\x1b\\"); assert!(grid.pending_nested_session_messages.is_empty()); } @@ -6397,9 +6066,7 @@ fn render_ui_component(component_name: &str, serialized_params: &str) -> Grid { let mut vte_parser = vte::Parser::new(); let mut grid = new_grid_for_nested_frames(); let dcs = format!("\u{1b}Pz{};{}\u{1b}\\", component_name, serialized_params); - for byte in dcs.bytes() { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, dcs.as_bytes()); grid } diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__save_layout_invalid_kdl_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__save_layout_invalid_kdl_plugin_command.snap index 0e02eefd..c16e36ad 100644 --- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__save_layout_invalid_kdl_plugin_command.snap +++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__save_layout_invalid_kdl_plugin_command.snap @@ -3,5 +3,5 @@ source: zellij-server/src/plugins/./unit/plugin_tests.rs expression: "format!(\"{:#?}\", plugin_bytes_event)" --- Some( - "Save invalid layout error: Invalid layout KDL: KdlError(KdlError { error_message: \"Failed to deserialize KDL node. \\nPossible reasons:\\n- Missing `;` after a node name, eg. { node; another_node; }\\n- Missing quotations (\\\") around an argument node eg. { first_node \\\"argument_node\\\"; }\\n- Missing an equal sign (=) between node arguments on a title line. eg. argument=\\\"value\\\"\\n- Found an extraneous equal sign (=) between node child arguments and their values. eg. { argument=\\\"value\\\" }\", src: Some(NamedSource { name: \"invalid_layout.kdl\", source: \"<redacted>\"), offset: Some(0), len: Some(4), help_message: None })\n\r", + "Save invalid layout error: Invalid layout KDL: KdlError(KdlError { error_message: \"Failed to deserialize KDL node. \\nPossible reasons:\\n- Missing `;` after a node name, eg. { node; another_node; }\\n- Missing quotations (\\\") around an argument node eg. { first_node \\\"argument_node\\\"; }\\n- Missing an equal sign (=) between node arguments on a title line. eg. argument=\\\"value\\\"\\n- Found an extraneous equal sign (=) between node child arguments and their values. eg. { argument=\\\"value\\\" }\", src: Some(NamedSource { name: \"invalid_layout.kdl\", source: \"<redacted>\", language: None), offset: Some(0), len: Some(4), help_message: None })\n\r", ) diff --git a/zellij-server/src/plugins/wasm_bridge.rs b/zellij-server/src/plugins/wasm_bridge.rs index 4121684b..bbf1f00c 100644 --- a/zellij-server/src/plugins/wasm_bridge.rs +++ b/zellij-server/src/plugins/wasm_bridge.rs @@ -11,7 +11,7 @@ use crate::plugins::watch_filesystem::watch_filesystem; use crate::plugins::zellij_exports::{wasi_read_string, wasi_write_object}; use highway::{HighwayHash, PortableHash}; use log::info; -use notify_debouncer_full::{notify::RecommendedWatcher, Debouncer, FileIdMap}; +use notify_debouncer_full::{notify::RecommendedWatcher, Debouncer, RecommendedCache}; use std::{ collections::{BTreeMap, HashMap, HashSet}, path::PathBuf, @@ -185,7 +185,7 @@ pub struct WasmBridge { loading_plugins: HashSet<(PluginId, RunPlugin)>, // tracks loading plugins without handles pending_plugin_reloads: HashSet<RunPlugin>, path_to_default_shell: PathBuf, - watcher: Option<Debouncer<RecommendedWatcher, FileIdMap>>, + watcher: Option<Debouncer<RecommendedWatcher, RecommendedCache>>, zellij_cwd: PathBuf, session_env_vars: std::collections::BTreeMap<String, String>, default_shell: Option<TerminalAction>, diff --git a/zellij-server/src/plugins/watch_filesystem.rs b/zellij-server/src/plugins/watch_filesystem.rs index 8cb01af2..5630c9a7 100644 --- a/zellij-server/src/plugins/watch_filesystem.rs +++ b/zellij-server/src/plugins/watch_filesystem.rs @@ -7,8 +7,8 @@ use std::time::Duration; use notify_debouncer_full::{ new_debouncer, - notify::{EventKind, RecommendedWatcher, RecursiveMode, Watcher}, - DebounceEventResult, Debouncer, FileIdMap, + notify::{EventKind, RecommendedWatcher, RecursiveMode}, + DebounceEventResult, Debouncer, RecommendedCache, }; use zellij_utils::{data::Event, errors::prelude::Result}; @@ -17,7 +17,7 @@ const DEBOUNCE_DURATION_MS: u64 = 400; pub fn watch_filesystem( senders: ThreadSenders, zellij_cwd: &Path, -) -> Result<Debouncer<RecommendedWatcher, FileIdMap>> { +) -> Result<Debouncer<RecommendedWatcher, RecommendedCache>> { let path_prefix_in_plugins = PathBuf::from("/host"); let current_dir = PathBuf::from(zellij_cwd); let mut debouncer = new_debouncer( @@ -93,34 +93,44 @@ pub fn watch_filesystem( // TODO: at some point we might want to add FileMetadata to these, but right now // the API is a bit unstable, so let's not rock the boat too much by adding another // expensive syscall - let _ = senders.send_to_plugin(PluginInstruction::Update(vec![ - ( + let mut updates = vec![]; + if !read_paths.is_empty() { + updates.push(( None, None, Event::FileSystemRead(read_paths.into_iter().map(|p| (p, None)).collect()), - ), - ( + )); + } + if !create_paths.is_empty() { + updates.push(( None, None, Event::FileSystemCreate( create_paths.into_iter().map(|p| (p, None)).collect(), ), - ), - ( + )); + } + if !update_paths.is_empty() { + updates.push(( None, None, Event::FileSystemUpdate( update_paths.into_iter().map(|p| (p, None)).collect(), ), - ), - ( + )); + } + if !delete_paths.is_empty() { + updates.push(( None, None, Event::FileSystemDelete( delete_paths.into_iter().map(|p| (p, None)).collect(), ), - ), - ])); + )); + } + if !updates.is_empty() { + let _ = senders.send_to_plugin(PluginInstruction::Update(updates)); + } }, Err(errors) => errors .iter() @@ -128,8 +138,6 @@ pub fn watch_filesystem( }, )?; - debouncer - .watcher() - .watch(zellij_cwd, RecursiveMode::Recursive)?; + debouncer.watch(zellij_cwd, RecursiveMode::Recursive)?; Ok(debouncer) } diff --git a/zellij-server/src/tab/clipboard.rs b/zellij-server/src/tab/clipboard.rs index d954b1c7..7820388e 100644 --- a/zellij-server/src/tab/clipboard.rs +++ b/zellij-server/src/tab/clipboard.rs @@ -1,4 +1,6 @@ use anyhow::Result; +use base64::engine::general_purpose::STANDARD as BASE64_STANDARD; +use base64::engine::Engine as _; use zellij_utils::{data::CopyDestination, input::options::Clipboard}; use crate::ClientId; @@ -31,7 +33,11 @@ impl ClipboardProvider { }; output.add_pre_vte_instruction_to_multiple_clients( client_ids, - &format!("\u{1b}]52;{};{}\u{1b}\\", dest, base64::encode(content)), + &format!( + "\u{1b}]52;{};{}\u{1b}\\", + dest, + BASE64_STANDARD.encode(content) + ), ); }, }; diff --git a/zellij-server/src/tab/unit/tab_integration_tests.rs b/zellij-server/src/tab/unit/tab_integration_tests.rs index 3e778b16..9fcb36f5 100644 --- a/zellij-server/src/tab/unit/tab_integration_tests.rs +++ b/zellij-server/src/tab/unit/tab_integration_tests.rs @@ -1044,9 +1044,7 @@ fn take_snapshot(ansi_instructions: &str, rows: usize, columns: usize, palette: explicitly_disable_kitty_keyboard_protocol, ); let mut vte_parser = vte::Parser::new(); - for &byte in ansi_instructions.as_bytes() { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, ansi_instructions.as_bytes()); format!("{:?}", grid) } @@ -1083,9 +1081,7 @@ fn take_snapshot_with_sixel( explicitly_disable_kitty_keyboard_protocol, ); let mut vte_parser = vte::Parser::new(); - for &byte in ansi_instructions.as_bytes() { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, ansi_instructions.as_bytes()); format!("{:?}", grid) } @@ -1119,9 +1115,7 @@ fn take_snapshot_and_cursor_position( explicitly_disable_kitty_keyboard_protocol, ); let mut vte_parser = vte::Parser::new(); - for &byte in ansi_instructions.as_bytes() { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance(&mut grid, ansi_instructions.as_bytes()); let coords = grid .cursor_coordinates() .and_then(|(x, y, visible)| if visible { Some((x, y)) } else { None }); @@ -15364,9 +15358,10 @@ fn osc99_grid_parses_and_stores_notification() { // Feed OSC 99 through vte parser let mut vte_parser = vte::Parser::new(); - for &byte in b"\x1b]99;i=gridtest:p=title;Grid notification\x07" { - vte_parser.advance(&mut grid, byte); - } + vte_parser.advance( + &mut grid, + b"\x1b]99;i=gridtest:p=title;Grid notification\x07", + ); assert_eq!( grid.pending_desktop_notifications.len(), diff --git a/zellij-server/src/ui/components/mod.rs b/zellij-server/src/ui/components/mod.rs index ad927f0e..f47f97c4 100644 --- a/zellij-server/src/ui/components/mod.rs +++ b/zellij-server/src/ui/components/mod.rs @@ -28,9 +28,7 @@ macro_rules! parse_next_param { macro_rules! parse_vte_bytes { ($self:expr, $encoded_component:expr) => {{ let mut vte_parser = vte::Parser::new(); - for &byte in &$encoded_component { - vte_parser.advance($self.grid, byte); - } + vte_parser.advance($self.grid, &$encoded_component); }}; } diff --git a/zellij-server/src/unit/screen_tests.rs b/zellij-server/src/unit/screen_tests.rs index 9d839d30..d7f0f63f 100644 --- a/zellij-server/src/unit/screen_tests.rs +++ b/zellij-server/src/unit/screen_tests.rs @@ -57,9 +57,7 @@ fn take_snapshot_and_cursor_coordinates( grid: &mut Grid, ) -> (Option<(usize, usize)>, String) { let mut vte_parser = vte::Parser::new(); - for &byte in ansi_instructions.as_bytes() { - vte_parser.advance(grid, byte); - } + vte_parser.advance(grid, ansi_instructions.as_bytes()); let coords = grid .cursor_coordinates() .and_then(|(x, y, visible)| if visible { Some((x, y)) } else { None }); diff --git a/zellij-tile/Cargo.toml b/zellij-tile/Cargo.toml index feff43c9..81bfec86 100644 --- a/zellij-tile/Cargo.toml +++ b/zellij-tile/Cargo.toml @@ -7,7 +7,6 @@ description = "A small client-side library for writing Zellij plugins" license.workspace = true [dependencies] -clap = { workspace = true } prost = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } diff --git a/zellij-utils/Cargo.toml b/zellij-utils/Cargo.toml index 4a543e08..72037a66 100644 --- a/zellij-utils/Cargo.toml +++ b/zellij-utils/Cargo.toml @@ -14,11 +14,11 @@ anyhow = { workspace = true } backtrace = { version = "0.3.55", default-features = false, features = ["std"] } bitflags = { version = "2.5.0", default-features = false } clap = { workspace = true } -clap_complete = { version = "3.2.1", default-features = false } -colored = { version = "2.0.0", default-features = false } +clap_complete = { version = "4.6", default-features = false } +colored = { version = "3.1", default-features = false } colorsys = { version = "0.6.5", default-features = false, features = ["std"] } crossbeam = { version = "0.8.1", default-features = false, features = ["alloc", "std"] } -directories = { version = "5.0", default-features = false } +directories = { version = "6.0", default-features = false } include_dir = { version = "0.7.3", default-features = false } kdl = { version = "4.5.0", default-features = false, features = ["span"] } lazy_static = { workspace = true } @@ -29,7 +29,7 @@ prost = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } shellexpand = { version = "3.0.0", default-features = false, features = ["base-0", "tilde"] } -strip-ansi-escapes = { version = "0.1.0", default-features = false } +strip-ansi-escapes = { workspace = true } strum = { workspace = true } strum_macros = { workspace = true } tempfile = { workspace = true } @@ -41,7 +41,7 @@ sha2 = { workspace = true } libc = { workspace = true } [target.'cfg(not(target_family = "wasm"))'.dependencies] -base64 = { version = "0.13.0", default-features = false, features = ["std"] } +base64 = { version = "0.22", default-features = false, features = ["std"] } tokio = { workspace = true } tokio-stream = { version = "0.1" } tokio-util = { version = "0.7", default-features = false, features = ["compat", "io"] } @@ -57,7 +57,7 @@ rusqlite = { version = "0.30", default-features = false, features = ["bundled"], notify = { workspace = true } [target.'cfg(unix)'.dependencies] -nix = { workspace = true } +nix = { workspace = true, features = ["user"] } [target.'cfg(windows)'.dependencies] crossterm = { workspace = true, features = ["events"] } diff --git a/zellij-utils/assets/plugins/about.wasm b/zellij-utils/assets/plugins/about.wasm Binary files differindex 927632bc..81896425 100755 --- a/zellij-utils/assets/plugins/about.wasm +++ b/zellij-utils/assets/plugins/about.wasm diff --git a/zellij-utils/assets/plugins/compact-bar.wasm b/zellij-utils/assets/plugins/compact-bar.wasm Binary files differindex bf73dadd..3a22ab1b 100755 --- a/zellij-utils/assets/plugins/compact-bar.wasm +++ b/zellij-utils/assets/plugins/compact-bar.wasm diff --git a/zellij-utils/assets/plugins/configuration.wasm b/zellij-utils/assets/plugins/configuration.wasm Binary files differindex d615cdca..5163d569 100755 --- a/zellij-utils/assets/plugins/configuration.wasm +++ b/zellij-utils/assets/plugins/configuration.wasm diff --git a/zellij-utils/assets/plugins/fixture-plugin-for-tests.wasm b/zellij-utils/assets/plugins/fixture-plugin-for-tests.wasm Binary files differindex 1adf8d94..24170ee3 100755 --- a/zellij-utils/assets/plugins/fixture-plugin-for-tests.wasm +++ b/zellij-utils/assets/plugins/fixture-plugin-for-tests.wasm diff --git a/zellij-utils/assets/plugins/layout-manager.wasm b/zellij-utils/assets/plugins/layout-manager.wasm Binary files differindex fece91ea..d4024b7b 100755 --- a/zellij-utils/assets/plugins/layout-manager.wasm +++ b/zellij-utils/assets/plugins/layout-manager.wasm diff --git a/zellij-utils/assets/plugins/link.wasm b/zellij-utils/assets/plugins/link.wasm Binary files differindex 18a96f47..dcb6ca24 100755 --- a/zellij-utils/assets/plugins/link.wasm +++ b/zellij-utils/assets/plugins/link.wasm diff --git a/zellij-utils/assets/plugins/mobile.wasm b/zellij-utils/assets/plugins/mobile.wasm Binary files differindex 00ec86de..18232c41 100755 --- a/zellij-utils/assets/plugins/mobile.wasm +++ b/zellij-utils/assets/plugins/mobile.wasm diff --git a/zellij-utils/assets/plugins/multiple-select.wasm b/zellij-utils/assets/plugins/multiple-select.wasm Binary files differindex 2f2767d5..091dcb3b 100755 --- a/zellij-utils/assets/plugins/multiple-select.wasm +++ b/zellij-utils/assets/plugins/multiple-select.wasm diff --git a/zellij-utils/assets/plugins/plugin-manager.wasm b/zellij-utils/assets/plugins/plugin-manager.wasm Binary files differindex e146e20e..4ee57772 100755 --- a/zellij-utils/assets/plugins/plugin-manager.wasm +++ b/zellij-utils/assets/plugins/plugin-manager.wasm diff --git a/zellij-utils/assets/plugins/session-manager.wasm b/zellij-utils/assets/plugins/session-manager.wasm Binary files differindex bd2ba4b0..8607887a 100755 --- a/zellij-utils/assets/plugins/session-manager.wasm +++ b/zellij-utils/assets/plugins/session-manager.wasm diff --git a/zellij-utils/assets/plugins/share.wasm b/zellij-utils/assets/plugins/share.wasm Binary files differindex 9fe98cb2..b77919c3 100755 --- a/zellij-utils/assets/plugins/share.wasm +++ b/zellij-utils/assets/plugins/share.wasm diff --git a/zellij-utils/assets/plugins/status-bar.wasm b/zellij-utils/assets/plugins/status-bar.wasm Binary files differindex d2f14b1b..33d8bb4c 100755 --- a/zellij-utils/assets/plugins/status-bar.wasm +++ b/zellij-utils/assets/plugins/status-bar.wasm diff --git a/zellij-utils/assets/plugins/strider.wasm b/zellij-utils/assets/plugins/strider.wasm Binary files differindex f348f0b8..efc91d89 100755 --- a/zellij-utils/assets/plugins/strider.wasm +++ b/zellij-utils/assets/plugins/strider.wasm diff --git a/zellij-utils/assets/plugins/tab-bar.wasm b/zellij-utils/assets/plugins/tab-bar.wasm Binary files differindex 0bce4ec4..cd9ca086 100755 --- a/zellij-utils/assets/plugins/tab-bar.wasm +++ b/zellij-utils/assets/plugins/tab-bar.wasm diff --git a/zellij-utils/assets/prost/api.action.rs b/zellij-utils/assets/prost/api.action.rs index 4860feb1..cfe201cf 100644 --- a/zellij-utils/assets/prost/api.action.rs +++ b/zellij-utils/assets/prost/api.action.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PercentOrFixed { diff --git a/zellij-utils/assets/prost/api.command.rs b/zellij-utils/assets/prost/api.command.rs index 8864c375..bbb66d4a 100644 --- a/zellij-utils/assets/prost/api.command.rs +++ b/zellij-utils/assets/prost/api.command.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Command { diff --git a/zellij-utils/assets/prost/api.event.rs b/zellij-utils/assets/prost/api.event.rs index 4230d347..9e3b3a09 100644 --- a/zellij-utils/assets/prost/api.event.rs +++ b/zellij-utils/assets/prost/api.event.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventNameList { diff --git a/zellij-utils/assets/prost/api.file.rs b/zellij-utils/assets/prost/api.file.rs index 7bccc521..a87d0e7e 100644 --- a/zellij-utils/assets/prost/api.file.rs +++ b/zellij-utils/assets/prost/api.file.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct File { diff --git a/zellij-utils/assets/prost/api.input_mode.rs b/zellij-utils/assets/prost/api.input_mode.rs index c87f1bb9..09e7f44d 100644 --- a/zellij-utils/assets/prost/api.input_mode.rs +++ b/zellij-utils/assets/prost/api.input_mode.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InputModeMessage { diff --git a/zellij-utils/assets/prost/api.key.rs b/zellij-utils/assets/prost/api.key.rs index 32ab4b84..45284391 100644 --- a/zellij-utils/assets/prost/api.key.rs +++ b/zellij-utils/assets/prost/api.key.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Key { diff --git a/zellij-utils/assets/prost/api.message.rs b/zellij-utils/assets/prost/api.message.rs index 49fb032e..b2d2e66d 100644 --- a/zellij-utils/assets/prost/api.message.rs +++ b/zellij-utils/assets/prost/api.message.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Message { diff --git a/zellij-utils/assets/prost/api.pane_frame_style.rs b/zellij-utils/assets/prost/api.pane_frame_style.rs index a39ff161..4b475023 100644 --- a/zellij-utils/assets/prost/api.pane_frame_style.rs +++ b/zellij-utils/assets/prost/api.pane_frame_style.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum PaneFrameStyle { diff --git a/zellij-utils/assets/prost/api.pipe_message.rs b/zellij-utils/assets/prost/api.pipe_message.rs index 19372325..8c3bdbc3 100644 --- a/zellij-utils/assets/prost/api.pipe_message.rs +++ b/zellij-utils/assets/prost/api.pipe_message.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PipeMessage { diff --git a/zellij-utils/assets/prost/api.plugin_command.rs b/zellij-utils/assets/prost/api.plugin_command.rs index 9f053ae3..517386c0 100644 --- a/zellij-utils/assets/prost/api.plugin_command.rs +++ b/zellij-utils/assets/prost/api.plugin_command.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PluginCommand { diff --git a/zellij-utils/assets/prost/api.plugin_ids.rs b/zellij-utils/assets/prost/api.plugin_ids.rs index 165b7b71..0f98107a 100644 --- a/zellij-utils/assets/prost/api.plugin_ids.rs +++ b/zellij-utils/assets/prost/api.plugin_ids.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PluginIds { diff --git a/zellij-utils/assets/prost/api.plugin_permission.rs b/zellij-utils/assets/prost/api.plugin_permission.rs index 5da4fcf8..88fe8d21 100644 --- a/zellij-utils/assets/prost/api.plugin_permission.rs +++ b/zellij-utils/assets/prost/api.plugin_permission.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum PermissionType { diff --git a/zellij-utils/assets/prost/api.resize.rs b/zellij-utils/assets/prost/api.resize.rs index ca15e53b..688130a8 100644 --- a/zellij-utils/assets/prost/api.resize.rs +++ b/zellij-utils/assets/prost/api.resize.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Resize { diff --git a/zellij-utils/assets/prost/api.style.rs b/zellij-utils/assets/prost/api.style.rs index 16f7979e..8329d8f0 100644 --- a/zellij-utils/assets/prost/api.style.rs +++ b/zellij-utils/assets/prost/api.style.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Style { diff --git a/zellij-utils/assets/prost/generated_plugin_api.rs b/zellij-utils/assets/prost/generated_plugin_api.rs index fcea0e0a..18bf80b5 100644 --- a/zellij-utils/assets/prost/generated_plugin_api.rs +++ b/zellij-utils/assets/prost/generated_plugin_api.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. pub mod api { pub mod action { include!("api.action.rs"); diff --git a/zellij-utils/assets/prost_ipc/client_server_contract.rs b/zellij-utils/assets/prost_ipc/client_server_contract.rs index 11cc7937..642ad5e7 100644 --- a/zellij-utils/assets/prost_ipc/client_server_contract.rs +++ b/zellij-utils/assets/prost_ipc/client_server_contract.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Size { @@ -1993,8 +1994,6 @@ pub struct Options { pub show_release_notes: ::core::option::Option<bool>, #[prost(bool, optional, tag="33")] pub advanced_mouse_actions: ::core::option::Option<bool>, - #[prost(bool, optional, tag="54")] - pub mouse_scroll_resize: ::core::option::Option<bool>, #[prost(string, optional, tag="34")] pub web_server_ip: ::core::option::Option<::prost::alloc::string::String>, #[prost(uint32, optional, tag="35")] @@ -2035,6 +2034,8 @@ pub struct Options { pub stacked_pane_list: ::core::option::Option<bool>, #[prost(enumeration="NestedSessionHandling", optional, tag="53")] pub nested_session_handling: ::core::option::Option<i32>, + #[prost(bool, optional, tag="54")] + pub mouse_scroll_resize: ::core::option::Option<bool>, } /// Pane-targeting action messages #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/zellij-utils/assets/prost_ipc/generated_client_server_api.rs b/zellij-utils/assets/prost_ipc/generated_client_server_api.rs index 8370cdbf..a2f8d46b 100644 --- a/zellij-utils/assets/prost_ipc/generated_client_server_api.rs +++ b/zellij-utils/assets/prost_ipc/generated_client_server_api.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. pub mod client_server_contract { include!("client_server_contract.rs"); } diff --git a/zellij-utils/assets/prost_nested_session/generated_nested_session_api.rs b/zellij-utils/assets/prost_nested_session/generated_nested_session_api.rs index 59f16320..ac69f4e2 100644 --- a/zellij-utils/assets/prost_nested_session/generated_nested_session_api.rs +++ b/zellij-utils/assets/prost_nested_session/generated_nested_session_api.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. pub mod nested_session_contract { include!("nested_session_contract.rs"); } diff --git a/zellij-utils/assets/prost_nested_session/nested_session_contract.rs b/zellij-utils/assets/prost_nested_session/nested_session_contract.rs index 1a9e117a..7b06e9e9 100644 --- a/zellij-utils/assets/prost_nested_session/nested_session_contract.rs +++ b/zellij-utils/assets/prost_nested_session/nested_session_contract.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct NestedSessionMessage { diff --git a/zellij-utils/assets/prost_web_server/generated_web_server_api.rs b/zellij-utils/assets/prost_web_server/generated_web_server_api.rs index 74643583..980b69dc 100644 --- a/zellij-utils/assets/prost_web_server/generated_web_server_api.rs +++ b/zellij-utils/assets/prost_web_server/generated_web_server_api.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. pub mod web_server_contract { include!("web_server_contract.rs"); } diff --git a/zellij-utils/assets/prost_web_server/web_server_contract.rs b/zellij-utils/assets/prost_web_server/web_server_contract.rs index 05d9897b..fc303db1 100644 --- a/zellij-utils/assets/prost_web_server/web_server_contract.rs +++ b/zellij-utils/assets/prost_web_server/web_server_contract.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InstructionForWebServer { diff --git a/zellij-utils/src/cli.rs b/zellij-utils/src/cli.rs index 6d7f0bc2..7cc5877c 100644 --- a/zellij-utils/src/cli.rs +++ b/zellij-utils/src/cli.rs @@ -7,12 +7,26 @@ use crate::{ options::{Options, PaneFrameStyle}, }, }; -use clap::{ArgEnum, Args, Parser, Subcommand}; +use clap::builder::styling::{AnsiColor, Color, Style, Styles}; +use clap::{Args, Parser, Subcommand, ValueEnum}; use serde::{Deserialize, Serialize}; use std::net::IpAddr; use std::path::PathBuf; use url::Url; +const fn ansi(color: AnsiColor) -> Style { + Style::new().fg_color(Some(Color::Ansi(color))) +} + +const CLI_STYLES: Styles = Styles::styled() + .header(ansi(AnsiColor::Yellow)) + .usage(ansi(AnsiColor::Yellow)) + .literal(ansi(AnsiColor::Green)) + .placeholder(Style::new()) + .error(ansi(AnsiColor::Red)) + .valid(ansi(AnsiColor::Green)) + .invalid(ansi(AnsiColor::Yellow)); + fn validate_session(name: &str) -> Result<String, String> { #[cfg(unix)] { @@ -38,7 +52,7 @@ fn validate_session(name: &str) -> Result<String, String> { } #[derive(Parser, Default, Debug, Clone, Serialize, Deserialize)] -#[clap(version, name = "zellij")] +#[clap(version, name = "zellij", styles = CLI_STYLES, args_override_self = true)] pub struct CliArgs { /// Maximum panes on screen, caution: opening more panes will close old ones #[clap(long, value_parser)] @@ -65,7 +79,7 @@ pub struct CliArgs { /// Raw KDL layout string to use directly (instead of a file path) /// if inside a session (or using the --session flag) will be added to the session as a new tab /// or tabs, otherwise will start a new session - #[clap(long, value_parser, conflicts_with_all = &["layout", "new-session-with-layout"])] + #[clap(long, value_parser, conflicts_with_all = &["layout", "new_session_with_layout"])] pub layout_string: Option<String>, /// Name of a predefined layout inside the layout directory or the path to a layout file @@ -143,8 +157,7 @@ pub struct SubscribeCli { short, long, required = true, - multiple_values = true, - multiple_occurrences = true + num_args(1..) )] pub pane_id: Vec<String>, @@ -153,22 +166,21 @@ pub struct SubscribeCli { #[clap( short, long, - min_values = 0, - max_values = 1, - default_missing_value = "0" + default_missing_value = "0", + num_args(0..=1) )] pub scrollback: Option<usize>, /// Output format - #[clap(short, long, default_value = "raw", arg_enum)] + #[clap(short, long, default_value = "raw", value_enum)] pub format: SubscribeFormat, /// Preserve ANSI styling in the output - #[clap(long, value_parser, default_value("false"), takes_value(false))] + #[clap(long)] pub ansi: bool, } -#[derive(Debug, Clone, Serialize, Deserialize, ArgEnum)] +#[derive(Debug, Clone, Serialize, Deserialize, ValueEnum)] pub enum SubscribeFormat { Raw, Json, @@ -197,7 +209,7 @@ pub struct WebCli { short, long, value_parser, - conflicts_with_all(&["stop", "status", "create-token", "revoke-token", "revoke-all-tokens"]), + conflicts_with_all(&["stop", "status", "create_token", "revoke_token", "revoke_all_tokens"]), display_order = 5 )] pub daemonize: bool, @@ -235,7 +247,7 @@ pub struct WebCli { #[clap( long, value_parser, - conflicts_with_all(&["stop", "create-token", "revoke-token", "revoke-all-tokens"]), + conflicts_with_all(&["stop", "create_token", "revoke_token", "revoke_all_tokens"]), display_order = 13 )] pub ip: Option<IpAddr>, @@ -243,7 +255,7 @@ pub struct WebCli { #[clap( long, value_parser, - conflicts_with_all(&["stop", "create-token", "revoke-token", "revoke-all-tokens"]), + conflicts_with_all(&["stop", "create_token", "revoke_token", "revoke_all_tokens"]), display_order = 14 )] pub port: Option<u16>, @@ -251,7 +263,7 @@ pub struct WebCli { #[clap( long, value_parser, - conflicts_with_all(&["stop", "status", "create-token", "revoke-token", "revoke-all-tokens"]), + conflicts_with_all(&["stop", "status", "create_token", "revoke_token", "revoke_all_tokens"]), display_order = 15 )] pub cert: Option<PathBuf>, @@ -259,7 +271,7 @@ pub struct WebCli { #[clap( long, value_parser, - conflicts_with_all(&["stop", "status", "create-token", "revoke-token", "revoke-all-tokens"]), + conflicts_with_all(&["stop", "status", "create_token", "revoke_token", "revoke_all_tokens"]), display_order = 16 )] pub key: Option<PathBuf>, @@ -291,15 +303,15 @@ pub enum Sessions { #[clap(visible_alias = "ls")] ListSessions { /// Do not add colors and formatting to the list (useful for parsing) - #[clap(short, long, value_parser, takes_value(false), default_value("false"))] + #[clap(short, long)] no_formatting: bool, /// Print just the session name - #[clap(short, long, value_parser, takes_value(false), default_value("false"))] + #[clap(short, long)] short: bool, /// List the sessions in reverse order (default is ascending order) - #[clap(short, long, value_parser, takes_value(false), default_value("false"))] + #[clap(short, long)] reverse: bool, }, /// List existing plugin aliases @@ -329,7 +341,7 @@ pub enum Sessions { options: Option<Box<SessionCommand>>, /// If resurrecting a dead session, immediately run all its commands on startup - #[clap(short, long, value_parser, takes_value(false), default_value("false"))] + #[clap(short, long)] force_run_commands: bool, /// Authentication token for remote sessions @@ -376,7 +388,7 @@ pub enum Sessions { #[clap(value_parser)] target_session: Option<String>, /// Kill the session if it's running before deleting it - #[clap(short, long, value_parser, takes_value(false), default_value("false"))] + #[clap(short, long)] force: bool, }, @@ -395,7 +407,7 @@ pub enum Sessions { #[clap(short, long, value_parser)] yes: bool, /// Kill the sessions if they're running before deleting them - #[clap(short, long, value_parser, takes_value(false), default_value("false"))] + #[clap(short, long)] force: bool, }, @@ -416,29 +428,15 @@ pub enum Sessions { cwd: Option<PathBuf>, /// Open the new pane in floating mode - #[clap(short, long, value_parser, default_value("false"), takes_value(false))] + #[clap(short, long)] floating: bool, /// Open the new pane in place of the current pane, temporarily suspending it - #[clap( - short, - long, - value_parser, - default_value("false"), - takes_value(false), - conflicts_with("floating"), - conflicts_with("direction") - )] + #[clap(short, long, conflicts_with("floating"), conflicts_with("direction"))] in_place: bool, /// Close the replaced pane instead of suspending it (only effective with --in-place) - #[clap( - long, - value_parser, - default_value("false"), - takes_value(false), - requires("in-place") - )] + #[clap(long, requires("in_place"))] close_replaced_pane: bool, /// Name of the new pane @@ -446,11 +444,11 @@ pub enum Sessions { name: Option<String>, /// Close the pane immediately when its command exits - #[clap(short, long, value_parser, default_value("false"), takes_value(false))] + #[clap(short, long)] close_on_exit: bool, /// Start the command suspended, only running after you first presses ENTER - #[clap(short, long, value_parser, default_value("false"), takes_value(false))] + #[clap(short, long)] start_suspended: bool, /// The x coordinates if the pane is floating as a bare integer (eg. 1) or percent (eg. 10%) @@ -468,28 +466,18 @@ pub enum Sessions { /// Whether to pin a floating pane so that it is always on top #[clap(long, requires("floating"))] pinned: Option<bool>, - #[clap( - long, - conflicts_with("floating"), - conflicts_with("direction"), - value_parser, - default_value("false"), - takes_value(false) - )] + #[clap(long, conflicts_with("floating"), conflicts_with("direction"))] stacked: bool, /// Block until the command has finished and its pane has been closed - #[clap(long, value_parser, default_value("false"), takes_value(false))] + #[clap(long)] blocking: bool, /// Block until the command exits successfully (exit status 0) OR its pane has been closed #[clap( long, - value_parser, - default_value("false"), - takes_value(false), conflicts_with("blocking"), - conflicts_with("block-until-exit-failure"), - conflicts_with("block-until-exit") + conflicts_with("block_until_exit_failure"), + conflicts_with("block_until_exit") )] block_until_exit_success: bool, @@ -497,24 +485,18 @@ pub enum Sessions { /// closed #[clap( long, - value_parser, - default_value("false"), - takes_value(false), conflicts_with("blocking"), - conflicts_with("block-until-exit-success"), - conflicts_with("block-until-exit") + conflicts_with("block_until_exit_success"), + conflicts_with("block_until_exit") )] block_until_exit_failure: bool, /// Block until the command exits (regardless of exit status) OR its pane has been closed #[clap( long, - value_parser, - default_value("false"), - takes_value(false), conflicts_with("blocking"), - conflicts_with("block-until-exit-success"), - conflicts_with("block-until-exit-failure") + conflicts_with("block_until_exit_success"), + conflicts_with("block_until_exit_failure") )] block_until_exit: bool, /// if set, will open the pane near the current one rather than following the user's focus @@ -533,8 +515,8 @@ pub enum Sessions { #[clap( long, value_parser, - conflicts_with("near-current-pane"), - conflicts_with("in-place") + conflicts_with("near_current_pane"), + conflicts_with("in_place") )] tab_id: Option<usize>, }, @@ -551,32 +533,19 @@ pub enum Sessions { configuration: Option<PluginUserConfiguration>, /// Open the new pane in floating mode - #[clap(short, long, value_parser, default_value("false"), takes_value(false))] + #[clap(short, long)] floating: bool, /// Open the new pane in place of the current pane, temporarily suspending it - #[clap( - short, - long, - value_parser, - default_value("false"), - takes_value(false), - conflicts_with("floating") - )] + #[clap(short, long, conflicts_with("floating"))] in_place: bool, /// Close the replaced pane instead of suspending it (only effective with --in-place) - #[clap( - long, - value_parser, - default_value("false"), - takes_value(false), - requires("in-place") - )] + #[clap(long, requires("in_place"))] close_replaced_pane: bool, /// Skip the memory and HD cache and force recompile of the plugin (good for development) - #[clap(short, long, value_parser, default_value("false"), takes_value(false))] + #[clap(short, long)] skip_plugin_cache: bool, /// The x coordinates if the pane is floating as a bare integer (eg. 1) or percent (eg. 10%) #[clap(short, long, requires("floating"))] @@ -603,7 +572,7 @@ pub enum Sessions { #[clap(short, long, value_parser)] borderless: Option<bool>, /// Target a specific tab by ID - #[clap(long, value_parser, conflicts_with("in-place"))] + #[clap(long, value_parser, conflicts_with("in_place"))] tab_id: Option<usize>, }, /// Edit file with default $EDITOR / $VISUAL @@ -621,29 +590,15 @@ pub enum Sessions { direction: Option<Direction>, /// Open the new pane in place of the current pane, temporarily suspending it - #[clap( - short, - long, - value_parser, - default_value("false"), - takes_value(false), - conflicts_with("floating"), - conflicts_with("direction") - )] + #[clap(short, long, conflicts_with("floating"), conflicts_with("direction"))] in_place: bool, /// Close the replaced pane instead of suspending it (only effective with --in-place) - #[clap( - long, - value_parser, - default_value("false"), - takes_value(false), - requires("in-place") - )] + #[clap(long, requires("in_place"))] close_replaced_pane: bool, /// Open the new pane in floating mode - #[clap(short, long, value_parser, default_value("false"), takes_value(false))] + #[clap(short, long)] floating: bool, /// Change the working directory of the editor @@ -680,8 +635,8 @@ pub enum Sessions { #[clap( long, value_parser, - conflicts_with("near-current-pane"), - conflicts_with("in-place") + conflicts_with("near_current_pane"), + conflicts_with("in_place") )] tab_id: Option<usize>, }, @@ -821,7 +776,7 @@ pub enum CliAction { path: Option<PathBuf>, /// Dump the pane with full scrollback - #[clap(short, long, value_parser, default_value("false"), takes_value(false))] + #[clap(short, long)] full: bool, /// The pane_id of the pane, eg. terminal_1, plugin_2 or 3 (equivalent to terminal_3). If not specified, dumps the focused pane. @@ -829,7 +784,7 @@ pub enum CliAction { pane_id: Option<String>, /// Preserve ANSI styling in the dump output - #[clap(short, long, value_parser, default_value("false"), takes_value(false))] + #[clap(short, long)] ansi: bool, }, /// Dump current layout to stdout @@ -843,7 +798,7 @@ pub enum CliAction { pane_id: Option<String>, /// Preserve ANSI styling in the scrollback dump - #[clap(short, long, value_parser, default_value("false"), takes_value(false))] + #[clap(short, long)] ansi: bool, }, /// Scroll up in the focused pane @@ -915,7 +870,7 @@ pub enum CliAction { /// Toggle frames around panes in the UI TogglePaneFrames, SetPaneFrameStyle { - #[clap(arg_enum, value_parser)] + #[clap(value_enum, value_parser)] style: PaneFrameStyle, }, /// Toggle between sending text commands to all panes on the current tab and normal mode. @@ -943,29 +898,15 @@ pub enum CliAction { cwd: Option<PathBuf>, /// Open the new pane in floating mode - #[clap(short, long, value_parser, default_value("false"), takes_value(false))] + #[clap(short, long)] floating: bool, /// Open the new pane in place of the current pane, temporarily suspending it - #[clap( - short, - long, - value_parser, - default_value("false"), - takes_value(false), - conflicts_with("floating"), - conflicts_with("direction") - )] + #[clap(short, long, conflicts_with("floating"), conflicts_with("direction"))] in_place: bool, /// Close the replaced pane instead of suspending it (only effective with --in-place) - #[clap( - long, - value_parser, - default_value("false"), - takes_value(false), - requires("in-place") - )] + #[clap(long, requires("in_place"))] close_replaced_pane: bool, /// The pane to replace when opening in place, eg. terminal_1, plugin_2 or 3 (only @@ -973,8 +914,8 @@ pub enum CliAction { #[clap( long, value_parser, - requires("in-place"), - conflicts_with("near-current-pane") + requires("in_place"), + conflicts_with("near_current_pane") )] pane_id: Option<String>, @@ -983,24 +924,10 @@ pub enum CliAction { name: Option<String>, /// Close the pane immediately when its command exits - #[clap( - short, - long, - value_parser, - default_value("false"), - takes_value(false), - requires("command") - )] + #[clap(short, long, requires("command"))] close_on_exit: bool, /// Start the command suspended, only running it after the you first press ENTER - #[clap( - short, - long, - value_parser, - default_value("false"), - takes_value(false), - requires("command") - )] + #[clap(short, long, requires("command"))] start_suspended: bool, #[clap(long, value_parser)] configuration: Option<PluginUserConfiguration>, @@ -1021,14 +948,7 @@ pub enum CliAction { /// Whether to pin a floating pane so that it is always on top #[clap(long, requires("floating"))] pinned: Option<bool>, - #[clap( - long, - conflicts_with("floating"), - conflicts_with("direction"), - value_parser, - default_value("false"), - takes_value(false) - )] + #[clap(long, conflicts_with("floating"), conflicts_with("direction"))] stacked: bool, /// Block until the command has finished and its pane has been closed #[clap(short, long)] @@ -1037,12 +957,9 @@ pub enum CliAction { /// Block until the command exits successfully (exit status 0) OR its pane has been closed #[clap( long, - value_parser, - default_value("false"), - takes_value(false), conflicts_with("blocking"), - conflicts_with("block-until-exit-failure"), - conflicts_with("block-until-exit") + conflicts_with("block_until_exit_failure"), + conflicts_with("block_until_exit") )] block_until_exit_success: bool, @@ -1050,24 +967,18 @@ pub enum CliAction { /// closed #[clap( long, - value_parser, - default_value("false"), - takes_value(false), conflicts_with("blocking"), - conflicts_with("block-until-exit-success"), - conflicts_with("block-until-exit") + conflicts_with("block_until_exit_success"), + conflicts_with("block_until_exit") )] block_until_exit_failure: bool, /// Block until the command exits (regardless of exit status) OR its pane has been closed #[clap( long, - value_parser, - default_value("false"), - takes_value(false), conflicts_with("blocking"), - conflicts_with("block-until-exit-success"), - conflicts_with("block-until-exit-failure") + conflicts_with("block_until_exit_success"), + conflicts_with("block_until_exit_failure") )] block_until_exit: bool, @@ -1090,8 +1001,8 @@ pub enum CliAction { #[clap( long, value_parser, - conflicts_with("near-current-pane"), - conflicts_with("in-place") + conflicts_with("near_current_pane"), + conflicts_with("in_place") )] tab_id: Option<usize>, }, @@ -1109,29 +1020,15 @@ pub enum CliAction { line_number: Option<usize>, /// Open the new pane in floating mode - #[clap(short, long, value_parser, default_value("false"), takes_value(false))] + #[clap(short, long)] floating: bool, /// Open the new pane in place of the current pane, temporarily suspending it - #[clap( - short, - long, - value_parser, - default_value("false"), - takes_value(false), - conflicts_with("floating"), - conflicts_with("direction") - )] + #[clap(short, long, conflicts_with("floating"), conflicts_with("direction"))] in_place: bool, /// Close the replaced pane instead of suspending it (only effective with --in-place) - #[clap( - long, - value_parser, - default_value("false"), - takes_value(false), - requires("in-place") - )] + #[clap(long, requires("in_place"))] close_replaced_pane: bool, /// Change the working directory of the editor @@ -1168,8 +1065,8 @@ pub enum CliAction { #[clap( long, value_parser, - conflicts_with("near-current-pane"), - conflicts_with("in-place") + conflicts_with("near_current_pane"), + conflicts_with("in_place") )] tab_id: Option<usize>, }, @@ -1284,7 +1181,7 @@ pub enum CliAction { /// Returns: The created tab's ID as a single number on stdout NewTab { /// Layout to use for the new tab - #[clap(short, long, value_parser, conflicts_with = "layout-string")] + #[clap(short, long, value_parser, conflicts_with = "layout_string")] layout: Option<PathBuf>, /// Raw KDL layout string to use directly (instead of a layout file path) @@ -1304,72 +1201,45 @@ pub enum CliAction { cwd: Option<PathBuf>, /// Optional initial command to run in the new tab - #[clap( - value_parser, - conflicts_with("initial-plugin"), - multiple_values(true), - takes_value(true), - last(true) - )] + #[clap(value_parser, conflicts_with("initial_plugin"), last(true))] initial_command: Vec<String>, /// Initial plugin to load in the new tab - #[clap(long, value_parser, conflicts_with("initial-command"))] + #[clap(long, value_parser, conflicts_with("initial_command"))] initial_plugin: Option<String>, /// Close the pane immediately when its command exits - #[clap( - long, - value_parser, - default_value("false"), - takes_value(false), - requires("initial-command") - )] + #[clap(long, requires("initial_command"))] close_on_exit: bool, /// Start the command suspended, only running it after you first press ENTER - #[clap( - long, - value_parser, - default_value("false"), - takes_value(false), - requires("initial-command") - )] + #[clap(long, requires("initial_command"))] start_suspended: bool, /// Block until the command exits successfully (exit status 0) OR its pane has been closed #[clap( long, - value_parser, - default_value("false"), - takes_value(false), - requires("initial-command"), - conflicts_with("block-until-exit-failure"), - conflicts_with("block-until-exit") + requires("initial_command"), + conflicts_with("block_until_exit_failure"), + conflicts_with("block_until_exit") )] block_until_exit_success: bool, /// Block until the command exits with failure (non-zero exit status) OR its pane has been closed #[clap( long, - value_parser, - default_value("false"), - takes_value(false), - requires("initial-command"), - conflicts_with("block-until-exit-success"), - conflicts_with("block-until-exit") + requires("initial_command"), + conflicts_with("block_until_exit_success"), + conflicts_with("block_until_exit") )] block_until_exit_failure: bool, /// Block until the command exits (regardless of exit status) OR its pane has been closed #[clap( long, - value_parser, - default_value("false"), - takes_value(false), - requires("initial-command"), - conflicts_with("block-until-exit-success"), - conflicts_with("block-until-exit-failure") + requires("initial_command"), + conflicts_with("block_until_exit_success"), + conflicts_with("block_until_exit_failure") )] block_until_exit: bool, @@ -1401,8 +1271,8 @@ pub enum CliAction { /// Path to the layout file #[clap( value_parser, - required_unless_present = "layout-string", - conflicts_with = "layout-string" + required_unless_present = "layout_string", + conflicts_with = "layout_string" )] layout: Option<PathBuf>, @@ -1415,16 +1285,16 @@ pub enum CliAction { layout_dir: Option<PathBuf>, /// Retain existing terminal panes that do not fit in the layout (default: false) - #[clap(long, value_parser, takes_value(false), default_value("false"))] + #[clap(long)] retain_existing_terminal_panes: bool, /// Retain existing plugin panes that do not fit with the layout default: false) - #[clap(long, value_parser, takes_value(false), default_value("false"))] + #[clap(long)] retain_existing_plugin_panes: bool, /// Only apply the layout to the active tab (uses just the first layout tab if it has /// multiple) - #[clap(long, value_parser, takes_value(false), default_value("false"))] + #[clap(long)] apply_only_to_active_tab: bool, }, /// Query all tab names @@ -1441,13 +1311,7 @@ pub enum CliAction { #[clap(short, long, value_parser)] in_place: bool, /// Close the replaced pane instead of suspending it (only effective with --in-place) - #[clap( - long, - value_parser, - default_value("false"), - takes_value(false), - requires("in-place") - )] + #[clap(long, requires("in_place"))] close_replaced_pane: bool, #[clap(short, long, value_parser)] move_to_focused_tab: bool, @@ -1457,7 +1321,7 @@ pub enum CliAction { #[clap(short, long, value_parser)] skip_plugin_cache: bool, /// Target a specific tab by ID - #[clap(long, value_parser, conflicts_with("in-place"))] + #[clap(long, value_parser, conflicts_with("in_place"))] tab_id: Option<usize>, }, /// Returns: Plugin pane ID (format: plugin_<id>) @@ -1467,13 +1331,7 @@ pub enum CliAction { #[clap(short, long, value_parser)] in_place: bool, /// Close the replaced pane instead of suspending it (only effective with --in-place) - #[clap( - long, - value_parser, - default_value("false"), - takes_value(false), - requires("in-place") - )] + #[clap(long, requires("in_place"))] close_replaced_pane: bool, url: Url, #[clap(short, long, value_parser)] @@ -1486,7 +1344,7 @@ pub enum CliAction { )] no_focus: bool, /// Target a specific tab by ID - #[clap(long, value_parser, conflicts_with("in-place"))] + #[clap(long, value_parser, conflicts_with("in_place"))] tab_id: Option<usize>, }, RenameSession { @@ -1529,24 +1387,10 @@ tail -f /tmp/my-live-logfile | zellij action pipe --name logs --plugin https://e #[clap(short('c'), long, value_parser, display_order(4))] plugin_configuration: Option<PluginUserConfiguration>, /// Launch a new plugin even if one is already running - #[clap( - short('l'), - long, - value_parser, - takes_value(false), - default_value("false"), - display_order(5) - )] + #[clap(short('l'), long, display_order(5))] force_launch_plugin: bool, /// If launching a new plugin, skip cache and force-compile the plugin - #[clap( - short('s'), - long, - value_parser, - takes_value(false), - default_value("false"), - display_order(6) - )] + #[clap(short('s'), long, display_order(6))] skip_plugin_cache: bool, /// If launching a plugin, should it be floating or not, defaults to floating #[clap(short('f'), long, value_parser, display_order(7))] @@ -1556,7 +1400,7 @@ tail -f /tmp/my-live-logfile | zellij action pipe --name logs --plugin https://e short('i'), long, value_parser, - conflicts_with("floating-plugin"), + conflicts_with("floating_plugin"), display_order(8) )] in_place_plugin: Option<bool>, @@ -1705,7 +1549,7 @@ tail -f /tmp/my-live-logfile | zellij action pipe --name logs --plugin https://e #[clap(long)] pane_id: Option<String>, /// Layout to apply when switching to the session (relative paths start at layout-dir) - #[clap(short, long, value_parser, conflicts_with = "layout-string")] + #[clap(short, long, value_parser, conflicts_with = "layout_string")] layout: Option<PathBuf>, /// Raw KDL layout string to use directly #[clap(long, value_parser, conflicts_with = "layout")] diff --git a/zellij-utils/src/data.rs b/zellij-utils/src/data.rs index 62f95a06..12e66002 100644 --- a/zellij-utils/src/data.rs +++ b/zellij-utils/src/data.rs @@ -9,7 +9,7 @@ pub use crate::input::options::PaneFrameStyle; use crate::pane_size::{PaneGeom, Size}; use crate::position::Position; use crate::shared::{colors as default_colors, eightbit_to_rgb}; -use clap::ArgEnum; +use clap::ValueEnum; use serde::{Deserialize, Serialize}; use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use std::fmt; @@ -1152,7 +1152,7 @@ impl PluginPermission { EnumIter, Serialize, Deserialize, - ArgEnum, + ValueEnum, PartialOrd, Ord, )] @@ -3187,7 +3187,7 @@ impl OriginatingPlugin { } } -#[derive(ArgEnum, Deserialize, Serialize, Debug, Clone, Copy, PartialEq, Eq)] +#[derive(ValueEnum, Deserialize, Serialize, Debug, Clone, Copy, PartialEq, Eq)] pub enum WebSharing { #[serde(alias = "on")] On, diff --git a/zellij-utils/src/input/config.rs b/zellij-utils/src/input/config.rs index 4d8d9e1d..1b917864 100644 --- a/zellij-utils/src/input/config.rs +++ b/zellij-utils/src/input/config.rs @@ -44,7 +44,7 @@ pub struct Config { pub struct KdlError { pub error_message: String, #[serde(skip)] - pub src: Option<NamedSource>, + pub src: Option<NamedSource<String>>, pub offset: Option<usize>, pub len: Option<usize>, pub help_message: Option<String>, diff --git a/zellij-utils/src/input/options.rs b/zellij-utils/src/input/options.rs index 194ab24c..6c07fd7d 100644 --- a/zellij-utils/src/input/options.rs +++ b/zellij-utils/src/input/options.rs @@ -1,14 +1,14 @@ //! Handles cli and configuration options use crate::cli::Command; use crate::data::{InputMode, WebSharing}; -use clap::{ArgEnum, Args}; +use clap::{Args, ValueEnum}; use serde::{Deserialize, Serialize}; use std::path::PathBuf; use std::str::FromStr; use std::net::IpAddr; -#[derive(Copy, Clone, Debug, PartialEq, Deserialize, Serialize, ArgEnum)] +#[derive(Copy, Clone, Debug, PartialEq, Deserialize, Serialize, ValueEnum)] pub enum OnForceClose { #[serde(alias = "quit")] Quit, @@ -16,7 +16,7 @@ pub enum OnForceClose { Detach, } -#[derive(Copy, Clone, Debug, PartialEq, Eq, Deserialize, Serialize, ArgEnum)] +#[derive(Copy, Clone, Debug, PartialEq, Eq, Deserialize, Serialize, ValueEnum)] pub enum MobileLayoutConfiguration { #[serde(alias = "web")] Web, @@ -75,7 +75,7 @@ impl MobileLayoutConfiguration { } } -#[derive(Copy, Clone, Debug, PartialEq, Eq, Deserialize, Serialize, ArgEnum)] +#[derive(Copy, Clone, Debug, PartialEq, Eq, Deserialize, Serialize, ValueEnum)] pub enum NestedSessionHandling { #[serde(alias = "ask")] Ask, @@ -124,7 +124,7 @@ impl FromStr for OnForceClose { } } -#[derive(ArgEnum, Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)] +#[derive(ValueEnum, Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)] #[serde(rename_all = "lowercase")] pub enum PaneFrameStyle { Full, @@ -199,7 +199,7 @@ pub struct Options { #[clap(long, value_parser)] pub theme_light: Option<String>, /// Set the default mode - #[clap(long, arg_enum, hide_possible_values = true, value_parser)] + #[clap(long, value_enum, hide_possible_values = true, value_parser)] pub default_mode: Option<InputMode>, /// Set the default shell #[clap(long, value_parser)] @@ -227,7 +227,7 @@ pub struct Options { #[serde(default)] /// Set display of the pane frames (true or false) pub pane_frames: Option<bool>, - #[clap(long, arg_enum, hide_possible_values = true, value_parser)] + #[clap(long, value_enum, hide_possible_values = true, value_parser)] #[serde(default)] pub pane_frame_style: Option<PaneFrameStyle>, #[clap(long, value_parser)] @@ -235,7 +235,7 @@ pub struct Options { /// Mirror session when multiple users are connected (true or false) pub mirror_session: Option<bool>, /// Set behaviour on force close (quit or detach) - #[clap(long, arg_enum, hide_possible_values = true, value_parser)] + #[clap(long, value_enum, hide_possible_values = true, value_parser)] pub on_force_close: Option<OnForceClose>, #[clap(long, value_parser)] pub scroll_buffer_size: Option<usize>, @@ -248,9 +248,9 @@ pub struct Options { /// OSC52 destination clipboard #[clap( long, - arg_enum, + value_enum, ignore_case = true, - conflicts_with = "copy-command", + conflicts_with = "copy_command", value_parser )] #[serde(default)] @@ -433,7 +433,7 @@ pub struct Options { pub client_async_worker_tasks: Option<usize>, /// When a newly-attaching client should land in the mobile UI plugin (web, always, never) - #[clap(long, arg_enum, hide_possible_values = true, value_parser)] + #[clap(long, value_enum, hide_possible_values = true, value_parser)] #[serde(default)] pub mobile_layout: Option<MobileLayoutConfiguration>, @@ -449,12 +449,12 @@ pub struct Options { /// How to handle a nested Zellij session detected inside a pane /// (ask, fullscreen, descend, never) - #[clap(long, arg_enum, hide_possible_values = true, value_parser)] + #[clap(long, value_enum, hide_possible_values = true, value_parser)] #[serde(default)] pub nested_session_handling: Option<NestedSessionHandling>, } -#[derive(ArgEnum, Deserialize, Serialize, Debug, Clone, Copy, PartialEq)] +#[derive(ValueEnum, Deserialize, Serialize, Debug, Clone, Copy, PartialEq)] pub enum Clipboard { #[serde(alias = "system")] System, diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_more_than_one_focused_tab.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_more_than_one_focused_tab.snap index c730d0d7..21614c49 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_more_than_one_focused_tab.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_more_than_one_focused_tab.snap @@ -1,6 +1,5 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1015 -expression: "format!(\"{:?}\", layout_error)" +expression: "normalize_layout_debug(format!(\"{:?}\", layout_error))" --- -KdlError(KdlError { error_message: "Only one tab can be focused", src: Some(NamedSource { name: "layout_file_name", source: "<redacted>"), offset: Some(0), len: Some(98), help_message: Some("For more information, please see our layout guide: https://zellij.dev/documentation/creating-a-layout.html") }) +KdlError(KdlError { error_message: "Only one tab can be focused", src: Some(NamedSource { name: "layout_file_name", source: "<redacted>", language: None), offset: Some(0), len: Some(98), help_message: Some("For more information, please see our layout guide: https://zellij.dev/documentation/creating-a-layout.html") }) diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_multiple_layout_nodes_in_file.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_multiple_layout_nodes_in_file.snap index baa2e3ce..ed93deff 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_multiple_layout_nodes_in_file.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_multiple_layout_nodes_in_file.snap @@ -1,6 +1,5 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 901 -expression: "format!(\"{:?}\", layout_error)" +expression: "normalize_layout_debug(format!(\"{:?}\", layout_error))" --- -KdlError(KdlError { error_message: "Only one layout node per file allowed", src: Some(NamedSource { name: "layout_file_name", source: "<redacted>"), offset: Some(0), len: Some(31), help_message: Some("For more information, please see our layout guide: https://zellij.dev/documentation/creating-a-layout.html") }) +KdlError(KdlError { error_message: "Only one layout node per file allowed", src: Some(NamedSource { name: "layout_file_name", source: "<redacted>", language: None), offset: Some(0), len: Some(31), help_message: Some("For more information, please see our layout guide: https://zellij.dev/documentation/creating-a-layout.html") }) diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_pane_templates_without_a_name.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_pane_templates_without_a_name.snap index 6fa185bd..fa61245a 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_pane_templates_without_a_name.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_pane_templates_without_a_name.snap @@ -1,6 +1,5 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 985 -expression: "format!(\"{:?}\", layout_error)" +expression: "normalize_layout_debug(format!(\"{:?}\", layout_error))" --- -KdlError(KdlError { error_message: "Pane templates must have a name", src: Some(NamedSource { name: "layout_file_name", source: "<redacted>"), offset: Some(30), len: Some(96), help_message: Some("For more information, please see our layout guide: https://zellij.dev/documentation/creating-a-layout.html") }) +KdlError(KdlError { error_message: "Pane templates must have a name", src: Some(NamedSource { name: "layout_file_name", source: "<redacted>", language: None), offset: Some(30), len: Some(96), help_message: Some("For more information, please see our layout guide: https://zellij.dev/documentation/creating-a-layout.html") }) diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_tab_templates_without_a_name.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_tab_templates_without_a_name.snap index c1cce542..d5d19aeb 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_tab_templates_without_a_name.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_tab_templates_without_a_name.snap @@ -1,6 +1,5 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1002 -expression: "format!(\"{:?}\", layout_error)" +expression: "normalize_layout_debug(format!(\"{:?}\", layout_error))" --- -KdlError(KdlError { error_message: "Tab templates must have a name", src: Some(NamedSource { name: "layout_file_name", source: "<redacted>"), offset: Some(30), len: Some(95), help_message: Some("For more information, please see our layout guide: https://zellij.dev/documentation/creating-a-layout.html") }) +KdlError(KdlError { error_message: "Tab templates must have a name", src: Some(NamedSource { name: "layout_file_name", source: "<redacted>", language: None), offset: Some(30), len: Some(95), help_message: Some("For more information, please see our layout guide: https://zellij.dev/documentation/creating-a-layout.html") }) diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_node.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_node.snap index 845e41c6..7b1b8af4 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_node.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_node.snap @@ -1,6 +1,5 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 916 -expression: "format!(\"{:?}\", layout_error)" +expression: "normalize_layout_debug(format!(\"{:?}\", layout_error))" --- -KdlError(KdlError { error_message: "Unknown layout node: 'i_am_not_a_proper_node'", src: Some(NamedSource { name: "layout_file_name", source: "<redacted>"), offset: Some(47), len: Some(22), help_message: Some("For more information, please see our layout guide: https://zellij.dev/documentation/creating-a-layout.html") }) +KdlError(KdlError { error_message: "Unknown layout node: 'i_am_not_a_proper_node'", src: Some(NamedSource { name: "layout_file_name", source: "<redacted>", language: None), offset: Some(47), len: Some(22), help_message: Some("For more information, please see our layout guide: https://zellij.dev/documentation/creating-a-layout.html") }) diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_pane_property.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_pane_property.snap index 35dfaf03..1e976f41 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_pane_property.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_pane_property.snap @@ -1,6 +1,5 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 929 -expression: "format!(\"{:?}\", layout_error)" +expression: "normalize_layout_debug(format!(\"{:?}\", layout_error))" --- -KdlError(KdlError { error_message: "Unknown pane property: spit_size", src: Some(NamedSource { name: "layout_file_name", source: "<redacted>"), offset: Some(35), len: Some(11), help_message: Some("For more information, please see our layout guide: https://zellij.dev/documentation/creating-a-layout.html") }) +KdlError(KdlError { error_message: "Unknown pane property: spit_size", src: Some(NamedSource { name: "layout_file_name", source: "<redacted>", language: None), offset: Some(35), len: Some(11), help_message: Some("For more information, please see our layout guide: https://zellij.dev/documentation/creating-a-layout.html") }) diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_pane_template_property.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_pane_template_property.snap index a4a5f085..879381fe 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_pane_template_property.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_pane_template_property.snap @@ -1,6 +1,5 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 942 -expression: "format!(\"{:?}\", layout_error)" +expression: "normalize_layout_debug(format!(\"{:?}\", layout_error))" --- -KdlError(KdlError { error_message: "Unknown pane property: spit_size", src: Some(NamedSource { name: "layout_file_name", source: "<redacted>"), offset: Some(68), len: Some(11), help_message: Some("For more information, please see our layout guide: https://zellij.dev/documentation/creating-a-layout.html") }) +KdlError(KdlError { error_message: "Unknown pane property: spit_size", src: Some(NamedSource { name: "layout_file_name", source: "<redacted>", language: None), offset: Some(68), len: Some(11), help_message: Some("For more information, please see our layout guide: https://zellij.dev/documentation/creating-a-layout.html") }) diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_tab_property.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_tab_property.snap index 09a86ca9..ccb5b949 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_tab_property.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_tab_property.snap @@ -1,6 +1,5 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 955 -expression: "format!(\"{:?}\", layout_error)" +expression: "normalize_layout_debug(format!(\"{:?}\", layout_error))" --- -KdlError(KdlError { error_message: "Invalid tab property 'spit_size'", src: Some(NamedSource { name: "layout_file_name", source: "<redacted>"), offset: Some(30), len: Some(15), help_message: Some("For more information, please see our layout guide: https://zellij.dev/documentation/creating-a-layout.html") }) +KdlError(KdlError { error_message: "Invalid tab property 'spit_size'", src: Some(NamedSource { name: "layout_file_name", source: "<redacted>", language: None), offset: Some(30), len: Some(15), help_message: Some("For more information, please see our layout guide: https://zellij.dev/documentation/creating-a-layout.html") }) diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_tab_template_property.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_tab_template_property.snap index b75e4c91..a8fc34b5 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_tab_template_property.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__error_on_unknown_layout_tab_template_property.snap @@ -1,6 +1,5 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 968 -expression: "format!(\"{:?}\", layout_error)" +expression: "normalize_layout_debug(format!(\"{:?}\", layout_error))" --- -KdlError(KdlError { error_message: "Invalid tab property 'spit_size'", src: Some(NamedSource { name: "layout_file_name", source: "<redacted>"), offset: Some(30), len: Some(48), help_message: Some("For more information, please see our layout guide: https://zellij.dev/documentation/creating-a-layout.html") }) +KdlError(KdlError { error_message: "Invalid tab property 'spit_size'", src: Some(NamedSource { name: "layout_file_name", source: "<redacted>", language: None), offset: Some(30), len: Some(48), help_message: Some("For more information, please see our layout guide: https://zellij.dev/documentation/creating-a-layout.html") }) diff --git a/zellij-utils/src/nested_session.rs b/zellij-utils/src/nested_session.rs index 4144defc..8ec29a63 100644 --- a/zellij-utils/src/nested_session.rs +++ b/zellij-utils/src/nested_session.rs @@ -1,8 +1,18 @@ use crate::data::{Direction, KeyWithModifier}; use crate::nested_session_contract::nested_session_contract as proto; +use base64::alphabet::STANDARD as BASE64_STANDARD_ALPHABET; +use base64::engine::general_purpose::{ + GeneralPurpose, GeneralPurposeConfig, STANDARD as BASE64_STANDARD, +}; +use base64::engine::{DecodePaddingMode, Engine as _}; use prost::Message; use std::str::FromStr; +const BASE64_DECODER: GeneralPurpose = GeneralPurpose::new( + &BASE64_STANDARD_ALPHABET, + GeneralPurposeConfig::new().with_decode_padding_mode(DecodePaddingMode::Indifferent), +); + pub const NESTED_DCS_PARAM: u16 = 26661; pub const NESTED_FRAME_HEADER: &[u8] = b"\x1bP26661n"; pub const NESTED_FRAME_TERMINATOR: &[u8] = b"\x1b\\"; @@ -244,7 +254,7 @@ pub fn encode_frame(message: &NestedSessionMessage) -> Vec<u8> { } pub fn encode_frame_from_payload(payload_bytes: &[u8]) -> Vec<u8> { - let encoded = base64::encode(payload_bytes); + let encoded = BASE64_STANDARD.encode(payload_bytes); let mut frame = Vec::with_capacity( NESTED_FRAME_HEADER.len() + encoded.len() + NESTED_FRAME_TERMINATOR.len(), ); @@ -255,7 +265,7 @@ pub fn encode_frame_from_payload(payload_bytes: &[u8]) -> Vec<u8> { } pub fn decode_base64(encoded: &[u8]) -> Option<Vec<u8>> { - base64::decode(encoded).ok() + BASE64_DECODER.decode(encoded).ok() } const MAX_PARTIAL_FRAME_BYTES: usize = 1024 * 1024; diff --git a/zellij-utils/src/setup.rs b/zellij-utils/src/setup.rs index d2eafe7e..60d6506f 100644 --- a/zellij-utils/src/setup.rs +++ b/zellij-utils/src/setup.rs @@ -14,7 +14,7 @@ use crate::{ options::Options, }, }; -use clap::{Args, IntoApp}; +use clap::{Args, CommandFactory}; use clap_complete::Shell; use log::info; use serde::{Deserialize, Serialize}; @@ -271,8 +271,7 @@ pub struct Setup { value_name = "DIR", value_parser, exclusive = true, - min_values = 0, - max_values = 1 + num_args(0..=1) )] pub dump_plugins: Option<Option<PathBuf>>, diff --git a/zellij-utils/src/shared.rs b/zellij-utils/src/shared.rs index a65b6aa4..7e27f9a8 100644 --- a/zellij-utils/src/shared.rs +++ b/zellij-utils/src/shared.rs @@ -33,7 +33,7 @@ pub fn set_permissions(_path: &std::path::Path, _mode: u32) -> std::io::Result<( } pub fn ansi_len(s: &str) -> usize { - from_utf8(&strip(s).unwrap()).unwrap().width() + from_utf8(&strip(s)).unwrap().width() } pub fn clean_string_from_control_and_linebreak(input: &str) -> String { |
