Skip to content

Commit 3e1c895

Browse files
committed
feat: mount manager (sxyazi#2199)
1 parent 6c94227 commit 3e1c895

40 files changed

+1068
-340
lines changed

Diff for: Cargo.lock

+167-185
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

+29-27
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,32 @@ panic = "abort"
1010
strip = true
1111

1212
[workspace.dependencies]
13-
ansi-to-tui = "7.0.0"
14-
anyhow = "1.0.95"
15-
base64 = "0.22.1"
16-
bitflags = "2.6.0"
17-
clap = { version = "4.5.23", features = [ "derive" ] }
18-
crossterm = { version = "0.28.1", features = [ "event-stream" ] }
19-
dirs = "5.0.1"
20-
futures = "0.3.31"
21-
globset = "0.4.15"
22-
libc = "0.2.169"
23-
md-5 = "0.10.6"
24-
mlua = { version = "0.10.2", features = [ "anyhow", "async", "error-send", "lua54", "macros", "serialize" ] }
25-
parking_lot = "0.12.3"
26-
ratatui = { version = "0.29.0", features = [ "unstable-rendered-line-info" ] }
27-
regex = "1.11.1"
28-
scopeguard = "1.2.0"
29-
serde = { version = "1.0.217", features = [ "derive" ] }
30-
serde_json = "1.0.134"
31-
shell-words = "1.1.0"
32-
tokio = { version = "1.42.0", features = [ "full" ] }
33-
tokio-stream = "0.1.17"
34-
tokio-util = "0.7.13"
35-
toml = { version = "0.8.19" }
36-
tracing = { version = "0.1.41", features = [ "max_level_debug", "release_max_level_debug" ] }
37-
twox-hash = { version = "2.1.0", default-features = false, features = [ "std", "random", "xxhash3_128" ] }
38-
unicode-width = "0.2.0"
39-
uzers = "0.12.1"
13+
ansi-to-tui = "7.0.0"
14+
anyhow = "1.0.95"
15+
base64 = "0.22.1"
16+
bitflags = "2.8.0"
17+
clap = { version = "4.5.26", features = [ "derive" ] }
18+
core-foundation-sys = "0.8.7"
19+
crossterm = { version = "0.28.1", features = [ "event-stream" ] }
20+
dirs = "6.0.0"
21+
futures = "0.3.31"
22+
globset = "0.4.15"
23+
libc = "0.2.169"
24+
md-5 = "0.10.6"
25+
mlua = { version = "0.10.2", features = [ "anyhow", "async", "error-send", "lua54", "macros", "serialize" ] }
26+
objc = "0.2.7"
27+
parking_lot = "0.12.3"
28+
ratatui = { version = "0.29.0", features = [ "unstable-rendered-line-info" ] }
29+
regex = "1.11.1"
30+
scopeguard = "1.2.0"
31+
serde = { version = "1.0.217", features = [ "derive" ] }
32+
serde_json = "1.0.135"
33+
shell-words = "1.1.0"
34+
tokio = { version = "1.43.0", features = [ "full" ] }
35+
tokio-stream = "0.1.17"
36+
tokio-util = "0.7.13"
37+
toml = { version = "0.8.19" }
38+
tracing = { version = "0.1.41", features = [ "max_level_debug", "release_max_level_debug" ] }
39+
twox-hash = { version = "2.1.0", default-features = false, features = [ "std", "random", "xxhash3_128" ] }
40+
unicode-width = "0.2.0"
41+
uzers = "0.12.1"

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Yazi (means "duck") is a terminal file manager written in Rust, based on non-blo
1818
- 🧰 Integration with ripgrep, fd, fzf, zoxide
1919
- 💫 Vim-like input/pick/confirm/which/notify component, auto-completion for cd paths
2020
- 🏷️ Multi-Tab Support, Cross-directory selection, Scrollable Preview (for videos, PDFs, archives, code, directories, etc.)
21-
- 🔄 Bulk Renaming, Visual Mode, File Chooser
21+
- 🔄 Bulk Renaming, Visual Mode, File Chooser, [Git Integration](https://github.com/yazi-rs/plugins/tree/main/git.yazi), [Mount Manager](https://github.com/yazi-rs/plugins/tree/main/mount.yazi)
2222
- 🎨 Theme System, Mouse Support, Trash Bin, Custom Layouts, CSI u, OSC 52
2323
- ... and more!
2424

@@ -61,7 +61,7 @@ See https://yazi-rs.github.io/docs/image-preview for details.
6161
<!-- Protocols -->
6262

6363
[kgp]: https://sw.kovidgoyal.net/kitty/graphics-protocol/#unicode-placeholders
64-
[kgp-old]: https://github.com/sxyazi/yazi/blob/main/yazi-adapter/src/kgp_old.rs
64+
[kgp-old]: https://github.com/sxyazi/yazi/blob/main/yazi-adapter/src/drivers/kgp_old.rs
6565
[iip]: https://iterm2.com/documentation-images.html
6666
[sixel]: https://www.vt100.net/docs/vt3xx-gp/chapter14.html
6767
[ascii-art]: https://en.wikipedia.org/wiki/ASCII_art

Diff for: cspell.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"words":["Punct","KEYMAP","splitn","crossterm","YAZI","unar","peekable","ratatui","syntect","pbpaste","pbcopy","oneshot","Posix","Lsar","XADDOS","zoxide","cands","Deque","precache","imageops","IFBLK","IFCHR","IFDIR","IFIFO","IFLNK","IFMT","IFSOCK","IRGRP","IROTH","IRUSR","ISGID","ISUID","ISVTX","IWGRP","IWOTH","IWUSR","IXGRP","IXOTH","IXUSR","libc","winsize","TIOCGWINSZ","xpixel","ypixel","ioerr","appender","Catppuccin","macchiato","gitmodules","Dotfiles","bashprofile","vimrc","flac","webp","exiftool","mediainfo","ripgrep","nvim","indexmap","indexmap","unwatch","canonicalize","serde","fsevent","Ueberzug","iterm","wezterm","sixel","chafa","ueberzugpp","️ Überzug","️ Überzug","Konsole","Alacritty","Überzug","pkgs","paru","unarchiver","pdftoppm","poppler","prebuild","singlefile","jpegopt","EXIF","rustfmt","mktemp","nanos","xclip","xsel","natord","Mintty","nixos","nixpkgs","SIGTSTP","SIGCONT","SIGCONT","mlua","nonstatic","userdata","metatable","natsort","backstack","luajit","Succ","Succ","cand","fileencoding","foldmethod","lightgreen","darkgray","lightred","lightyellow","lightcyan","nushell","msvc","aarch","linemode","sxyazi","rsplit","ZELLIJ","bitflags","bitflags","USERPROFILE","Neovim","vergen","gitcl","Renderable","preloaders","prec","Upserting","prio","Ghostty","Catmull","Lanczos","cmds","unyank","scrolloff","headsup","unsub","uzers","scopeguard","SPDLOG","globset","filetime","magick","magick","prefetcher","Prework","prefetchers","PREWORKERS","conds","translit","rxvt","Urxvt","realpath","realname","REPARSE","hardlink","hardlinking","nlink","nlink","linemodes","SIGSTOP","sevenzip","rsplitn","replacen","DECSET","DECRQM","repeek","cwds","tcsi","Hyprland","Wayfire","SWAYSOCK","btime","nsec","codegen","gethostname","fchmod","fdfind","Rustc","rustc","Sysinfo","ffprobe","vframes","luma","obase","outln","errln","tmtheme","twox"],"version":"0.2","language":"en","flagWords":[]}
1+
{"words":["Punct","KEYMAP","splitn","crossterm","YAZI","unar","peekable","ratatui","syntect","pbpaste","pbcopy","oneshot","Posix","Lsar","XADDOS","zoxide","cands","Deque","precache","imageops","IFBLK","IFCHR","IFDIR","IFIFO","IFLNK","IFMT","IFSOCK","IRGRP","IROTH","IRUSR","ISGID","ISUID","ISVTX","IWGRP","IWOTH","IWUSR","IXGRP","IXOTH","IXUSR","libc","winsize","TIOCGWINSZ","xpixel","ypixel","ioerr","appender","Catppuccin","macchiato","gitmodules","Dotfiles","bashprofile","vimrc","flac","webp","exiftool","mediainfo","ripgrep","nvim","indexmap","indexmap","unwatch","canonicalize","serde","fsevent","Ueberzug","iterm","wezterm","sixel","chafa","ueberzugpp","️ Überzug","️ Überzug","Konsole","Alacritty","Überzug","pkgs","paru","unarchiver","pdftoppm","poppler","prebuild","singlefile","jpegopt","EXIF","rustfmt","mktemp","nanos","xclip","xsel","natord","Mintty","nixos","nixpkgs","SIGTSTP","SIGCONT","SIGCONT","mlua","nonstatic","userdata","metatable","natsort","backstack","luajit","Succ","Succ","cand","fileencoding","foldmethod","lightgreen","darkgray","lightred","lightyellow","lightcyan","nushell","msvc","aarch","linemode","sxyazi","rsplit","ZELLIJ","bitflags","bitflags","USERPROFILE","Neovim","vergen","gitcl","Renderable","preloaders","prec","Upserting","prio","Ghostty","Catmull","Lanczos","cmds","unyank","scrolloff","headsup","unsub","uzers","scopeguard","SPDLOG","globset","filetime","magick","magick","prefetcher","Prework","prefetchers","PREWORKERS","conds","translit","rxvt","Urxvt","realpath","realname","REPARSE","hardlink","hardlinking","nlink","nlink","linemodes","SIGSTOP","sevenzip","rsplitn","replacen","DECSET","DECRQM","repeek","cwds","tcsi","Hyprland","Wayfire","SWAYSOCK","btime","nsec","codegen","gethostname","fchmod","fdfind","Rustc","rustc","Sysinfo","ffprobe","vframes","luma","obase","outln","errln","tmtheme","twox","cfgs","fstype","objc","rdev","runloop","exfat","rclone"],"version":"0.2","language":"en","flagWords":[]}

Diff for: flake.lock

+80-78
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: yazi-boot/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ serde = { workspace = true }
2222

2323
[build-dependencies]
2424
clap = { workspace = true }
25-
clap_complete = "4.5.40"
25+
clap_complete = "4.5.42"
2626
clap_complete_fig = "4.5.2"
2727
clap_complete_nushell = "4.5.5"
28-
vergen-gitcl = { version = "1.0.2", features = [ "build", "rustc" ] }
28+
vergen-gitcl = { version = "1.0.5", features = [ "build", "rustc" ] }

Diff for: yazi-cli/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ yazi-shared = { path = "../yazi-shared", version = "0.4.3" }
3131
# External build dependencies
3232
anyhow = { workspace = true }
3333
clap = { workspace = true }
34-
clap_complete = "4.5.40"
34+
clap_complete = "4.5.42"
3535
clap_complete_fig = "4.5.2"
3636
clap_complete_nushell = "4.5.5"
3737
serde_json = { workspace = true }
38-
vergen-gitcl = { version = "1.0.2", features = [ "build" ] }
38+
vergen-gitcl = { version = "1.0.5", features = [ "build" ] }
3939

4040
[target.'cfg(target_os = "macos")'.dependencies]
4141
crossterm = { workspace = true, features = [ "use-dev-tty", "libc" ] }

Diff for: yazi-codegen/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ proc-macro = true
1313

1414
[dependencies]
1515
# External dependencies
16-
syn = { version = "2.0.95", features = [ "full" ] }
16+
syn = { version = "2.0.96", features = [ "full" ] }
1717
quote = "1.0.38"

Diff for: yazi-core/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ bitflags = { workspace = true }
2727
crossterm = { workspace = true }
2828
dirs = { workspace = true }
2929
futures = { workspace = true }
30-
notify = { version = "7.0.0", default-features = false, features = [ "macos_fsevent" ] }
30+
notify = { version = "8.0.0", default-features = false, features = [ "macos_fsevent" ] }
3131
parking_lot = { workspace = true }
3232
ratatui = { workspace = true }
3333
scopeguard = { workspace = true }

Diff for: yazi-core/src/manager/watcher.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ use tokio::{fs, pin, sync::{mpsc::{self, UnboundedReceiver}, watch}};
77
use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream};
88
use tracing::error;
99
use yazi_config::PLUGIN;
10-
use yazi_fs::{Cha, File, Files, FilesOp, realname_unchecked};
10+
use yazi_dds::Pubsub;
11+
use yazi_fs::{Cha, File, Files, FilesOp, mounts::PARTITIONS, realname_unchecked};
1112
use yazi_plugin::isolate;
1213
use yazi_proxy::WATCHER;
1314
use yazi_shared::{RoCell, event::CmdCow, url::Url};
@@ -44,6 +45,9 @@ impl Watcher {
4445
tokio::spawn(Self::fan_in(in_rx, RecommendedWatcher::new(handler, config).unwrap()));
4546
}
4647

