Compare commits

..

11 Commits

Author SHA1 Message Date
nnyyxxxx
e583fc7864
fix confirmation prompt closing via rmb 2024-11-13 09:16:03 -05:00
nnyyxxxx
563676db7c
change to false
run clippy
2024-11-13 09:16:03 -05:00
nnyyxxxx
ee4f28fed2
w.i.p. left click confirmation 2024-11-13 09:16:02 -05:00
nnyyxxxx
685f71e53c
combine crates 2024-11-13 09:16:02 -05:00
nnyyxxxx
778372bb4a
make right click close floating windows 2024-11-13 09:16:02 -05:00
nnyyxxxx
55e547f9d0
add click and drag 2024-11-13 09:16:01 -05:00
nnyyxxxx
f41257d55b
bring up description on scroll wheel pressdown, bring up script preview on Right Mouse Button pressdown 2024-11-13 09:16:01 -05:00
nnyyxxxx
093ae2cfb3
allow selection of search bar 2024-11-13 09:16:01 -05:00
nnyyxxxx
f6b8358fcc
fix subdir bug 2024-11-13 09:16:01 -05:00
nnyyxxxx
d7da907a9c
improve mouse position calculation 2024-11-13 09:16:00 -05:00
nnyyxxxx
87f065e8e6
w.i.p. concept for more mouse interaction within the tui
run fmt
2024-11-13 09:15:58 -05:00
6 changed files with 21 additions and 126 deletions

93
.github/preview.tape vendored
View File

@ -1,93 +0,0 @@
# VHS documentation
#
# Output:
# Output <path>.gif Create a GIF output at the given <path>
# Output <path>.mp4 Create an MP4 output at the given <path>
# Output <path>.webm Create a WebM output at the given <path>
#
# Require:
# Require <string> Ensure a program is on the $PATH to proceed
#
# Settings:
# Set FontSize <number> Set the font size of the terminal
# Set FontFamily <string> Set the font family of the terminal
# Set Height <number> Set the height of the terminal
# Set Width <number> Set the width of the terminal
# Set LetterSpacing <float> Set the font letter spacing (tracking)
# Set LineHeight <float> Set the font line height
# Set LoopOffset <float>% Set the starting frame offset for the GIF loop
# Set Theme <json|string> Set the theme of the terminal
# Set Padding <number> Set the padding of the terminal
# Set Framerate <number> Set the framerate of the recording
# Set PlaybackSpeed <float> Set the playback speed of the recording
# Set MarginFill <file|#000000> Set the file or color the margin will be filled with.
# Set Margin <number> Set the size of the margin. Has no effect if MarginFill isn't set.
# Set BorderRadius <number> Set terminal border radius, in pixels.
# Set WindowBar <string> Set window bar type. (one of: Rings, RingsRight, Colorful, ColorfulRight)
# Set WindowBarSize <number> Set window bar size, in pixels. Default is 40.
# Set TypingSpeed <time> Set the typing speed of the terminal. Default is 50ms.
#
# Sleep:
# Sleep <time> Sleep for a set amount of <time> in seconds
#
# Type:
# Type[@<time>] "<characters>" Type <characters> into the terminal with a
# <time> delay between each character
#
# Keys:
# Escape[@<time>] [number] Press the Escape key
# Backspace[@<time>] [number] Press the Backspace key
# Delete[@<time>] [number] Press the Delete key
# Insert[@<time>] [number] Press the Insert key
# Down[@<time>] [number] Press the Down key
# Enter[@<time>] [number] Press the Enter key
# Space[@<time>] [number] Press the Space key
# Tab[@<time>] [number] Press the Tab key
# Left[@<time>] [number] Press the Left Arrow key
# Right[@<time>] [number] Press the Right Arrow key
# Up[@<time>] [number] Press the Up Arrow key
# Down[@<time>] [number] Press the Down Arrow key
# PageUp[@<time>] [number] Press the Page Up key
# PageDown[@<time>] [number] Press the Page Down key
# Ctrl+<key> Press the Control key + <key> (e.g. Ctrl+C)
#
# Display:
# Hide Hide the subsequent commands from the output
# Show Show the subsequent commands in the output
Output preview.gif
Require linutil
Require sh
Set Shell "bash"
Set FontFamily "JetBrainsMono Nerd Font"
Set FontSize 24
Set Width 1920
Set Height 1080
Sleep 1s
Type "linutil" Sleep 1s Enter
Sleep 2s
Left Sleep 1s
Down Sleep 1s
Down Sleep 1s
Down Sleep 1s
Down Sleep 1s
Right Sleep 1s
Type "/" Sleep 1s
Type@200ms "Full System Cleanup" Sleep 1s Enter
Sleep 1s
Enter Sleep 2s
Type "y" # CONFIRMATION PROMPT
Sleep 15s
Type "y" # SYSTEM CLEANUP PROMPT
Enter
Sleep 4s
Enter
Sleep 2s

View File

