Skip to content
ConsoleMonster

API Reference

Class

ClipboardService

Namespace ConsoleMonster.Clipboard
Assembly ConsoleMonster
Modifiers sealed

Copies serialized output as Unicode clipboard text. Uses the Windows clipboard, macOS pbcopy, or Linux wl-copy/xclip without a runtime package dependency. SSH sessions are refused to protect the remote host's clipboard.

Inheritance

  • Object
  • ClipboardService

Constructors

public ClipboardService() #

Creates a service for the current operating system and desktop session.

Methods

public Boolean TryCopy(String text, out String? error) #
Returns: Boolean

Copies text, Markdown source or HTML source as text, returning a diagnostic instead of throwing for unavailable providers.

Parameters

text System.String requiredposition: 0
The serialized document. It is passed through standard input, never through command arguments.
error System.String? requiredposition: 1
Null on success; an actionable diagnostic on failure (without the copied content).

Returns

True only if the clipboard provider reports success.