48+
#[cfg(any(target_os = "linux", target_os = "macos"))]
49+
yazi_fs::mounts::Partitions::monitor(PARTITIONS.clone(), Pubsub::pub_from_mount);
50+
4751
tokio::spawn(Self::fan_out(out_rx));
4852
Self { in_tx, out_tx }
4953
}

Diff for: yazi-core/src/tab/preview.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ impl Preview {
4646
let Some(cwd) = cwd else { return };
4747
self.folder_loader.take().map(|h| h.abort());
4848
self.folder_loader = Some(tokio::spawn(async move {
49-
let Some(new) = Files::assert_stale(&cwd, dir.unwrap_or(Cha::dummy())).await else {
50-
return;
51-
};
49+
let Some(new) = Files::assert_stale(&cwd, dir.unwrap_or(Cha::dummy())).await else { return };
5250
let Ok(rx) = Files::from_dir(&cwd).await else { return };
5351

5452
let stream =

Diff for: yazi-dds/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ tokio-util = { workspace = true }
3030
tracing = { workspace = true }
3131

3232
[build-dependencies]
33-
vergen-gitcl = { version = "1.0.2", features = [ "build" ] }
33+
vergen-gitcl = { version = "1.0.5", features = [ "build" ] }
3434

3535
[target."cfg(unix)".dependencies]
3636
uzers = { workspace = true }

Diff for: yazi-dds/src/body/body.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use anyhow::{Result, bail};
22
use mlua::{ExternalResult, IntoLua, Lua, Value};
33
use serde::Serialize;
44

5-
use super::{BodyBulk, BodyBye, BodyCd, BodyCustom, BodyDelete, BodyHey, BodyHi, BodyHover, BodyLoad, BodyMove, BodyRename, BodyTab, BodyTrash, BodyYank};
5+
use super::{BodyBulk, BodyBye, BodyCd, BodyCustom, BodyDelete, BodyHey, BodyHi, BodyHover, BodyLoad, BodyMount, BodyMove, BodyRename, BodyTab, BodyTrash, BodyYank};
66
use crate::Payload;
77

88
#[derive(Debug, Serialize)]
@@ -21,6 +21,7 @@ pub enum Body<'a> {
2121
Move(BodyMove<'a>),
2222
Trash(BodyTrash<'a>),
2323
Delete(BodyDelete<'a>),
24+
Mount(BodyMount),
2425
Custom(BodyCustom),
2526
}
2627

@@ -40,6 +41,7 @@ impl Body<'static> {
4041
"move" => Self::Move(serde_json::from_str(body)?),
4142
"trash" => Self::Trash(serde_json::from_str(body)?),
4243
"delete" => Self::Delete(serde_json::from_str(body)?),
44+
"mount" => Self::Mount(serde_json::from_str(body)?),
4345
_ => BodyCustom::from_str(kind, body)?,
4446
})
4547
}
@@ -65,6 +67,7 @@ impl Body<'static> {
6567
| "move"
6668
| "trash"
6769
| "delete"
70+
| "mount"
6871
) {
6972
bail!("Cannot construct system event");
7073
}
@@ -98,6 +101,7 @@ impl<'a> Body<'a> {
98101
Self::Move(_) => "move",
99102
Self::Trash(_) => "trash",
100103
Self::Delete(_) => "delete",
104+
Self::Mount(_) => "mount",
101105
Self::Custom(b) => b.kind.as_str(),
102106
}
103107
}
@@ -127,6 +131,7 @@ impl IntoLua for Body<'static> {
127131
Self::Move(b) => b.into_lua(lua),
128132
Self::Trash(b) => b.into_lua(lua),
129133
Self::Delete(b) => b.into_lua(lua),
134+
Self::Mount(b) => b.into_lua(lua),
130135
Self::Custom(b) => b.into_lua(lua),
131136
}
132137
}

Diff for: yazi-dds/src/body/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(clippy::module_inception)]
22

33
yazi_macro::mod_flat!(
4-
body bulk bye cd custom delete hey hi hover load move_ rename tab trash yank
4+
body bulk bye cd custom delete hey hi hover load mount move_ rename tab trash yank
55
);

0 commit comments

Comments
 (0)