diff --git a/frontend/task/LocalWorkDialog.tsx b/frontend/task/LocalWorkDialog.tsx index 778ba681..c7523f7f 100644 --- a/frontend/task/LocalWorkDialog.tsx +++ b/frontend/task/LocalWorkDialog.tsx @@ -21,8 +21,22 @@ export function LocalWorkDialog(props: LocalWorkDialogProps) { const handleFocus = (event) => event.target.select(); + const unsecuredCopyToClipboard = (text: string) => { + const textArea = document.createElement("textarea"); + textArea.value = text; + document.body.appendChild(textArea); + textArea.focus(); + textArea.select(); + try { + document.execCommand('copy'); + } catch (err) { + console.error('Unable to copy to clipboard', err); + } + document.body.removeChild(textArea); + } + const copyCommand = () => { - navigator.clipboard.writeText(shellCommand); + unsecuredCopyToClipboard(shellCommand); setCopied(true); if (timeoutRef.current) { clearTimeout(timeoutRef.current); diff --git a/frontend/task/platform/platform.ts b/frontend/task/platform/platform.ts index 3595b72d..1b0560de 100644 --- a/frontend/task/platform/platform.ts +++ b/frontend/task/platform/platform.ts @@ -93,6 +93,7 @@ export function getTaskMetadata() { }; metadata.autoHeight = true; metadata.disablePlatformProgress = true; + metadata.usesTokens = true; // To receive task token return metadata; }