aboutsummaryrefslogtreecommitdiff
path: root/modules/core/module-fs.js
diff options
context:
space:
mode:
authorAgando <roduccomm@gmail.com>2026-06-18 18:00:54 +0200
committerAgando <roduccomm@gmail.com>2026-06-18 18:00:54 +0200
commit0eca39021874a673933ebb82b973002b682e7a4b (patch)
treedbfbb685e40d10e6255e68629b72194b23709854 /modules/core/module-fs.js
parentfba6df22dae297c89fa0df065628dddded66c69c (diff)
auto: 2026-06-18_18:00 changes
Diffstat (limited to 'modules/core/module-fs.js')
-rw-r--r--modules/core/module-fs.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/core/module-fs.js b/modules/core/module-fs.js
index ab8fd99..25442eb 100644
--- a/modules/core/module-fs.js
+++ b/modules/core/module-fs.js
@@ -33,6 +33,11 @@ class FileSystemModule {
'download': 'download <file> — Download a file to your device',
'vfs-export': 'vfs-export — Export the entire virtual filesystem as JSON',
'vfs-import': 'vfs-import — Import a previously exported VFS JSON file',
+ 'session-save': 'session-save <name> — Save current session (path + terminal history)',
+ 'session-load': 'session-load <name> — Load a saved session',
+ 'session-list': 'session-list — List all saved sessions',
+ 'session-new': 'session-new — Start a fresh session (auto-saves current, clears AI context)',
+ 'session-delete': 'session-delete <name> — Delete a saved session',
};
}
registerCommands() {
@@ -486,6 +491,18 @@ class FileSystemModule {
this.terminal.print('Session not found: ' + args[0], 'error');
}
};
+ this.commands['session-new'] = () => {
+ // Auto-save current session, clear AI context, fresh terminal
+ this.terminal._autoSaveSession();
+ try { localStorage.removeItem('webx11_ai_context'); } catch(e) {}
+ // Clear terminal output
+ if (this.terminal.outputContainer) this.terminal.outputContainer.innerHTML = '';
+ if (this.terminal._historyBuffer) this.terminal._historyBuffer = [];
+ // Clear AI conversation context
+ const aiMod = this.terminal.moduleManager.modules['WebX11AIAssistantModule'];
+ if (aiMod && aiMod.clearContext) aiMod.clearContext();
+ this.terminal.print('✨ New session started — context cleared', 'success');
+ };
this.commands['session-export'] = (args) => {
if (!args[0]) return this.terminal.print('Usage: session-export <name>', 'warning');
const filePath = '_sessions/' + args[0] + '.json';