Skip to content

Commit

Permalink
docs: add move, trash and delete event kinds to DDS
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Apr 11, 2024
1 parent e77f9ea commit ae53516
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 15 deletions.
124 changes: 116 additions & 8 deletions docs/dds.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Data Distribution Service
# DDS

:::warning
This is a new feature that will be released in Yazi 0.2.5 and currently requires the latest main branch.
This is a new feature that will be released in Yazi 0.2.5 and currently requires the latest code.

Document is still being written...
:::
Expand Down Expand Up @@ -60,7 +60,7 @@ This provides the ability to report Yazi's internal events in real-time, which i

## Builtin kinds {#builtin}

### `cd`
### `cd` - change directory {#cd}

`sub()` callback body:

Expand Down Expand Up @@ -91,7 +91,7 @@ cd,1711957542289249,1711957542289249,{"tab":0,"url":"/root/Downloads"}
cd,0,100,{"tab":0,"url":"/root/Downloads"}
```

### `hover`
### `hover` - hover on a file {#hover}

`sub()` callback body:

Expand Down Expand Up @@ -122,7 +122,7 @@ hover,1711957283332834,1711957283332834,{"tab":0,"url":"/root/foo.txt"}
hover,0,200,{"tab":0,"url":"/root/foo.txt"}
```

### `rename`
### `rename` - rename a file {#rename}

`sub()` callback body:

Expand Down Expand Up @@ -156,11 +156,11 @@ rename,1711957878076791,1711957878076791,{"tab":0,"from":"/root/foo.txt","to":"/
rename,0,1711957878076791,{"tab":0,"from":"/root/foo.txt","to":"/root/bar.txt"}
```

### `bulk`
### `bulk` - bulk rename files {#bulk}

TODO

### `yank`
### `yank` - yank files {#yank}

`sub()` callback body:

Expand Down Expand Up @@ -196,10 +196,118 @@ yank,1711960311454247,1711960311454247,{"cut":false,"urls":["/root/foo.txt","/ro
yank,0,300,{"cut":false,"urls":["/root/foo.txt","/root/bar.txt"]}
```

### `hi`
### `move` - move files {#move}

`sub()` callback body:

```lua
{
items = {
{ from = Url("/root/foo.txt"), to = Url("/root/bar.txt") },
-- ...
}
}
```

`sub_remote()` callback body:

```lua
{
items = {
{ from = Url("/root/foo.txt"), to = Url("/root/bar.txt") },
-- ...
}
}
```

`--local-events` stdout payload:

```sh
move,1711957542289249,1711957542289249,{"items":[{"from":"/root/foo.txt","to":"/root/bar.txt"}]}
```

`--remote-events` stdout payload:

```sh
move,0,1711957542289249,{"items":[{"from":"/root/foo.txt","to":"/root/bar.txt"}]}
```

### `trash` - trash files {#trash}

`sub()` callback body:

```lua
{
urls = {
Url("/root/foo.txt"),
-- ...
}
}
```

`sub_remote()` callback body:

```lua
{
urls = {
Url("/root/foo.txt"),
-- ...
}
}
```

`--local-events` stdout payload:

```sh
trash,1711957542289249,1711957542289249,{"urls":["/root/foo.txt"]}
```

`--remote-events` stdout payload:

```sh
trash,0,1711957542289249,{"urls":["/root/foo.txt"]}
```

### `delete` - delete files {#delete}

`sub()` callback body:

```lua
{
urls = {
Url("/root/foo.txt"),
-- ...
}
}
```

`sub_remote()` callback body:

```lua
{
urls = {
Url("/root/foo.txt"),
-- ...
}
}
```

`--local-events` stdout payload:

```sh
delete,1711957542289249,1711957542289249,{"urls":["/root/foo.txt"]}
```

`--remote-events` stdout payload:

```sh
delete,0,1711957542289249,{"urls":["/root/foo.txt"]}
```

### `hi` - client handshake {#hi}

System reserves kind.

### `hey`
### `hey` - server handshake {#hey}

System reserves kind.
12 changes: 6 additions & 6 deletions docs/image-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ That's relying on the `$TERM`, `$TERM_PROGRAM`, and `$XDG_SESSION_TYPE` variable
For instance, if your terminal is Alacritty, which doesn't support displaying images itself, but you are running on an X11/Wayland environment,
it will automatically use the "Window system protocol" to display images - this requires you to have [Überzug++](https://github.com/jstkdng/ueberzugpp) installed.

## tmux users
## tmux users {#tmux}

To enable Yazi's image preview to work correctly in tmux, add the following 3 options to your `tmux.conf`:

Expand All @@ -50,18 +50,18 @@ tmux kill-server && tmux || tmux

Now you should be able to enjoy with the image preview.

## Zellij users
## Zellij users {#zellij}

Zellij currently only supports the Sixel graphics format, so you will need a terminal that also supports Sixel.

## Windows users
## Windows users {#windows}

Currently, only the following two terminals support displaying images on Windows:

- WezTerm
- Mintty (Git Bash, which comes with Git for Windows)

## Windows with WSL users
## Windows with WSL users {#wsl}

Limited by ConPTY, the Windows edition has had to implement many workarounds, which are not perfect.

Expand All @@ -83,7 +83,7 @@ wezterm ssh 127.0.0.1

That's it! you can now get Yazi's image preview working properly.

## Why can't I preview images via Überzug++?
## Why can't I preview images via Überzug++? {#debug-ueberzug}

This may be an issue with Überzug++, please try running `ueberzugpp layer` directly in the terminal without Yazi, and paste:

Expand All @@ -95,7 +95,7 @@ into it, then press `Enter`, and to see if any image is shown, without exiting t

If the image shows properly when using Überzug++ independently, but not when used with Yazi, please create a bug report.

## Why won't my images adapt to terminal size?
## Why won't my images adapt to terminal size? {#size}

The size of the image depends on two factors:

Expand Down
2 changes: 1 addition & 1 deletion docs/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Some awesome plugins for Yazi.
# Resources

:::warning
The plugin system is still in the early stage, and most of the plugins below only guarantee compatibility with the latest main branch of Yazi!
The plugin system is still in the early stage, and most of the plugins below only guarantee compatibility with the latest code of Yazi!

Please make sure that both your Yazi and plugins are on the `HEAD` to ensure proper functionality!
:::
Expand Down

0 comments on commit ae53516

Please sign in to comment.