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
8 changes: 4 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2566,8 +2566,8 @@ def clear_history():
os.unlink(file_path)
elif os.path.isdir(file_path):
shutil.rmtree(file_path)
except Exception:
pass
except Exception as exc:
logger.warning("Failed to remove execution log entry %s: %s", file_path, exc)

# Clear session logs
if os.path.exists(SESSION_LOG_DIR):
Expand All @@ -2578,8 +2578,8 @@ def clear_history():
os.unlink(file_path)
elif os.path.isdir(file_path):
shutil.rmtree(file_path)
except Exception:
pass
except Exception as exc:
logger.warning("Failed to remove session log entry %s: %s", file_path, exc)

return jsonify({
'success': True,
Expand Down
29 changes: 29 additions & 0 deletions ui/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2468,6 +2468,30 @@ function downloadTerminalLog() {
notify(`Log downloaded as "${filename}".`, 'success');
}

function insertTerminalSessionSplitter() {
const termId = state.activeTerminalId;
const termBody = getTerminalBody(termId);
if (!termBody) {
notify('Active terminal not found.', 'error');
return;
}

const timestamp = new Date().toLocaleTimeString([], {
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
hour12: false
});
const splitter = document.createElement('div');
splitter.className = 'terminal-session-splitter';
splitter.textContent = `Session Marker [${timestamp}]`;
termBody.appendChild(splitter);
splitter.scrollIntoView({ behavior: 'smooth', block: 'end' });
notify(`Session marker added to Terminal ${termId}.`, 'info');
persistWorkspace();
saveSessionDebounced();
}

/**
* Toggles auto-scroll on/off for the active terminal.
* Updates the button appearance to reflect current state.
Expand Down Expand Up @@ -3465,6 +3489,11 @@ function bindEvents() {
btnDownloadLog.addEventListener('click', downloadTerminalLog);
}

const btnInsertSplitter = document.getElementById('btn-insert-splitter');
if (btnInsertSplitter) {
btnInsertSplitter.addEventListener('click', insertTerminalSessionSplitter);
}

const btnAutoscroll = document.getElementById('btn-autoscroll');
if (btnAutoscroll) {
btnAutoscroll.addEventListener('click', toggleAutoScroll);
Expand Down
10 changes: 10 additions & 0 deletions ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,16 @@ <h2>Scripts</h2>
<line x1="12" x2="12" y1="15" y2="3" />
</svg>
</button>
<button class="btn-icon" id="btn-insert-splitter" title="Insert session splitter"
aria-label="Insert terminal session splitter">
<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">
<path d="M4 12h16" />
<path d="M8 8h8" />
<path d="M8 16h8" />
</svg>
</button>
<button class="btn-icon" id="btn-autoscroll" title="Auto-scroll: On"
aria-label="Toggle auto-scroll" aria-pressed="true">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24"
Expand Down
20 changes: 20 additions & 0 deletions ui/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1749,6 +1749,26 @@ body {
color: var(--accent-blue);
}

.terminal-session-splitter {
display: flex;
align-items: center;
gap: 12px;
margin: 18px 0;
color: var(--text-muted);
font-size: 11px;
font-weight: 600;
letter-spacing: 0;
text-transform: uppercase;
user-select: none;
}

.terminal-session-splitter::before,
.terminal-session-splitter::after {
content: "";
flex: 1;
border-top: 1px dashed var(--border);
}

/* Run Status */
.run-status {
font-size: 11px;
Expand Down
Loading