Skip to content

Releases

dsh-file-opener v1.4.0

Choose a tag to compare

@sailoumili sailoumili released this 03 Oct 15:55

dsh-file-opener v1.4.0

中文 | English

将 DSH 对话中以行内代码写出的文件和目录路径渲染为可点击按钮:点击后在右侧侧边栏预览,或调用系统默认程序打开。

✨ 新增功能

  • 对话中的文件与目录路径渲染为可点击按钮,点击即在右侧侧边栏预览,或调用系统默认程序打开。
  • 路径后的文件夹小图标可直接打开其所在目录。
  • 用户消息中未附带官方按钮的行内代码路径同样可点击,并带文件夹小图标。
  • 按住 Shift 点击文件路径,强制调用系统默认程序打开。
  • 路径不存在时,打开其所在的那一级真实目录,不报错。

可预览的格式

  • 在右侧侧边栏打开:Markdown、HTML、图片、PDF、Office、Excel、代码高亮,以及任何内容为纯文本的文件。
  • 调用系统默认程序打开:压缩包、音视频、安装程序、磁盘映像,以及官方未提供预览器的二进制格式。

体验优化

  • 是否按纯文本处理仅依据文件内容判断,与扩展名无关。
  • 路径查询结果缓存 4 秒,文件被改名或挪走后能及时反映。
  • 打开失败会给出可见提示,不会静默失败。

⚠️ 兼容性

  • 支持 DSH 0.1.7-alpha.1 及以上的 web 版与桌面版。
  • 不声明版本锁,不会被官方兼容性闸门误拦。
  • 零第三方运行时依赖,不写运行状态文件,不联网。

📦 安装

web 版:

dsh plugin --profile web add dsh-file-opener

桌面版:打开 DSH 桌面版,点击左侧栏「插件」→「添加插件」,输入包名 dsh-file-opener 后点击「安装」,安装完成后点击「立即启用」。

⚠️ 已知限制

  • 目录打开仅支持 Windows;其他平台退回侧边栏打开。
  • UNC 网络路径(\\server\share)与 Windows 保留设备名(CON、PRN、AUX、NUL、COM1-COM9、LPT1-LPT9)不予打开。
  • 相对路径无绝对路径可用,仅能通过侧边栏打开;Shift 强制系统程序对其无效。
  • Office 与 Excel 的侧边栏预览依赖宿主转换组件,转换失败时仅显示「无法预览」,不会自动改用系统程序。
  • 工作区外的路径交给侧边栏预览时,可能因宿主访问策略返回 403,文件过大可能返回 413。
  • .dxf、.docx、.xlsx、.pptx 在侧边栏打开而非启动对应桌面程序,此属预期行为。

📄 许可

MIT。

✨ New Features

  • File and directory paths in a conversation render as clickable buttons; clicking one previews it in the right sidebar or opens it with the system default application.
  • The folder icon after a path opens the directory containing it.
  • Inline code paths in user messages that carry no official button are clickable too, with the same folder icon.
  • Shift + click a file path to always open it with the system default application.
  • A path that does not exist opens the nearest real directory above it, without an error.

Formats

  • Open in the right sidebar: Markdown, HTML, images, PDF, Office, Excel, syntax-highlighted code, and any file whose content is plain text.
  • Open with the system default application: archives, audio and video, installers, disk images, and binary formats the official previewers do not handle.

Improvements

  • Whether a file is treated as plain text depends on its content alone, not on its extension.
  • Path lookups are cached for 4 seconds, so a renamed or moved file is reflected promptly.
  • A failed open always shows a visible message; nothing fails silently.

⚠️ Compatibility

  • Supports the web and desktop builds of DSH 0.1.7-alpha.1 and later.
  • No version pin, so the official compatibility gate cannot wrongly block it.
  • No third-party runtime dependencies, writes no state files, makes no network requests.

📦 Installation

Web build:

dsh plugin --profile web add dsh-file-opener

Desktop build: open the DSH desktop app, click Plugins in the left sidebar, then Add plugin, enter the package name dsh-file-opener, click Install, and click Enable now when installation completes.

⚠️ Known Limitations

  • Opening directories is supported on Windows only; other platforms fall back to the right sidebar.
  • UNC network paths (\\server\share) and Windows reserved device names (CON, PRN, AUX, NUL, COM1-COM9, LPT1-LPT9) are not opened.
  • Relative paths have no absolute path available and can only open in the sidebar; Shift does not force the system application for them.
  • Office and Excel previews in the sidebar depend on the host's conversion component. When conversion fails, only "cannot preview" is shown and the plugin does not fall back automatically.
  • A path outside the workspace handed to the sidebar preview can return 403 under the host's access policy, and a very large file can return 413.
  • .dxf, .docx, .xlsx, and .pptx open in the right sidebar instead of launching the corresponding desktop application. This is intended behavior.

📄 License

MIT.