Skip to content

Commit 9b6aff1

Browse files
committed
feat: update documentation and relax remote workspace activation requirements for trash panel command
1 parent 7ca4fb4 commit 9b6aff1

4 files changed

Lines changed: 20 additions & 35 deletions

File tree

README.md

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
11
# trash4wsl-in-vscode <img src="./trash4wsl-icon.png" alt="demo" width="50" height="auto" align="center">
22

33
<pre align="center"> 简体中文 | <a href="https://github.com/2bitbit/trash4wsl-in-vscode/blob/main/docs/README_en.md">English</a></pre>
4-
在VSCode WSL(或其他 remote 连接)中,再也不用担心永久误删文件无法后悔,现在有了迷人的回收站(基于 trash-cli 实现)。
54

65
在VSCode WSL(或其他 remote 连接)中,再也不用担心误删文件造成的不可逆损失。现在有了一个迷人且极速安全的**原生回收站**(基于底层 Rust Native API 高性能重写,免依赖)。
76

87
<img src="./trash4wsl-demo.gif" alt="demo" width="500" height="auto">
98

10-
## 功能特色
11-
- 支持多根工作区
12-
- 支持删除、搜索、恢复、清空
13-
- 支持 WSL、其他remote连接
14-
- 支持快捷键(默认是`delete`删除选中文件,`ctrl+shift+delete`打开回收站面板)
15-
- 简洁的 GUI
16-
- 🚀 **纯原生极速实现**:底层引擎通过 `NAPI-RS` + Rust `trash` 构建,无缝衔接系统底层,极限提升响应速度。
17-
- 📦 **零前置依赖配置**:摆脱由于外部 `trash-cli` 库未安装造成的不能用,真正实现“安装即用”。
18-
- 🎨 **精美的系统级视图面板**:抛弃简陋的弹窗,内置专属大体量沉浸式历史视窗(支持文件分类展示、一键隔离恢复、危险级全部清空)。
19-
- 🛡️ **严格的安全拦截保护**:全原生参数传递,免疫所有的系统级 Shell 执行注入。
20-
- 支持各种基于 WSL 的操作系统以及遵循 FreeDesktop XDG 的各大远程发行版。
21-
- 顺手的键盘绑定(默认选中时按 `delete` 下发垃圾桶,`ctrl+shift+delete` 打开大屏管理面板)。
9+
## ✨ 功能特色
10+
- 📂 **支持多根工作区隔离**:精准识别和清理不同工作区的数据,避免误删。
11+
- 🚀 **纯原生极速实现**:底层引擎通过 `NAPI-RS` + Rust `trash` 重构跨界,**零外部依赖**无缝衔接系统底层,极限提升响应速度。
12+
- 🎨 **精美的系统级视图面板**:拥有简洁舒适交互的回收站管理视窗,原生支持文件实时搜索、单次隔离恢复、全部危险级清空。
13+
- 🛡️ **严格的安全注入保护**:通过全原生 C-ABI 参数传值,免疫所有的系统级 Shell 及命令行注入风险。
14+
- 🐧 **跨发行版适配架构**:内置分装了对 Linux `x64``arm64` (`aarch64`) 的多核支持,通杀各项 WSL1/WSL2 发行版,以及任何遵循 FreeDesktop XDG 标准的 Remote SSH Linux 主机。
15+
-**开箱即用无阻力**:不用再由于环境缺少 Python 依赖抓耳挠腮,享受极速部署。
16+
2217
## 如何使用
23-
1. 直接在 VSCode Marketplace 搜索 `trash4WSL-in-vscode` 并安装插件**不再需要在内部自装任何环境依赖**
18+
1. 直接在 VSCode Marketplace 搜索 `trash4WSL-in-vscode` 并安装插件。
2419
2. 在左侧资源管理器中选中你想清理的文件(支持多选),右键选择 `丢入回收站 (Trash)`,或者直接施放快捷键 `delete` 即可删除。
2520
3. `ctrl+shift+p` 执行命令或使用快捷键 `ctrl+shift+delete`,将在主编辑区打开宏伟的「工作区回收站」详情面板,进行相关后悔药操作。
2621

