diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0ca2ba7..35ed003 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,6 +54,6 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: target/${{ matrix.target }}/release/vt - asset_name: vt-${{ matrix.target }}$ + file: target/${{ matrix.target }}/release/ht + asset_name: ht-${{ matrix.target }}$ tag: ${{ github.ref }} diff --git a/Cargo.lock b/Cargo.lock index 24e45a3..89a45b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -143,6 +143,18 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "ht" +version = "0.1.0" +dependencies = [ + "anyhow", + "avt", + "clap", + "mio", + "nix", + "serde_json", +] + [[package]] name = "itoa" version = "1.0.11" @@ -284,18 +296,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" -[[package]] -name = "vt" -version = "0.1.0" -dependencies = [ - "anyhow", - "avt", - "clap", - "mio", - "nix", - "serde_json", -] - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/Cargo.toml b/Cargo.toml index a7d6673..aaa5a75 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "vt" +name = "ht" version = "0.1.0" edition = "2021" rust-version = "1.74" diff --git a/README.md b/README.md index fb0b1c0..e2b882c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# vt / hvt / vterm / virterm / termviewer / termproxy / ? +# ht - headless terminal TODO description @@ -28,40 +28,40 @@ cargo build --release ``` This produces the binary in _release mode_ (`--release`) at -`target/release/vt`. There are no other build artifacts so you can just +`target/release/ht`. There are no other build artifacts so you can just copy the binary to a directory in your `$PATH`. ## Usage -Run `vt` to start interactive bash shell running in a PTY (pseudo-terminal). +Run `ht` to start interactive bash shell running in a PTY (pseudo-terminal). -To launch a different program (a different shell, another program) run `vt +To launch a different program (a different shell, another program) run `ht `. For example: -- `vt fish` - starts fish shell -- `vt nano` - starts nano editor -- `vt nano /etc/fstab` - starts nano editor with /etc/fstab opened +- `ht fish` - starts fish shell +- `ht nano` - starts nano editor +- `ht nano /etc/fstab` - starts nano editor with /etc/fstab opened -Another way to run a specific program, e.g. `nano`, is to launch `vt` without a +Another way to run a specific program, e.g. `nano`, is to launch `ht` without a command, i.e. use bash by default, and start nano from bash by sending `nano\r` ("nano" followed by "return" control character) to the process input. See [input command](#input) below. Default size of the virtual terminal window is 120x40 (cols by rows), which can -be changed with `--size` argument. For example: `vt --size 80x24`. The window +be changed with `--size` argument. For example: `ht --size 80x24`. The window size can also be dynamically changed - see [resize command](#resize) below. -Run `vt -h` or `vt --help` to see all available options. +Run `ht -h` or `ht --help` to see all available options. ## API -Communication with vt is performed via stdin, stdout and stderr. +Communication with ht is performed via stdin, stdout and stderr. -vt uses simple JSON-based protocol for sending commands to its stdin. Each +ht uses simple JSON-based protocol for sending commands to its stdin. Each command must be sent on a separate line and be a JSON object having `"type"` field set to one the supported commands (below). -vt sends responses (where applicable) to its stdout, as JSON-encoded objects. +ht sends responses (where applicable) to its stdout, as JSON-encoded objects. Diagnostic messages (notices, errors) are printed to stderr. @@ -104,17 +104,17 @@ This command doesn't produce any output on stdout. ## Testing on command line -vt is aimed at programmatic use given its JSON-based API, however one can play +ht is aimed at programmatic use given its JSON-based API, however one can play with it by just launching it in a normal desktop terminal emulator and typing in JSON-encoded commands from keyboard and observing the output on stdout. [rlwrap](https://github.com/hanslub42/rlwrap) can be used to wrap stdin in a readline based editable prompt, which also provides history (up/down arrows). -To use `rlwrap` with `vt`: +To use `rlwrap` with `ht`: ```sh -rlwrap vt [vt-args...] +rlwrap ht [ht-args...] ``` ## License diff --git a/flake.nix b/flake.nix index ca3004f..6953b50 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "vt"; + description = "ht"; inputs = { nixpkgs.url = github:nixos/nixpkgs/nixpkgs-unstable; diff --git a/src/cli.rs b/src/cli.rs index 0e0a080..4654cec 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -5,7 +5,7 @@ use std::{fmt::Display, ops::Deref, str::FromStr}; #[derive(Debug, Parser)] #[clap(version, about)] -#[command(name = "vt")] +#[command(name = "ht")] pub struct Cli { /// Terminal size #[arg(long, value_name = "COLSxROWS", default_value = Some("120x40"))]