Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions ui/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3116,6 +3116,33 @@ function closeModal() {

// ─── Event Bindings ────────────────────────────────────────
function bindEvents() {
// ─── TERMINAL OUTPUT COPY TO CLIPBOARD ENGINE (#112) ───
const btnCopyTerminal = document.getElementById('btn-copy-terminal');
if (btnCopyTerminal) {
btnCopyTerminal.addEventListener('click', async () => {
const terminalBodyText = document.getElementById('terminal-body');
if (!terminalBodyText) return;

// Extract pure plaintext console strings, ignoring interface widgets
const logContent = terminalBodyText.innerText;

try {
// Safely stream string payload directly into host system clipboard channels
await navigator.clipboard.writeText(logContent);

// Trigger native application notification alert overlay
if (typeof showNotification === 'function') {
showNotification('Terminal logs copied to clipboard!', 'success');
} else if (typeof notify === 'function') {
notify('Terminal logs copied to clipboard!', 'success');
} else {
alert('Terminal logs copied to clipboard!');
}
} catch (err) {
console.error('Failed to copy terminal logs: ', err);
}
});
}
// Terminal Search
const cliSearchInput = document.getElementById('cli-search-input');
if (cliSearchInput) {
Expand Down
9 changes: 9 additions & 0 deletions ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,15 @@ <h2>Scripts</h2>
<span id="cli-search-results"></span>
</div>
<span class="run-status" id="run-status"></span>

<button class="btn-icon" id="btn-copy-terminal" title="Copy Terminal Logs" aria-label="Copy terminal logs">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect>
<path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path>
</svg>
</button>

<button class="btn-icon btn-clear" id="btn-clear" title="Clear Terminal" aria-label="Clear terminal">
<button class="btn-icon btn-clear" id="btn-clear" title="Clear Terminal"
aria-label="Clear terminal">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24"
Expand Down
Loading