2722
>温馨提示:其底层标准严格遵守 FreeDesktop Trash 规范体系,所以你在插件内删除的数据、都会无缝与系统桌面默认回收站生态共存(存放路径通常为:`~/.local/share/Trash/`)。
2823
29-
## 环境
30-
- 支持新版 VSCode
31-
- Linux (x64 / arm64)
24+
---
3225

3326
若这个插件保护了您的重要代码,请在 GitHub 上大方地赐予一颗星星哦 ⭐,这对我是莫大的动力激励。
3427
<p align="center"><strong>Enjoy! 祝愿你早安午安晚安</strong></p>

docs/README_en.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ In VSCode WSL (or other remote connections), no more worries about permanent fil
66

77
<img src="../trash4wsl-demo.gif" alt="demo" width="500" height="auto">
88

9-
## Features (v2.0 Native Edition)
10-
- **Zero Dependencies**: Completely rewrote the backend in Rust via NAPI-RS. Say goodbye to the Python `trash-cli` dependency! It works out-of-the-box natively.
11-
- **Granular Multi-root Workspace Support**: Workspace-aware listing and purging, preventing accidental deletion of files outside your active projects.
12-
- **Safe Execution Environment**: Direct fs manipulations, fully immune to shell command injections.
13-
- **Classic VSCode UI Integration**: Search, filter, and restore files instantly using the lightweight QuickPick floating menu.
14-
- **Shortcut Support**: Use the standard `delete` key in the explorer to safely move items to the trash, or `ctrl+shift+delete` to open the interactive panel.
9+
## ✨ Features (v2.0 Native Edition)
10+
- 📂 **Granular Multi-root Workspace Support**: Workspace-aware listing and purging, preventing accidental deletion of files outside your active projects.
11+
- 🚀 **Zero Dependencies & Native Speed**: Completely rewrote the backend in Rust via NAPI-RS. Say goodbye to the Python `trash-cli` dependency! It works out-of-the-box natively, boosting response speed up to the physical limits of the OS.
12+
- 🎨 **Classic VSCode UI Integration**: Elegant icon-based interactive trash panel, natively supporting real-time filter searching, individual item restorations, and full destructive purging.
13+
- 🛡️ **Safe Execution Environment**: Direct native C-ABI manipulations, fully immune to all shell command injections.
14+
- 🐧 **Cross-Platform Linux Compatibility**: Shipped alongside binaries for both `x64` and `arm64` (`aarch64`). Supports WSL 1 & 2 out of the box, as well as major remote distros adopting the FreeDesktop XDG standard (Technically supports *any* Linux Server using VSCode Remote SSH).
15+
-**User-Friendly Shortcuts**: Use the standard `delete` key in the explorer to safely move items to the trash, or `ctrl+shift+delete` to open the interactive panel.
1516

1617
## How to Use
1718
1. Search for `trash4wsl-in-vscode` in VSCode Marketplace and install this extension to your workspace. (No extra dependencies needed!)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"command": "trash4wsl-in-vscode.browseTrash",
2929
"key": "ctrl+shift+delete",
3030
"mac": "ctrl+shift+delete",
31-
"when": "resourceScheme == 'vscode-remote'"
31+
"when": "remoteName"
3232
}
3333
],
3434
"menus": {

src/ui/TrashPalette.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,8 @@ export class TrashPalette {
8383
} // HACK: 简单处理一下,这里的返回上级直接调用show()回到初始界面
8484
});
8585

86-
// 根据用户输入实时动态更新选项列表 (onDidChangeValue)
87-
let debounceTimer: NodeJS.Timeout; // 在外部声明一个计时器变量
88-
quickPick.onDidChangeValue(async (value) => {
89-
clearTimeout(debounceTimer); // 清除之前的计时器
90-
debounceTimer = setTimeout(async () => {
91-
quickPick.busy = true; // 控制忙碌状态
92-
const newItems2Display = await this.#fetchTrashItems2Display(path);
93-
quickPick.items = newItems2Display;
94-
quickPick.busy = false;
95-
}, 300); // 简单的防抖处理
96-
});
86+
// 原先的 onDidChangeValue 被移除:原生的 QuickPick 会自动依据 label/description 执行高性能过滤,
87+
// 不需要亦不应该在每次按键时去触发硬盘 IO。
9788

9889
// 用户确认选择时的处理
9990
// 处理选择事件

0 commit comments

Comments
 (0)