In DSH sessions, PowerShell (pwsh) tool cards often have a limited, uniform style, lacking consistent visual standards and interaction details, which hurts the reading experience. This article introduces the dsh-pwsh-style plugin, which uses CSS injection and DOM decoration to provide a complete restyling solution for these cards.

Plugin Positioning

dsh-pwsh-style is a plugin maintained by me9rez, categorized as “Fun Skinning”. Its core purpose is to modify the theme, fonts, and readability of pwsh tool cards in DSH session replies. Its architecture follows dsh-file-mentions: the Host half handles settings and configuration routing, while the Client half injects CSS through the __ModuleLoader__ bundle and optionally decorates the DOM.

Core Features

  1. Eight themes: Provides ps-blue, monokai, classic, dracula, nord, tokyo-night, solarized-dark, github-light, and other presets. These themes use --pwsh-panel-* variables to style only the elements added by the plugin (badges, toolbar, command panel), and never override the native output colors.
  2. PowerShell badge: Automatically injects a PS icon pill into the card title row.
  3. Copy command button: Accurately reads arguments.command from the tool/call event. Clicking it copies only the command content, without including the description, output, or button text.
  4. Expand/collapse button: Displays the full command (long commands are no longer truncated with ellipsis) and shows the working directory at invocation time.
  5. Font configuration: Supports selecting an installed system font from a dropdown (font-list enumeration), and adjusting the font size (11–16px) and font weight (300–700).
  6. Zero hashed-class dependency: All hooks are based on stable data-* attributes, so they remain valid even if a DSH upgrade rewrites CSS-module class names.

Installation and Activation

  1. Ensure pnpm is included in the system PATH (dsh plugin forwards to pnpm).
  2. Run the official installation command:
dsh plugin --profile web add "github:me9rez/dsh-pwsh-style#main"

For local development, you can also install it via the link method:

dsh plugin --profile web add "link:C:/workspace/dsh-pwsh-style"
  1. After installation, you must restart dsh web. The plugin’s bundle layer is composited at startup, so hot updates (HMR) do not take effect. A hard refresh of the browser page is required to see the changes.

Configuration Notes

Open the DSH Web GUI, go to the Settings page, and find the configuration card for this plugin.

Configurable items include:
* Enable: Turns the overall plugin effect on or off.
* Theme: Select one of the eight presets from a dropdown.
* Font: Select a system font from the dropdown, or choose “Default monospace font” to restore the built-in stack (the fallback list used when system font enumeration fails).
* Font size: 11–16px.
* Font weight: 300 (thin) / 400 (normal) / 500 (medium) / 600 (semibold) / 700 (bold).

Note: The font configuration has one exception: it overrides the official token --dsw-font-markdown-code-block-small as a whole so that the command prompt line and the output area follow the selected font. At the default value, no styles are injected.

How It Works

The plugin locates cards via the [data-tool="pwsh"] attribute. Since pwsh is classified as a bash variant at the outer level (TOOL_VARIANTS: { pwsh: "bash" }), but its entryKey remains the literal tool name "pwsh", it does not match the bash toolview and falls back to GenericToolCard, whose root element is stably marked with data-tool="pwsh".

Command data is read as command / workdir from the arguments of the tool/call event and is accurately associated with the card through the ancestor node’s data-chat-call-id. Nodes such as badges, buttons, and the command panel need to be created. The plugin uses MutationObserver to insert them dynamically after React renders, and they are automatically restored on the next frame.

Conclusion

With zero hashed-class dependencies and stable attribute hooks, the plugin ensures compatibility after DSH upgrades. For developers who frequently view PowerShell output or want a unified session style, this is a practical configuration option.

GitHub
DSH Plugin Directory