Skip to content

Commit

Permalink
Rename to ht
Browse files Browse the repository at this point in the history
  • Loading branch information
ku1ik committed Apr 10, 2024
1 parent 3b9155c commit 34f8c13
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "vt"
name = "ht"
version = "0.1.0"
edition = "2021"
rust-version = "1.74"
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# vt / hvt / vterm / virterm / termviewer / termproxy / ?
# ht - headless terminal

TODO description

Expand Down Expand Up @@ -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
<command> <args...>`. 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.

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
description = "vt";
description = "ht";

inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixpkgs-unstable;
Expand Down
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))]
Expand Down

0 comments on commit 34f8c13

Please sign in to comment.