diff --git a/Cargo.lock b/Cargo.lock index 2e97599..f2c0f1d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -32,6 +32,19 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" +[[package]] +name = "ansi-to-tui" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67555e1f1ece39d737e28c8a017721287753af3f93225e4a445b29ccb0f5912c" +dependencies = [ + "nom", + "ratatui", + "simdutf8", + "smallvec", + "thiserror", +] + [[package]] name = "anstream" version = "0.6.18" @@ -253,6 +266,7 @@ checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" dependencies = [ "bitflags", "crossterm_winapi", + "futures-core", "mio", "parking_lot", "rustix", @@ -332,13 +346,16 @@ dependencies = [ name = "debug-tui" version = "0.1.0" dependencies = [ + "ansi-to-tui", "anyhow", "base64", "better-panic", "cc", "clap", "crossterm", + "futures", "log", + "ordered_hash_map", "pretty_assertions", "ratatui", "serde", @@ -423,6 +440,95 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + [[package]] name = "fxhash" version = "0.2.1" @@ -566,6 +672,12 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.8.5" @@ -593,6 +705,16 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "object" version = "0.36.7" @@ -608,6 +730,15 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +[[package]] +name = "ordered_hash_map" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6c699f8a30f345785be969deed7eee4c73a5de58c7faf61d6a3251ef798ff61" +dependencies = [ + "hashbrown", +] + [[package]] name = "parking_lot" version = "0.12.3" @@ -695,6 +826,12 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + [[package]] name = "precomputed-hash" version = "0.1.1" @@ -985,6 +1122,12 @@ dependencies = [ "libc", ] +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + [[package]] name = "simple-logging" version = "2.0.2" @@ -1002,6 +1145,12 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" +[[package]] +name = "slab" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" + [[package]] name = "slotmap" version = "1.0.7" @@ -1095,6 +1244,26 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "thread-id" version = "3.3.0" diff --git a/Cargo.toml b/Cargo.toml index 1cc77f8..89b68f4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,12 +6,15 @@ edition = "2021" [build-dependencies] cc="*" [dependencies] +ansi-to-tui = "7.0.0" anyhow = "1.0.97" base64 = "0.22.1" better-panic = "0.3.0" clap = { version = "4.5.35", features = ["derive"] } -crossterm = "0.28.1" +crossterm = { version = "0.28.1", features = ["event-stream"] } +futures = "0.3.31" log = "0.4.27" +ordered_hash_map = "0.5.0" pretty_assertions = "1.4.1" ratatui = "0.29.0" serde = { version = "1.0.219", features = ["derive"] } diff --git a/debug.loh b/debug.loh new file mode 100644 index 0000000..e68b31e --- /dev/null +++ b/debug.loh @@ -0,0 +1,29 @@ +[00:00:00.000] (7ffa3507f440) INFO Handling event Startup +[00:00:00.000] (7ffa2edf66c0) TRACE registering event source with poller: token=Token(140711450119680), interests=READABLE | WRITABLE +[00:00:00.648] (7ffa34dff6c0) TRACE registering event source with poller: token=Token(140712523862528), interests=READABLE | WRITABLE +[00:00:00.648] (7ffa3507f440) INFO Handling event ClientConnected(PollEvented { io: Some(TcpStream { addr: 127.0.0.1:9003, peer: 127.0.0.1:47680, fd: 14 }) }) +[00:00:00.648] (7ffa3507f440) DEBUG [dbgp] << + +[00:00:00.648] (7ffa3507f440) INFO setting feature max_depth to "4" +[00:00:00.648] (7ffa3507f440) DEBUG [dbgp] >> feature_set -i 0 -n max_depth -v 4 +[00:00:00.648] (7ffa3507f440) DEBUG [dbgp] << + +[00:00:00.648] (7ffa3507f440) INFO setting feature extended_properties to "1" +[00:00:00.648] (7ffa3507f440) DEBUG [dbgp] >> feature_set -i 1 -n extended_properties -v 1 +[00:00:00.648] (7ffa3507f440) DEBUG [dbgp] << + +[00:00:00.649] (7ffa3507f440) DEBUG [dbgp] >> source -i 2 -f file:///home/daniel/www/dantleech/debug-tui/php/test.php +[00:00:00.652] (7ffa3507f440) DEBUG [dbgp] << + +[00:00:06.466] (7ffa3507f440) INFO Handling event Input(KeyEvent { code: Char('r'), modifiers: KeyModifiers(0x0), kind: Press, state: KeyEventState(0x0) }) +[00:00:06.478] (7ffa3507f440) INFO Handling event Run +[00:00:06.478] (7ffa34dff6c0) INFO Running iteration 0/1 +[00:00:06.478] (7ffa34dff6c0) DEBUG [dbgp] >> run -i 3 +[00:00:06.478] (7ffa2eff76c0) DEBUG [dbgp] << + +[00:00:06.481] (7ffa3507f440) INFO Handling event UpdateStatus(Stopping) +[00:00:06.484] (7ffa3507f440) INFO Handling event Disconnect +[00:00:06.484] (7ffa3507f440) TRACE deregistering event source from poller +[00:00:06.487] (7ffa3507f440) INFO Handling event ChangeSessionViewMode(History) +[00:00:09.778] (7ffa3507f440) INFO Handling event Quit +[00:00:09.779] (7ffa347fc6c0) TRACE deregistering event source from poller diff --git a/demo/demo.tape b/demo/demo.tape new file mode 100644 index 0000000..9713a85 --- /dev/null +++ b/demo/demo.tape @@ -0,0 +1,108 @@ +# VHS documentation +# +# Output: +# Output .gif Create a GIF output at the given +# Output .mp4 Create an MP4 output at the given +# Output .webm Create a WebM output at the given +# +# Require: +# Require Ensure a program is on the $PATH to proceed +# +# Settings: +# Set FontSize Set the font size of the terminal +# Set FontFamily Set the font family of the terminal +# Set Height Set the height of the terminal +# Set Width Set the width of the terminal +# Set LetterSpacing Set the font letter spacing (tracking) +# Set LineHeight Set the font line height +# Set LoopOffset % Set the starting frame offset for the GIF loop +# Set Theme Set the theme of the terminal +# Set Padding Set the padding of the terminal +# Set Framerate Set the framerate of the recording +# Set PlaybackSpeed Set the playback speed of the recording +# Set MarginFill Set the file or color the margin will be filled with. +# Set Margin Set the size of the margin. Has no effect if MarginFill isn't set. +# Set BorderRadius Set terminal border radius, in pixels. +# Set WindowBar Set window bar type. (one of: Rings, RingsRight, Colorful, ColorfulRight) +# Set WindowBarSize Set window bar size, in pixels. Default is 40. +# Set TypingSpeed