diff --git a/Cargo.lock b/Cargo.lock index 0795df7..3a7113b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -145,6 +145,156 @@ dependencies = [ "term", ] +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +dependencies = [ + "concurrent-queue", + "event-listener 4.0.3", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" +dependencies = [ + "async-lock 3.3.0", + "async-task", + "concurrent-queue", + "fastrand 2.0.1", + "futures-lite 2.2.0", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" +dependencies = [ + "async-channel 2.1.1", + "async-executor", + "async-io 2.2.2", + "async-lock 3.3.0", + "blocking", + "futures-lite 2.2.0", + "once_cell", +] + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite 1.13.0", + "log", + "parking", + "polling 2.8.0", + "rustix 0.37.27", + "slab", + "socket2 0.4.10", + "waker-fn", +] + +[[package]] +name = "async-io" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6afaa937395a620e33dc6a742c593c01aced20aa376ffb0f628121198578ccc7" +dependencies = [ + "async-lock 3.3.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.2.0", + "parking", + "polling 3.3.1", + "rustix 0.38.28", + "slab", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +dependencies = [ + "event-listener 4.0.3", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-std" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" +dependencies = [ + "async-channel 1.9.0", + "async-global-executor", + "async-io 1.13.0", + "async-lock 2.8.0", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite 1.13.0", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + +[[package]] +name = "async-task" +version = "4.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.1.0" @@ -256,6 +406,9 @@ name = "bitflags" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +dependencies = [ + "serde", +] [[package]] name = "block-buffer" @@ -266,6 +419,22 @@ dependencies = [ "generic-array", ] +[[package]] +name = "blocking" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +dependencies = [ + "async-channel 2.1.1", + "async-lock 3.3.0", + "async-task", + "fastrand 2.0.1", + "futures-io", + "futures-lite 2.2.0", + "piper", + "tracing", +] + [[package]] name = "buffered-reader" version = "1.3.0" @@ -444,6 +613,15 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +[[package]] +name = "concurrent-queue" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "console" version = "0.15.7" @@ -486,6 +664,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + [[package]] name = "crossterm" version = "0.27.0" @@ -501,6 +685,15 @@ dependencies = [ "signal-hook-mio", ] +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi", +] + [[package]] name = "crunchy" version = "0.2.2" @@ -567,6 +760,19 @@ dependencies = [ "syn", ] +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.3", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "der" version = "0.6.1" @@ -725,6 +931,42 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + [[package]] name = "fastrand" version = "2.0.1" @@ -780,28 +1022,127 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + [[package]] name = "futures-core" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-lite" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +dependencies = [ + "fastrand 2.0.1", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + [[package]] name = "futures-task" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + [[package]] name = "futures-util" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ + "futures-channel", "futures-core", + "futures-io", + "futures-macro", + "futures-sink", "futures-task", + "memchr", "pin-project-lite", "pin-utils", + "slab", ] [[package]] @@ -850,6 +1191,18 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +[[package]] +name = "gloo-timers" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + [[package]] name = "group" version = "0.13.0" @@ -989,6 +1342,26 @@ dependencies = [ "yaml-rust", ] +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "is-terminal" version = "0.4.10" @@ -996,7 +1369,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ "hermit-abi", - "rustix", + "rustix 0.38.28", "windows-sys 0.52.0", ] @@ -1067,6 +1440,29 @@ dependencies = [ "tokio", ] +[[package]] +name = "keyfork-crossterm" +version = "0.27.0" +dependencies = [ + "async-std", + "bitflags 2.4.1", + "crossterm_winapi", + "filedescriptor", + "futures", + "futures-core", + "futures-timer", + "libc", + "mio", + "parking_lot", + "serde", + "serde_json", + "serial_test", + "signal-hook", + "signal-hook-mio", + "tokio", + "winapi", +] + [[package]] name = "keyfork-derive-key" version = "0.1.0" @@ -1232,6 +1628,15 @@ dependencies = [ "thiserror", ] +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + [[package]] name = "lalrpop" version = "0.20.0" @@ -1314,6 +1719,12 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + [[package]] name = "linux-raw-sys" version = "0.4.12" @@ -1335,6 +1746,9 @@ name = "log" version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +dependencies = [ + "value-bag", +] [[package]] name = "matchers" @@ -1552,6 +1966,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + [[package]] name = "parking_lot" version = "0.12.1" @@ -1670,6 +2090,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand 2.0.1", + "futures-io", +] + [[package]] name = "pkcs1" version = "0.4.1" @@ -1714,6 +2145,36 @@ version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] + +[[package]] +name = "polling" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e" +dependencies = [ + "cfg-if", + "concurrent-queue", + "pin-project-lite", + "rustix 0.38.28", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "polyval" version = "0.6.1" @@ -1952,6 +2413,20 @@ dependencies = [ "semver", ] +[[package]] +name = "rustix" +version = "0.37.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + [[package]] name = "rustix" version = "0.38.28" @@ -1961,7 +2436,7 @@ dependencies = [ "bitflags 2.4.1", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.12", "windows-sys 0.52.0", ] @@ -2065,6 +2540,31 @@ dependencies = [ "serde", ] +[[package]] +name = "serial_test" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e56dd856803e253c8f298af3f4d7eb0ae5e23a737252cd90bb4f3b435033b2d" +dependencies = [ + "dashmap", + "futures", + "lazy_static", + "log", + "parking_lot", + "serial_test_derive", +] + +[[package]] +name = "serial_test_derive" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "sha1collisiondetection" version = "0.3.2" @@ -2164,6 +2664,15 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + [[package]] name = "smallvec" version = "1.11.2" @@ -2174,6 +2683,16 @@ checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" name = "smex" version = "0.1.0" +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "socket2" version = "0.5.5" @@ -2263,9 +2782,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", - "fastrand", + "fastrand 2.0.1", "redox_syscall", - "rustix", + "rustix 0.38.28", "windows-sys 0.52.0", ] @@ -2286,7 +2805,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "rustix", + "rustix 0.38.28", "windows-sys 0.48.0", ] @@ -2355,9 +2874,10 @@ dependencies = [ "libc", "mio", "num_cpus", + "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.5", "tokio-macros", "tracing", "windows-sys 0.48.0", @@ -2535,6 +3055,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +[[package]] +name = "value-bag" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cdbaf5e132e593e9fc1de6a15bbec912395b11fb9719e061cf64f804524c503" + [[package]] name = "vcpkg" version = "0.2.15" @@ -2547,6 +3073,12 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "waker-fn" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2578,6 +3110,18 @@ dependencies = [ "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.89" @@ -2607,6 +3151,16 @@ version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +[[package]] +name = "web-sys" +version = "0.3.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "winapi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index cfc3d47..4c12b52 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ resolver = "2" members = [ "keyfork", + "keyfork-crossterm", "keyfork-entropy", "keyfork-derive-key", "keyfork-derive-openpgp", diff --git a/keyfork-crossterm/Cargo.toml b/keyfork-crossterm/Cargo.toml index 32006e5..92c86e2 100644 --- a/keyfork-crossterm/Cargo.toml +++ b/keyfork-crossterm/Cargo.toml @@ -1,31 +1,28 @@ [package] -name = "crossterm" -version = "0.27.0" -authors = ["T. Post"] +name = "keyfork-crossterm" +version = "0.27.1" +# authors = ["T. Post"] +authors = ["Ryan Heywood "] description = "A crossplatform terminal library for manipulating terminals." -repository = "https://github.com/crossterm-rs/crossterm" -documentation = "https://docs.rs/crossterm/" +repository = "https://git.distrust.co/public/keyfork" +# documentation = "https://docs.rs/crossterm/" license = "MIT" -keywords = ["event", "color", "cli", "input", "terminal"] -exclude = ["target", "Cargo.lock"] +# keywords = ["event", "color", "cli", "input", "terminal"] +# exclude = ["target", "Cargo.lock"] readme = "README.md" edition = "2021" rust-version = "1.58.0" -categories = ["command-line-interface", "command-line-utilities"] +# categories = ["command-line-interface", "command-line-utilities"] -[lib] -name = "crossterm" -path = "src/lib.rs" +# [lib] +# name = "crossterm" +# path = "src/lib.rs" -# # Build documentation with all features -> EventStream is available -# [package.metadata.docs.rs] all-features = true -# # Features -# [features] default = ["bracketed-paste", "windows", "events"] windows = ["dep:winapi", "dep:crossterm_winapi"] # Disables winapi dependencies from being included into the binary (SHOULD NOT be disabled on windows). @@ -35,9 +32,7 @@ use-dev-tty = ["filedescriptor"] # Enables raw file descriptor polling / selecti events = ["dep:mio", "dep:signal-hook", "dep:signal-hook-mio"] # Enables reading input/events from the system. serde = ["dep:serde", "bitflags/serde"] # Enables 'serde' for various types. -# # Shared dependencies -# [dependencies] bitflags = {version = "2.3" } parking_lot = "0.12" @@ -46,9 +41,7 @@ parking_lot = "0.12" futures-core = { version = "0.3", optional = true, default-features = false } serde = { version = "1.0", features = ["derive"], optional = true } -# # Windows dependencies -# [target.'cfg(windows)'.dependencies.winapi] version = "0.3.9" features = ["winuser", "winerror"] @@ -57,9 +50,7 @@ optional = true [target.'cfg(windows)'.dependencies] crossterm_winapi = { version = "0.9.1", optional = true } -# # UNIX dependencies -# [target.'cfg(unix)'.dependencies] libc = "0.2" signal-hook = { version = "0.3.17", optional = true } @@ -67,9 +58,7 @@ filedescriptor = { version = "0.8", optional = true } mio = { version = "0.8", features = ["os-poll"], optional = true } signal-hook-mio = { version = "0.2.3", features = ["support-v0_8"], optional = true } -# # Dev dependencies (examples, ...) -# [dev-dependencies] tokio = { version = "1.25", features = ["full"] } futures = "0.3" @@ -78,9 +67,7 @@ async-std = "1.12" serde_json = "1.0" serial_test = "2.0.0" -# # Examples -# [[example]] name = "event-read" required-features = ["bracketed-paste", "events"] diff --git a/keyfork-crossterm/README.md b/keyfork-crossterm/README.md index b9f83f7..80e69e5 100644 --- a/keyfork-crossterm/README.md +++ b/keyfork-crossterm/README.md @@ -1,213 +1 @@ -

- -[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Z8QK6XU749JB2) ![Travis][s7] [![Latest Version][s1]][l1] [![MIT][s2]][l2] [![docs][s3]][l3] ![Lines of Code][s6] [![Join us on Discord][s5]][l5] - -# Cross-platform Terminal Manipulation Library - -Crossterm is a pure-rust, terminal manipulation library that makes it possible to write cross-platform text-based interfaces (see [features](#features)). It supports all UNIX and Windows terminals down to Windows 7 (not all terminals are tested, -see [Tested Terminals](#tested-terminals) for more info). - -## Table of Contents - -- [Cross-platform Terminal Manipulation Library](#cross-platform-terminal-manipulation-library) - - [Table of Contents](#table-of-contents) - - [Features](#features) - - [Tested Terminals](#tested-terminals) - - [Getting Started](#getting-started) - - [Feature Flags](#feature-flags) - - [Dependency Justification](#dependency-justification) - - [Other Resources](#other-resources) - - [Used By](#used-by) - - [Contributing](#contributing) - - [Authors](#authors) - - [License](#license) - -## Features - -- Cross-platform -- Multi-threaded (send, sync) -- Detailed documentation -- Few dependencies -- Full control over writing and flushing output buffer -- Is tty -- Cursor - - Move the cursor N times (up, down, left, right) - - Move to previous / next line - - Move to column - - Set/get the cursor position - - Store the cursor position and restore to it later - - Hide/show the cursor - - Enable/disable cursor blinking (not all terminals do support this feature) -- Styled output - - Foreground color (16 base colors) - - Background color (16 base colors) - - 256 (ANSI) color support (Windows 10 and UNIX only) - - RGB color support (Windows 10 and UNIX only) - - Text attributes like bold, italic, underscore, crossed, etc -- Terminal - - Clear (all lines, current line, from cursor down and up, until new line) - - Scroll up, down - - Set/get the terminal size - - Exit current process - - Alternate screen - - Raw screen - - Set terminal title - - Enable/disable line wrapping -- Event - - Input Events - - Mouse Events (press, release, position, button, drag) - - Terminal Resize Events - - Advanced modifier (SHIFT | ALT | CTRL) support for both mouse and key events and - - futures Stream (feature 'event-stream') - - Poll/read API - - - -### Tested Terminals - -- Console Host - - Windows 10 (Pro) - - Windows 8.1 (N) -- Ubuntu Desktop Terminal - - Ubuntu 17.10 - - Pop!_OS ( Ubuntu ) 20.04 -- (Arch, Manjaro) KDE Konsole -- (Arch, NixOS) Kitty -- Linux Mint -- (OpenSuse) Alacritty -- (Chrome OS) Crostini -- Apple - - macOS Monterey 12.7.1 (Intel-Chip) - -This crate supports all UNIX terminals and Windows terminals down to Windows 7; however, not all of the -terminals have been tested. If you have used this library for a terminal other than the above list without -issues, then feel free to add it to the above list - I really would appreciate it! - -## Getting Started -_see the [examples directory](examples/) and [documentation](https://docs.rs/crossterm/) for more advanced examples._ - -
- -Click to show Cargo.toml. - - -```toml -[dependencies] -crossterm = "0.27" -``` - -
-

- -```rust -use std::io::{stdout, Write}; - -use crossterm::{ - execute, - style::{Color, Print, ResetColor, SetBackgroundColor, SetForegroundColor}, - ExecutableCommand, Result, - event, -}; - -fn main() -> std::io::Result<()> { - // using the macro - execute!( - stdout(), - SetForegroundColor(Color::Blue), - SetBackgroundColor(Color::Red), - Print("Styled text here."), - ResetColor - )?; - - // or using functions - stdout() - .execute(SetForegroundColor(Color::Blue))? - .execute(SetBackgroundColor(Color::Red))? - .execute(Print("Styled text here."))? - .execute(ResetColor)?; - - Ok(()) -} -``` - -Checkout this [list](https://docs.rs/crossterm/latest/crossterm/index.html#supported-commands) with all possible commands. - -### Feature Flags - -```toml -[dependencies.crossterm] -version = "0.27" -features = ["event-stream"] -``` - -| Feature | Description | -|:---------------|:---------------------------------------------| -| `event-stream` | `futures::Stream` producing `Result`. | -| `serde` | (De)serializing of events. | -| `events` | Reading input/system events (enabled by default) | -| `filedescriptor` | Use raw filedescriptor for all events rather then mio dependency | - - -To use crossterm as a very thin layer you can disable the `events` feature or use `filedescriptor` feature. -This can disable `mio` / `signal-hook` / `signal-hook-mio` dependencies. - -### Dependency Justification - -| Dependency | Used for | Included | -|:---------------|:---------------------------------------------------------------------------------|:--------------------------------------| -| `bitflags` | `KeyModifiers`, those are differ based on input. | always | -| `parking_lot` | locking `RwLock`s with a timeout, const mutexes. | always | -| `libc` | UNIX terminal_size/raw modes/set_title and several other low level functionality. | optional (`events` feature), UNIX only | -| `Mio` | event readiness polling, waking up poller | optional (`events` feature), UNIX only | -| `signal-hook` | signal-hook is used to handle terminal resize SIGNAL with Mio. | optional (`events` feature),UNIX only | -| `winapi` | Used for low-level windows system calls which ANSI codes can't replace | windows only | -| `futures-core` | For async stream of events | only with `event-stream` feature flag | -| `serde` | ***ser***ializing and ***de***serializing of events | only with `serde` feature flag | - -### Other Resources - -- [API documentation](https://docs.rs/crossterm/) -- [Deprecated examples repository](https://github.com/crossterm-rs/examples) - -## Used By - -- [Broot](https://dystroy.org/broot/) -- [Cursive](https://github.com/gyscos/Cursive) -- [TUI](https://github.com/fdehau/tui-rs) -- [Rust-sloth](https://github.com/ecumene/rust-sloth) -- [Rusty-rain](https://github.com/cowboy8625/rusty-rain) - -## Contributing - -We highly appreciate when anyone contributes to this crate. Before you do, please, -read the [Contributing](docs/CONTRIBUTING.md) guidelines. - -## Authors - -* **Timon Post** - *Project Owner & creator* - -## License - -This project, `crossterm` and all its sub-crates: `crossterm_screen`, `crossterm_cursor`, `crossterm_style`, -`crossterm_input`, `crossterm_terminal`, `crossterm_winapi`, `crossterm_utils` are licensed under the MIT -License - see the [LICENSE](https://github.com/crossterm-rs/crossterm/blob/master/LICENSE) file for details. - -[s1]: https://img.shields.io/crates/v/crossterm.svg -[l1]: https://crates.io/crates/crossterm - -[s2]: https://img.shields.io/badge/license-MIT-blue.svg -[l2]: ./LICENSE - -[s3]: https://docs.rs/crossterm/badge.svg -[l3]: https://docs.rs/crossterm/ - -[s3]: https://docs.rs/crossterm/badge.svg -[l3]: https://docs.rs/crossterm/ - -[s5]: https://img.shields.io/discord/560857607196377088.svg?logo=discord -[l5]: https://discord.gg/K4nyTDB - -[s6]: https://tokei.rs/b1/github/crossterm-rs/crossterm?category=code -[s7]: https://travis-ci.org/crossterm-rs/crossterm.svg?branch=master +Forked from https://github.com/crossterm-rs/crossterm diff --git a/keyfork-crossterm/README.md.old b/keyfork-crossterm/README.md.old new file mode 100644 index 0000000..b9f83f7 --- /dev/null +++ b/keyfork-crossterm/README.md.old @@ -0,0 +1,213 @@ +

+ +[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Z8QK6XU749JB2) ![Travis][s7] [![Latest Version][s1]][l1] [![MIT][s2]][l2] [![docs][s3]][l3] ![Lines of Code][s6] [![Join us on Discord][s5]][l5] + +# Cross-platform Terminal Manipulation Library + +Crossterm is a pure-rust, terminal manipulation library that makes it possible to write cross-platform text-based interfaces (see [features](#features)). It supports all UNIX and Windows terminals down to Windows 7 (not all terminals are tested, +see [Tested Terminals](#tested-terminals) for more info). + +## Table of Contents + +- [Cross-platform Terminal Manipulation Library](#cross-platform-terminal-manipulation-library) + - [Table of Contents](#table-of-contents) + - [Features](#features) + - [Tested Terminals](#tested-terminals) + - [Getting Started](#getting-started) + - [Feature Flags](#feature-flags) + - [Dependency Justification](#dependency-justification) + - [Other Resources](#other-resources) + - [Used By](#used-by) + - [Contributing](#contributing) + - [Authors](#authors) + - [License](#license) + +## Features + +- Cross-platform +- Multi-threaded (send, sync) +- Detailed documentation +- Few dependencies +- Full control over writing and flushing output buffer +- Is tty +- Cursor + - Move the cursor N times (up, down, left, right) + - Move to previous / next line + - Move to column + - Set/get the cursor position + - Store the cursor position and restore to it later + - Hide/show the cursor + - Enable/disable cursor blinking (not all terminals do support this feature) +- Styled output + - Foreground color (16 base colors) + - Background color (16 base colors) + - 256 (ANSI) color support (Windows 10 and UNIX only) + - RGB color support (Windows 10 and UNIX only) + - Text attributes like bold, italic, underscore, crossed, etc +- Terminal + - Clear (all lines, current line, from cursor down and up, until new line) + - Scroll up, down + - Set/get the terminal size + - Exit current process + - Alternate screen + - Raw screen + - Set terminal title + - Enable/disable line wrapping +- Event + - Input Events + - Mouse Events (press, release, position, button, drag) + - Terminal Resize Events + - Advanced modifier (SHIFT | ALT | CTRL) support for both mouse and key events and + - futures Stream (feature 'event-stream') + - Poll/read API + + + +### Tested Terminals + +- Console Host + - Windows 10 (Pro) + - Windows 8.1 (N) +- Ubuntu Desktop Terminal + - Ubuntu 17.10 + - Pop!_OS ( Ubuntu ) 20.04 +- (Arch, Manjaro) KDE Konsole +- (Arch, NixOS) Kitty +- Linux Mint +- (OpenSuse) Alacritty +- (Chrome OS) Crostini +- Apple + - macOS Monterey 12.7.1 (Intel-Chip) + +This crate supports all UNIX terminals and Windows terminals down to Windows 7; however, not all of the +terminals have been tested. If you have used this library for a terminal other than the above list without +issues, then feel free to add it to the above list - I really would appreciate it! + +## Getting Started +_see the [examples directory](examples/) and [documentation](https://docs.rs/crossterm/) for more advanced examples._ + +
+ +Click to show Cargo.toml. + + +```toml +[dependencies] +crossterm = "0.27" +``` + +
+

+ +```rust +use std::io::{stdout, Write}; + +use crossterm::{ + execute, + style::{Color, Print, ResetColor, SetBackgroundColor, SetForegroundColor}, + ExecutableCommand, Result, + event, +}; + +fn main() -> std::io::Result<()> { + // using the macro + execute!( + stdout(), + SetForegroundColor(Color::Blue), + SetBackgroundColor(Color::Red), + Print("Styled text here."), + ResetColor + )?; + + // or using functions + stdout() + .execute(SetForegroundColor(Color::Blue))? + .execute(SetBackgroundColor(Color::Red))? + .execute(Print("Styled text here."))? + .execute(ResetColor)?; + + Ok(()) +} +``` + +Checkout this [list](https://docs.rs/crossterm/latest/crossterm/index.html#supported-commands) with all possible commands. + +### Feature Flags + +```toml +[dependencies.crossterm] +version = "0.27" +features = ["event-stream"] +``` + +| Feature | Description | +|:---------------|:---------------------------------------------| +| `event-stream` | `futures::Stream` producing `Result`. | +| `serde` | (De)serializing of events. | +| `events` | Reading input/system events (enabled by default) | +| `filedescriptor` | Use raw filedescriptor for all events rather then mio dependency | + + +To use crossterm as a very thin layer you can disable the `events` feature or use `filedescriptor` feature. +This can disable `mio` / `signal-hook` / `signal-hook-mio` dependencies. + +### Dependency Justification + +| Dependency | Used for | Included | +|:---------------|:---------------------------------------------------------------------------------|:--------------------------------------| +| `bitflags` | `KeyModifiers`, those are differ based on input. | always | +| `parking_lot` | locking `RwLock`s with a timeout, const mutexes. | always | +| `libc` | UNIX terminal_size/raw modes/set_title and several other low level functionality. | optional (`events` feature), UNIX only | +| `Mio` | event readiness polling, waking up poller | optional (`events` feature), UNIX only | +| `signal-hook` | signal-hook is used to handle terminal resize SIGNAL with Mio. | optional (`events` feature),UNIX only | +| `winapi` | Used for low-level windows system calls which ANSI codes can't replace | windows only | +| `futures-core` | For async stream of events | only with `event-stream` feature flag | +| `serde` | ***ser***ializing and ***de***serializing of events | only with `serde` feature flag | + +### Other Resources + +- [API documentation](https://docs.rs/crossterm/) +- [Deprecated examples repository](https://github.com/crossterm-rs/examples) + +## Used By + +- [Broot](https://dystroy.org/broot/) +- [Cursive](https://github.com/gyscos/Cursive) +- [TUI](https://github.com/fdehau/tui-rs) +- [Rust-sloth](https://github.com/ecumene/rust-sloth) +- [Rusty-rain](https://github.com/cowboy8625/rusty-rain) + +## Contributing + +We highly appreciate when anyone contributes to this crate. Before you do, please, +read the [Contributing](docs/CONTRIBUTING.md) guidelines. + +## Authors + +* **Timon Post** - *Project Owner & creator* + +## License + +This project, `crossterm` and all its sub-crates: `crossterm_screen`, `crossterm_cursor`, `crossterm_style`, +`crossterm_input`, `crossterm_terminal`, `crossterm_winapi`, `crossterm_utils` are licensed under the MIT +License - see the [LICENSE](https://github.com/crossterm-rs/crossterm/blob/master/LICENSE) file for details. + +[s1]: https://img.shields.io/crates/v/crossterm.svg +[l1]: https://crates.io/crates/crossterm + +[s2]: https://img.shields.io/badge/license-MIT-blue.svg +[l2]: ./LICENSE + +[s3]: https://docs.rs/crossterm/badge.svg +[l3]: https://docs.rs/crossterm/ + +[s3]: https://docs.rs/crossterm/badge.svg +[l3]: https://docs.rs/crossterm/ + +[s5]: https://img.shields.io/discord/560857607196377088.svg?logo=discord +[l5]: https://discord.gg/K4nyTDB + +[s6]: https://tokei.rs/b1/github/crossterm-rs/crossterm?category=code +[s7]: https://travis-ci.org/crossterm-rs/crossterm.svg?branch=master diff --git a/keyfork-crossterm/examples/event-match-modifiers.rs b/keyfork-crossterm/examples/event-match-modifiers.rs index c3f75e9..5cb54c7 100644 --- a/keyfork-crossterm/examples/event-match-modifiers.rs +++ b/keyfork-crossterm/examples/event-match-modifiers.rs @@ -2,7 +2,7 @@ //! //! cargo run --example event-match-modifiers -use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers}; +use keyfork_crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers}; fn match_event(read_event: Event) { match read_event { diff --git a/keyfork-crossterm/examples/event-poll-read.rs b/keyfork-crossterm/examples/event-poll-read.rs index df960ab..33e0fc2 100644 --- a/keyfork-crossterm/examples/event-poll-read.rs +++ b/keyfork-crossterm/examples/event-poll-read.rs @@ -4,7 +4,7 @@ use std::{io, time::Duration}; -use crossterm::{ +use keyfork_crossterm::{ cursor::position, event::{poll, read, DisableMouseCapture, EnableMouseCapture, Event, KeyCode}, execute, diff --git a/keyfork-crossterm/examples/event-read-char-line.rs b/keyfork-crossterm/examples/event-read-char-line.rs index 5fa8349..c5ca567 100644 --- a/keyfork-crossterm/examples/event-read-char-line.rs +++ b/keyfork-crossterm/examples/event-read-char-line.rs @@ -5,7 +5,7 @@ use std::io; -use crossterm::event::{self, Event, KeyCode, KeyEvent}; +use keyfork_crossterm::event::{self, Event, KeyCode, KeyEvent}; pub fn read_char() -> io::Result { loop { diff --git a/keyfork-crossterm/examples/event-read.rs b/keyfork-crossterm/examples/event-read.rs index 633d158..8048e82 100644 --- a/keyfork-crossterm/examples/event-read.rs +++ b/keyfork-crossterm/examples/event-read.rs @@ -4,10 +4,10 @@ use std::io; -use crossterm::event::{ +use keyfork_crossterm::event::{ poll, KeyboardEnhancementFlags, PopKeyboardEnhancementFlags, PushKeyboardEnhancementFlags, }; -use crossterm::{ +use keyfork_crossterm::{ cursor::position, event::{ read, DisableBracketedPaste, DisableFocusChange, DisableMouseCapture, EnableBracketedPaste, @@ -70,7 +70,7 @@ fn main() -> io::Result<()> { let mut stdout = io::stdout(); let supports_keyboard_enhancement = matches!( - crossterm::terminal::supports_keyboard_enhancement(), + keyfork_crossterm::terminal::supports_keyboard_enhancement(), Ok(true) ); diff --git a/keyfork-crossterm/examples/event-stream-async-std.rs b/keyfork-crossterm/examples/event-stream-async-std.rs index abd5449..fbf1946 100644 --- a/keyfork-crossterm/examples/event-stream-async-std.rs +++ b/keyfork-crossterm/examples/event-stream-async-std.rs @@ -7,7 +7,7 @@ use std::{io::stdout, time::Duration}; use futures::{future::FutureExt, select, StreamExt}; use futures_timer::Delay; -use crossterm::{ +use keyfork_crossterm::{ cursor::position, event::{DisableMouseCapture, EnableMouseCapture, Event, EventStream, KeyCode}, execute, diff --git a/keyfork-crossterm/examples/event-stream-tokio.rs b/keyfork-crossterm/examples/event-stream-tokio.rs index 6cea39c..eff2dbe 100644 --- a/keyfork-crossterm/examples/event-stream-tokio.rs +++ b/keyfork-crossterm/examples/event-stream-tokio.rs @@ -7,7 +7,7 @@ use std::{io::stdout, time::Duration}; use futures::{future::FutureExt, select, StreamExt}; use futures_timer::Delay; -use crossterm::{ +use keyfork_crossterm::{ cursor::position, event::{DisableMouseCapture, EnableMouseCapture, Event, EventStream, KeyCode}, execute, diff --git a/keyfork-crossterm/examples/interactive-demo/src/macros.rs b/keyfork-crossterm/examples/interactive-demo/src/macros.rs index 02ce9e2..3c1a970 100644 --- a/keyfork-crossterm/examples/interactive-demo/src/macros.rs +++ b/keyfork-crossterm/examples/interactive-demo/src/macros.rs @@ -6,7 +6,7 @@ macro_rules! run_tests { ),* $(,)? ) => { - use crossterm::{queue, style, terminal, cursor}; + use keyfork_crossterm::{queue, style, terminal, cursor}; $( queue!( $dst, diff --git a/keyfork-crossterm/examples/interactive-demo/src/main.rs b/keyfork-crossterm/examples/interactive-demo/src/main.rs index 5eb1c73..7fb8f1f 100644 --- a/keyfork-crossterm/examples/interactive-demo/src/main.rs +++ b/keyfork-crossterm/examples/interactive-demo/src/main.rs @@ -2,8 +2,8 @@ use std::io; -use crossterm::event::KeyEventKind; -pub use crossterm::{ +use keyfork_crossterm::event::KeyEventKind; +pub use keyfork_crossterm::{ cursor, event::{self, Event, KeyCode, KeyEvent}, execute, queue, style, diff --git a/keyfork-crossterm/examples/interactive-demo/src/test/attribute.rs b/keyfork-crossterm/examples/interactive-demo/src/test/attribute.rs index 6c06752..8172466 100644 --- a/keyfork-crossterm/examples/interactive-demo/src/test/attribute.rs +++ b/keyfork-crossterm/examples/interactive-demo/src/test/attribute.rs @@ -1,6 +1,6 @@ #![allow(clippy::cognitive_complexity)] -use crossterm::{cursor, queue, style}; +use keyfork_crossterm::{cursor, queue, style}; use std::io::Write; const ATTRIBUTES: [(style::Attribute, style::Attribute); 10] = [ diff --git a/keyfork-crossterm/examples/interactive-demo/src/test/color.rs b/keyfork-crossterm/examples/interactive-demo/src/test/color.rs index d34ac45..d851958 100644 --- a/keyfork-crossterm/examples/interactive-demo/src/test/color.rs +++ b/keyfork-crossterm/examples/interactive-demo/src/test/color.rs @@ -1,6 +1,6 @@ #![allow(clippy::cognitive_complexity)] -use crossterm::{cursor, queue, style, style::Color}; +use keyfork_crossterm::{cursor, queue, style, style::Color}; use std::io::Write; const COLORS: [Color; 21] = [ diff --git a/keyfork-crossterm/examples/interactive-demo/src/test/cursor.rs b/keyfork-crossterm/examples/interactive-demo/src/test/cursor.rs index 9ad10d5..2adedff 100644 --- a/keyfork-crossterm/examples/interactive-demo/src/test/cursor.rs +++ b/keyfork-crossterm/examples/interactive-demo/src/test/cursor.rs @@ -2,7 +2,7 @@ use std::io::Write; -use crossterm::{cursor, execute, queue, style, style::Stylize, Command}; +use keyfork_crossterm::{cursor, execute, queue, style, style::Stylize, Command}; use std::thread; use std::time::Duration; diff --git a/keyfork-crossterm/examples/interactive-demo/src/test/event.rs b/keyfork-crossterm/examples/interactive-demo/src/test/event.rs index 50a797e..b0b0b35 100644 --- a/keyfork-crossterm/examples/interactive-demo/src/test/event.rs +++ b/keyfork-crossterm/examples/interactive-demo/src/test/event.rs @@ -1,6 +1,6 @@ #![allow(clippy::cognitive_complexity)] -use crossterm::{ +use keyfork_crossterm::{ cursor::position, event::{read, DisableMouseCapture, EnableMouseCapture, Event, KeyCode}, execute, diff --git a/keyfork-crossterm/examples/interactive-demo/src/test/synchronized_output.rs b/keyfork-crossterm/examples/interactive-demo/src/test/synchronized_output.rs index 4fba674..cfda19d 100644 --- a/keyfork-crossterm/examples/interactive-demo/src/test/synchronized_output.rs +++ b/keyfork-crossterm/examples/interactive-demo/src/test/synchronized_output.rs @@ -1,6 +1,6 @@ use std::io::Write; -use crossterm::{cursor, execute, style::Print, SynchronizedUpdate}; +use keyfork_crossterm::{cursor, execute, style::Print, SynchronizedUpdate}; fn render_slowly(w: &mut W) -> std::io::Result<()> where diff --git a/keyfork-crossterm/examples/is_tty.rs b/keyfork-crossterm/examples/is_tty.rs index 85770e2..18eea90 100644 --- a/keyfork-crossterm/examples/is_tty.rs +++ b/keyfork-crossterm/examples/is_tty.rs @@ -1,4 +1,4 @@ -use crossterm::{ +use keyfork_crossterm::{ execute, terminal::{size, SetSize}, tty::IsTty, diff --git a/keyfork-crossterm/examples/stderr.rs b/keyfork-crossterm/examples/stderr.rs index ce523c6..b0183a1 100644 --- a/keyfork-crossterm/examples/stderr.rs +++ b/keyfork-crossterm/examples/stderr.rs @@ -10,7 +10,7 @@ use std::io; -use crossterm::{ +use keyfork_crossterm::{ cursor::{Hide, MoveTo, Show}, event, event::{Event, KeyCode, KeyEvent}, diff --git a/keyfork-crossterm/src/command.rs b/keyfork-crossterm/src/command.rs index 11f83f7..0425392 100644 --- a/keyfork-crossterm/src/command.rs +++ b/keyfork-crossterm/src/command.rs @@ -85,7 +85,7 @@ impl QueueableCommand for T { /// /// ```rust /// use std::io::{self, Write}; - /// use crossterm::{QueueableCommand, style::Print}; + /// use keyfork_crossterm::{QueueableCommand, style::Print}; /// /// fn main() -> io::Result<()> { /// let mut stdout = io::stdout(); @@ -149,7 +149,7 @@ impl ExecutableCommand for T { /// /// ```rust /// use std::io; - /// use crossterm::{ExecutableCommand, style::Print}; + /// use keyfork_crossterm::{ExecutableCommand, style::Print}; /// /// fn main() -> io::Result<()> { /// // will be executed directly @@ -204,7 +204,7 @@ impl SynchronizedUpdate for W { /// /// ```rust /// use std::io; - /// use crossterm::{ExecutableCommand, SynchronizedUpdate, style::Print}; + /// use keyfork_crossterm::{ExecutableCommand, SynchronizedUpdate, style::Print}; /// /// fn main() -> io::Result<()> { /// let mut stdout = io::stdout(); diff --git a/keyfork-crossterm/src/cursor.rs b/keyfork-crossterm/src/cursor.rs index 24c4fdd..d797127 100644 --- a/keyfork-crossterm/src/cursor.rs +++ b/keyfork-crossterm/src/cursor.rs @@ -15,7 +15,7 @@ //! ```no_run //! use std::io::{self, Write}; //! -//! use crossterm::{ +//! use keyfork_crossterm::{ //! ExecutableCommand, execute, //! cursor::{DisableBlinking, EnableBlinking, MoveTo, RestorePosition, SavePosition} //! }; diff --git a/keyfork-crossterm/src/event.rs b/keyfork-crossterm/src/event.rs index 3464467..f889cbf 100644 --- a/keyfork-crossterm/src/event.rs +++ b/keyfork-crossterm/src/event.rs @@ -28,7 +28,7 @@ //! Blocking read: //! //! ```no_run -//! use crossterm::event::{read, Event}; +//! use keyfork_crossterm::event::{read, Event}; //! //! fn print_events() -> std::io::Result<()> { //! loop { @@ -52,7 +52,7 @@ //! ```no_run //! use std::{time::Duration, io}; //! -//! use crossterm::event::{poll, read, Event}; +//! use keyfork_crossterm::event::{poll, read, Event}; //! //! fn print_events() -> io::Result<()> { //! loop { @@ -139,7 +139,7 @@ fn try_lock_internal_event_reader_for( /// /// ```no_run /// use std::{time::Duration, io}; -/// use crossterm::{event::poll}; +/// use keyfork_crossterm::{event::poll}; /// /// fn is_event_available() -> io::Result { /// // Zero duration says that the `poll` function must return immediately @@ -153,7 +153,7 @@ fn try_lock_internal_event_reader_for( /// ```no_run /// use std::{time::Duration, io}; /// -/// use crossterm::event::poll; +/// use keyfork_crossterm::event::poll; /// /// fn is_event_available() -> io::Result { /// // Wait for an `Event` availability for 100ms. It returns immediately @@ -175,7 +175,7 @@ pub fn poll(timeout: Duration) -> std::io::Result { /// Blocking read: /// /// ```no_run -/// use crossterm::event::read; +/// use keyfork_crossterm::event::read; /// use std::io; /// /// fn print_events() -> io::Result { @@ -192,7 +192,7 @@ pub fn poll(timeout: Duration) -> std::io::Result { /// use std::time::Duration; /// use std::io; /// -/// use crossterm::event::{read, poll}; +/// use keyfork_crossterm::event::{read, poll}; /// /// fn print_events() -> io::Result { /// loop { @@ -419,8 +419,8 @@ impl Command for DisableBracketedPaste { /// Example usage: /// ```no_run /// use std::io::{Write, stdout}; -/// use crossterm::execute; -/// use crossterm::event::{ +/// use keyfork_crossterm::execute; +/// use keyfork_crossterm::event::{ /// KeyboardEnhancementFlags, /// PushKeyboardEnhancementFlags, /// PopKeyboardEnhancementFlags diff --git a/keyfork-crossterm/src/lib.rs b/keyfork-crossterm/src/lib.rs index 0217bef..52f6d00 100644 --- a/keyfork-crossterm/src/lib.rs +++ b/keyfork-crossterm/src/lib.rs @@ -95,7 +95,7 @@ //! //! ```no_run //! use std::io::{Write, stdout}; -//! use crossterm::{QueueableCommand, cursor}; +//! use keyfork_crossterm::{QueueableCommand, cursor}; //! //! let mut stdout = stdout(); //! stdout.queue(cursor::MoveTo(5,5)); @@ -112,7 +112,7 @@ //! //! ```no_run //! use std::io::{Write, stdout}; -//! use crossterm::{queue, QueueableCommand, cursor}; +//! use keyfork_crossterm::{queue, QueueableCommand, cursor}; //! //! let mut stdout = stdout(); //! queue!(stdout, cursor::MoveTo(5, 5)); @@ -143,7 +143,7 @@ //! //! ```no_run //! use std::io::{Write, stdout}; -//! use crossterm::{ExecutableCommand, cursor}; +//! use keyfork_crossterm::{ExecutableCommand, cursor}; //! //! let mut stdout = stdout(); //! stdout.execute(cursor::MoveTo(5,5)); @@ -155,7 +155,7 @@ //! //! ```no_run //! use std::io::{stdout, Write}; -//! use crossterm::{execute, ExecutableCommand, cursor}; +//! use keyfork_crossterm::{execute, ExecutableCommand, cursor}; //! //! let mut stdout = stdout(); //! execute!(stdout, cursor::MoveTo(5, 5)); @@ -172,7 +172,7 @@ //! //! ```no_run //! use std::io::{self, Write}; -//! use crossterm::{ +//! use keyfork_crossterm::{ //! ExecutableCommand, QueueableCommand, //! terminal, cursor, style::{self, Stylize} //! }; @@ -201,7 +201,7 @@ //! //! ```no_run //! use std::io::{self, Write}; -//! use crossterm::{ +//! use keyfork_crossterm::{ //! execute, queue, //! style::{self, Stylize}, cursor, terminal //! }; diff --git a/keyfork-crossterm/src/macros.rs b/keyfork-crossterm/src/macros.rs index 9261c42..ff9d7d7 100644 --- a/keyfork-crossterm/src/macros.rs +++ b/keyfork-crossterm/src/macros.rs @@ -28,7 +28,7 @@ macro_rules! csi { /// /// ```rust /// use std::io::{Write, stdout}; -/// use crossterm::{queue, style::Print}; +/// use keyfork_crossterm::{queue, style::Print}; /// /// let mut stdout = stdout(); /// @@ -82,7 +82,7 @@ macro_rules! queue { /// /// ```rust /// use std::io::{Write, stdout}; -/// use crossterm::{execute, style::Print}; +/// use keyfork_crossterm::{execute, style::Print}; /// /// // will be executed directly /// execute!(stdout(), Print("sum:\n".to_string())); diff --git a/keyfork-crossterm/src/style.rs b/keyfork-crossterm/src/style.rs index 72c2281..c11eb68 100644 --- a/keyfork-crossterm/src/style.rs +++ b/keyfork-crossterm/src/style.rs @@ -29,8 +29,8 @@ //! //! ```no_run //! use std::io::{self, Write}; -//! use crossterm::execute; -//! use crossterm::style::{Print, SetForegroundColor, SetBackgroundColor, ResetColor, Color, Attribute}; +//! use keyfork_crossterm::execute; +//! use keyfork_crossterm::style::{Print, SetForegroundColor, SetBackgroundColor, ResetColor, Color, Attribute}; //! //! fn main() -> io::Result<()> { //! execute!( @@ -53,7 +53,7 @@ //! it. //! //! ```no_run -//! use crossterm::style::Stylize; +//! use keyfork_crossterm::style::Stylize; //! //! println!("{}", "Red foreground color & blue background.".red().on_blue()); //! ``` @@ -69,8 +69,8 @@ //! ```no_run //! use std::io::{self, Write}; //! -//! use crossterm::execute; -//! use crossterm::style::{Attribute, Print, SetAttribute}; +//! use keyfork_crossterm::execute; +//! use keyfork_crossterm::style::{Attribute, Print, SetAttribute}; //! //! fn main() -> io::Result<()> { //! execute!( @@ -90,7 +90,7 @@ //! attributes to it. //! //! ```no_run -//! use crossterm::style::Stylize; +//! use keyfork_crossterm::style::Stylize; //! //! println!("{}", "Bold".bold()); //! println!("{}", "Underlined".underlined()); @@ -102,7 +102,7 @@ //! [`Attribute`](enum.Attribute.html) implements [Display](https://doc.rust-lang.org/beta/std/fmt/trait.Display.html) and therefore it can be formatted like: //! //! ```no_run -//! use crossterm::style::Attribute; +//! use keyfork_crossterm::style::Attribute; //! //! println!( //! "{} Underlined {} No Underline", @@ -143,7 +143,7 @@ mod types; /// # Examples /// /// ```no_run -/// use crossterm::style::{style, Stylize, Color}; +/// use keyfork_crossterm::style::{style, Stylize, Color}; /// /// let styled_content = style("Blue colored text on yellow background") /// .with(Color::Blue) @@ -259,8 +259,8 @@ impl Command for SetUnderlineColor { /// ```no_run /// use std::io::{stdout, Write}; /// -/// use crossterm::execute; -/// use crossterm::style::{Color::{Green, Black}, Colors, Print, SetColors}; +/// use keyfork_crossterm::execute; +/// use keyfork_crossterm::style::{Color::{Green, Black}, Colors, Print, SetColors}; /// /// execute!( /// stdout(), diff --git a/keyfork-crossterm/src/style/styled_content.rs b/keyfork-crossterm/src/style/styled_content.rs index 39ebe0d..2c38b7e 100644 --- a/keyfork-crossterm/src/style/styled_content.rs +++ b/keyfork-crossterm/src/style/styled_content.rs @@ -9,7 +9,7 @@ use super::{ContentStyle, PrintStyledContent}; /// # Examples /// /// ```rust -/// use crossterm::style::{style, Color, Attribute, Stylize}; +/// use keyfork_crossterm::style::{style, Color, Attribute, Stylize}; /// /// let styled = "Hello there" /// .with(Color::Yellow) diff --git a/keyfork-crossterm/src/style/stylize.rs b/keyfork-crossterm/src/style/stylize.rs index fcb12da..0b51771 100644 --- a/keyfork-crossterm/src/style/stylize.rs +++ b/keyfork-crossterm/src/style/stylize.rs @@ -60,7 +60,7 @@ macro_rules! stylize_method { /// # Examples /// /// ```no_run -/// use crossterm::style::Stylize; +/// use keyfork_crossterm::style::Stylize; /// /// println!("{}", "Bold text".bold()); /// println!("{}", "Underlined text".underlined()); diff --git a/keyfork-crossterm/src/style/types/attribute.rs b/keyfork-crossterm/src/style/types/attribute.rs index 8b7d52c..0802b2f 100644 --- a/keyfork-crossterm/src/style/types/attribute.rs +++ b/keyfork-crossterm/src/style/types/attribute.rs @@ -47,7 +47,7 @@ macro_rules! Attribute { /// Basic usage: /// /// ```no_run - /// use crossterm::style::Attribute; + /// use keyfork_crossterm::style::Attribute; /// /// println!( /// "{} Underlined {} No Underline", @@ -59,7 +59,7 @@ macro_rules! Attribute { /// Style existing text: /// /// ```no_run - /// use crossterm::style::Stylize; + /// use keyfork_crossterm::style::Stylize; /// /// println!("{}", "Bold text".bold()); /// println!("{}", "Underlined text".underlined()); diff --git a/keyfork-crossterm/src/style/types/color.rs b/keyfork-crossterm/src/style/types/color.rs index b73c837..0ff27b4 100644 --- a/keyfork-crossterm/src/style/types/color.rs +++ b/keyfork-crossterm/src/style/types/color.rs @@ -99,7 +99,7 @@ impl Color { /// # Examples /// /// ``` - /// use crossterm::style::Color; + /// use keyfork_crossterm::style::Color; /// /// assert_eq!(Color::parse_ansi("5;0"), Some(Color::Black)); /// assert_eq!(Color::parse_ansi("5;26"), Some(Color::AnsiValue(26))); diff --git a/keyfork-crossterm/src/style/types/colored.rs b/keyfork-crossterm/src/style/types/colored.rs index 85f921b..57fcfd9 100644 --- a/keyfork-crossterm/src/style/types/colored.rs +++ b/keyfork-crossterm/src/style/types/colored.rs @@ -34,7 +34,7 @@ impl Colored { /// # Examples /// /// ``` - /// use crossterm::style::{Colored::{self, ForegroundColor, BackgroundColor}, Color}; + /// use keyfork_crossterm::style::{Colored::{self, ForegroundColor, BackgroundColor}, Color}; /// /// assert_eq!(Colored::parse_ansi("38;5;0"), Some(ForegroundColor(Color::Black))); /// assert_eq!(Colored::parse_ansi("38;5;26"), Some(ForegroundColor(Color::AnsiValue(26)))); diff --git a/keyfork-crossterm/src/style/types/colors.rs b/keyfork-crossterm/src/style/types/colors.rs index 0b4afbf..72ef952 100644 --- a/keyfork-crossterm/src/style/types/colors.rs +++ b/keyfork-crossterm/src/style/types/colors.rs @@ -11,7 +11,7 @@ use crate::style::{Color, Colored}; /// /// For example: /// ```no_run -/// use crossterm::style::{Color, Colors, Colored}; +/// use keyfork_crossterm::style::{Color, Colors, Colored}; /// /// // An example color, loaded from a config, file in ANSI format. /// let config_color = "38;2;23;147;209"; diff --git a/keyfork-crossterm/src/terminal.rs b/keyfork-crossterm/src/terminal.rs index e7406be..a367e5d 100644 --- a/keyfork-crossterm/src/terminal.rs +++ b/keyfork-crossterm/src/terminal.rs @@ -64,7 +64,7 @@ //! //! ```no_run //! use std::io::{self, Write}; -//! use crossterm::{execute, terminal::{ScrollUp, SetSize, size}}; +//! use keyfork_crossterm::{execute, terminal::{ScrollUp, SetSize, size}}; //! //! fn main() -> io::Result<()> { //! let (cols, rows) = size()?; @@ -203,7 +203,7 @@ impl Command for EnableLineWrap { /// /// ```no_run /// use std::io::{self, Write}; -/// use crossterm::{execute, terminal::{EnterAlternateScreen, LeaveAlternateScreen}}; +/// use keyfork_crossterm::{execute, terminal::{EnterAlternateScreen, LeaveAlternateScreen}}; /// /// fn main() -> io::Result<()> { /// execute!(io::stdout(), EnterAlternateScreen)?; @@ -241,7 +241,7 @@ impl Command for EnterAlternateScreen { /// /// ```no_run /// use std::io::{self, Write}; -/// use crossterm::{execute, terminal::{EnterAlternateScreen, LeaveAlternateScreen}}; +/// use keyfork_crossterm::{execute, terminal::{EnterAlternateScreen, LeaveAlternateScreen}}; /// /// fn main() -> io::Result<()> { /// execute!(io::stdout(), EnterAlternateScreen)?; @@ -417,7 +417,7 @@ impl Command for SetTitle { /// /// ```no_run /// use std::io::{self, Write}; -/// use crossterm::{execute, terminal::{BeginSynchronizedUpdate, EndSynchronizedUpdate}}; +/// use keyfork_crossterm::{execute, terminal::{BeginSynchronizedUpdate, EndSynchronizedUpdate}}; /// /// fn main() -> io::Result<()> { /// execute!(io::stdout(), BeginSynchronizedUpdate)?; @@ -470,7 +470,7 @@ impl Command for BeginSynchronizedUpdate { /// /// ```no_run /// use std::io::{self, Write}; -/// use crossterm::{execute, terminal::{BeginSynchronizedUpdate, EndSynchronizedUpdate}}; +/// use keyfork_crossterm::{execute, terminal::{BeginSynchronizedUpdate, EndSynchronizedUpdate}}; /// /// fn main() -> io::Result<()> { /// execute!(io::stdout(), BeginSynchronizedUpdate)?; diff --git a/keyfork-crossterm/src/tty.rs b/keyfork-crossterm/src/tty.rs index 78e32aa..d5d05f6 100644 --- a/keyfork-crossterm/src/tty.rs +++ b/keyfork-crossterm/src/tty.rs @@ -15,7 +15,7 @@ use winapi::um::consoleapi::GetConsoleMode; /// /// ```rust /// use std::io::stdout; -/// use crossterm::tty::IsTty; +/// use keyfork_crossterm::tty::IsTty; /// /// let is_tty: bool = stdout().is_tty(); /// ```