@ -67,10 +67,9 @@ jobs:
uses: peter-evans/create-pull-request@v7.0.5
with:
commit-message: Preview for ${{ env.tag_name }}
token: ${{ secrets.PAT_TOKEN }}
branch: feature/preview-${{ env.tag_name }}
title: "Update preview for ${{ env.tag_name }}"
labels: |
documentation
body: |
Automated PR to update preview gif for version ${{ env.tag_name }}
![preview](https://raw.githubusercontent.com/${{ github.repository }}/feature/preview-${{ env.tag_name }}/.github/preview.gif)

32
Cargo.lock generated
View File

@ -381,21 +381,7 @@ checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1"
[[package]]
name = "linutil_core"
version = "24.10.31"
dependencies = [
"ego-tree",
"include_dir",
"serde",
"temp-dir",
"toml",
"which",
]
[[package]]
name = "linutil_core"
version = "24.10.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2990ea580e635f6700ae19bd0f5fa60c7037799908da476b0c233b9e514c1481"
version = "24.9.28"
dependencies = [
"ego-tree",
"include_dir",
@ -407,12 +393,12 @@ dependencies = [
[[package]]
name = "linutil_tui"
version = "24.10.31"
version = "24.9.28"
dependencies = [
"ansi-to-tui",
"anstyle",
"clap",
"linutil_core 24.10.31 (registry+https://github.com/rust-lang/crates.io-index)",
"linutil_core",
"nix 0.29.0",
"oneshot",
"portable-pty",
@ -425,7 +411,6 @@ dependencies = [
"tree-sitter-highlight",
"tui-term",
"unicode-width 0.2.0",
"vt100-ctt",
"zips",
]
@ -1097,6 +1082,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72af159125ce32b02ceaced6cffae6394b0e6b6dfd4dc164a6c59a2db9b3c0b0"
dependencies = [
"ratatui",
"vt100",
]
[[package]]
@ -1147,9 +1133,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
[[package]]
name = "vt100-ctt"
version = "0.15.3"
source = "git+https://github.com/ChrisTitusTech/vt100-rust#39136a6232d043d8447afa7d47805b6f6baa09ee"
name = "vt100"
version = "0.15.2"
source = "git+https://github.com/ChrisTitusTech/vt100-rust#e41fb3d8fb5fd01dd2d076c9a25823a31656012f"
dependencies = [
"itoa",
"log",
@ -1317,9 +1303,9 @@ checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904"
[[package]]
name = "xtask"
version = "24.10.31"
version = "24.9.28"
dependencies = [
"linutil_core 24.10.31",
"linutil_core",
]
[[package]]

View File

@ -1,6 +1,6 @@
[workspace.package]
license = "MIT"
version = "24.10.31"
version = "24.9.28"
edition = "2021"
[workspace]
@ -8,6 +8,9 @@ members = ["tui", "core", "xtask"]
default-members = ["tui", "core"]
resolver = "2"
[patch.crates-io]
vt100 = { git = "https://github.com/ChrisTitusTech/vt100-rust" }
[profile.release]
opt-level = "z"
debug = false

View File

@ -18,12 +18,12 @@ clap = { version = "4.5.20", features = ["derive", "std"], default-features = fa
oneshot = { version = "0.1.8", features = ["std"], default-features = false }
portable-pty = "0.8.1"
ratatui = { version = "0.29.0", features = ["crossterm"], default-features = false }
tui-term = { version = "0.2.0", default-features = false }
tui-term = "0.2.0"
temp-dir = "0.1.14"
time = { version = "0.3.36", features = ["formatting", "local-offset", "macros"], default-features = false }
unicode-width = { version = "0.2.0", default-features = false }
rand = { version = "0.8.5", optional = true }
linutil_core = { version = "24.10.31" }
linutil_core = { version = "24.9.28", path = "../core" }
tree-sitter-highlight = "0.24.3"
tree-sitter-bash = "0.23.1"
textwrap = { version = "0.16.1", default-features = false }
@ -31,7 +31,6 @@ anstyle = { version = "1.0.8", default-features = false }
ansi-to-tui = { version = "7.0.0", default-features = false }
zips = "0.1.7"
nix = { version = "0.29.0", features = [ "user" ] }
vt100-ctt = { git = "https://github.com/ChrisTitusTech/vt100-rust" }
[[bin]]
name = "linutil"

View File

@ -18,9 +18,10 @@ use std::{
thread::JoinHandle,
};
use time::{macros::format_description, OffsetDateTime};
use tui_term::widget::PseudoTerminal;
use vt100_ctt::{Parser, Screen};
use tui_term::{
vt100::{self, Screen},
widget::PseudoTerminal,
};
pub struct RunningCommand {
/// A buffer to save all the command output (accumulates, until the command exits)
buffer: Arc<Mutex<Vec<u8>>>,
@ -284,7 +285,7 @@ impl RunningCommand {
// Process the buffer with a parser with the current screen size
// We don't actually need to create a new parser every time, but it is so much easier this
// way, and doesn't cost that much
let mut parser = Parser::new(size.height, size.width, 1000);
let mut parser = vt100::Parser::new(size.height, size.width, 1000);
let mutex = self.buffer.lock();
let buffer = mutex.as_ref().unwrap();
parser.process(buffer);