Skip to main content

How to use DSH-better-sidebar

Provides a VS Code-style dual workspace (sidebar + bottom panel) for DSH: file editing, real terminal, Git, embedded browser and background tasks; session isolation with open page and file previewer registration for other plugins.

This article is auto-derived from indexed fields (wiki / faq / compatibility_json), not freshly AI-generated.

This article is derived from the plugin's already-indexed fields (wiki / faq / compatibility_json / readme), not freshly generated by AI. Source field is noted at the end of each section.

Quick start

DSH-better-sidebar

— source: plugin_wiki.wiki_content

Install & verify

dsh plugin --profile web add dsh-better-sidebar

Run the command above in your DSH Web Profile. Then enable the plugin in the plugin list.

— source: plugins.install

Key points

  • 🗂️ 文件工作台:资源管理器(懒加载目录树;软链接按目标类型展示——目录软链接可展开、失效链接标红)+ CodeMirror 编辑器;图片 / Markdown(含 Mermaid 图表,strict 安全渲染 + 点击放大)/ HTML / PDF / Office 内联预览
  • 🌐 内嵌浏览器:多开网页 tab,后退 / 前进 / 刷新;内容运行在沙箱 iframe;外链默认按协议分流——HTTP 在侧边栏打开、HTTPS 走系统浏览器(设置页可分别调整)
  • 💻 真实终端:xterm.js + node-pty 真实 shell,断线重连回放;可选为模型注入 terminal_* 工具
  • 🌿 Git 面板:真 diff + VSCode 式 diff tab、历史、右键暂存 / 提交 / 还原
  • 🧩 后台任务页:subagent 拓扑 + 后台任务(退出码 / 实时输出 / 强制终止)

— source: plugin_wiki.readme_en (fallback readme_raw)

FAQ

What to do if there are two sidebars on the page after installation?

This is double mounting. The common cause is that the hand-written - insert: ... better-sidebar ... line is still retained in ~/.dsh/profiles/web/cordis.patch.yml; when mounting via npm bundle channel, just delete it (see README_EN.md:119).

Terminal shows "node-pty failed to load" or can't open at all, what to do?

node-pty relies on precompiled binaries, pnpm 11 intercepts its build script. Fix command: run pnpm approve-builds --all && pnpm rebuild node-pty in the ~/.dsh/profiles/web directory, then restart DSH and click Retry on the terminal page. Since 0.12.3, node-pty loading failure no longer drags down the service (issue #140), the banner will display this copyable command.

What Node and DSH versions does this plugin require?

package.json declares engines.node ">=20", with all DSH peerDependencies locked to ^0.1.0-rc.6; cannot use older Node or misaligned DSH pre-release.

How do I register new pages or new file viewers to my plugin's sidebar?

In your plugin's client half, use ctx.betterSidebar.registerTab({...}) / registerFileViewer({...}), the whole set uses the same Cordis service; wrap with ctx.effect(() => register(...)) to follow HMR (see AGENTS.md / docs/external-plugin-guide.md for details).

Where is my data stored? Will it leak between sessions?

Layout/tab/panel state persistence is in localStorage isolated by session ID (see "Session Isolation" in README); host file operations (read/write, Git, terminal, media) are completely confined to current session's working directory, won't leak across sessions.

How to completely uninstall?

Delete the "dsh-better-sidebar" line from dependencies in ~/.dsh/profiles/web/package.json, then pnpm install and restart DSH; the plugin doesn't write to home directory or depend on background processes.

Can I view GitHub / paper pages directly in the browser?

Built-in browser tab support, HTTP external links open in sidebar by default, HTTPS (GitHub and most sites) open in system browser by default, each protocol has its own independent toggle ("Intercept HTTP"/"Intercept HTTPS", see config options). Many sites (arxiv.org etc.) refuse embedding via X-Frame-Options/CSP, the sidebar will show a reason panel and provide an "Open in Browser" button.

Can I use it on mobile?

The right column sidebar automatically merges to full-width drawer on narrow screens (<768px); bottom panel is unavailable on narrow screens, and after auto-merging to right column, moving back to wide screen will keep it in right column, won't automatically restore - this is a known limitation already documented in README (README_EN.md:226).

— source: plugin_wiki.faq_json

Compatibility

  • DSH: 0.1.0-rc.6+
  • Node: >=20
  • Platforms: macOS, Windows, Linux
  • Native modules: node-pty

— source: plugin_wiki.compatibility_json

Pitfalls

Review the upstream repo before installing. This guide is auto-derived from indexed fields and may lag the latest release. If anything contradicts the official docs, treat the upstream source as authoritative.

— source: general rule

How to use DSH-better-sidebar