{ if (e.state && e.state.cwd) { $cwd = e.state.cwd; $ps1 = `guest@browser:${e.state.cwd}$ `; // Fetch readme for the new directory fetch('/api/config?path=' + encodeURIComponent(e.state.cwd)) .then(r => r.json()) .then(res => { if (res && res.readme) { $readme = renderDocument(res.readme, res.docType || 'markdown'); } }); } }); " >