diff --git a/app.py b/app.py index ba877de..25e91c0 100644 --- a/app.py +++ b/app.py @@ -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): @@ -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, diff --git a/ui/app.js b/ui/app.js index bf7725b..bce6e4f 100644 --- a/ui/app.js +++ b/ui/app.js @@ -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. @@ -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); diff --git a/ui/index.html b/ui/index.html index 58399eb..56de51b 100644 --- a/ui/index.html +++ b/ui/index.html @@ -330,6 +330,16 @@

Scripts

+