diff --git a/web/src/client/components/session-list.ts b/web/src/client/components/session-list.ts
index b80f8e25..3fcfc469 100644
--- a/web/src/client/components/session-list.ts
+++ b/web/src/client/components/session-list.ts
@@ -8,6 +8,7 @@ export interface Session {
id: string;
command: string;
workingDir: string;
+ name?: string;
status: 'running' | 'exited';
exitCode?: number;
startedAt: string;
diff --git a/web/src/client/components/session-view.ts b/web/src/client/components/session-view.ts
index 4ff79584..2079a757 100644
--- a/web/src/client/components/session-view.ts
+++ b/web/src/client/components/session-view.ts
@@ -709,9 +709,9 @@ export class SessionView extends LitElement {
- ${this.session.command}
+ ${this.session.name || this.session.command}
{
// Only handle touch pointers that we have captured
- if (e.pointerType !== 'touch' || !this.container!.hasPointerCapture(e.pointerId)) return;
+ if (e.pointerType !== 'touch' || !this.container?.hasPointerCapture(e.pointerId)) return;
const currentY = e.clientY;
const deltaY = lastY - currentY; // Change since last move, not since start
@@ -323,7 +325,7 @@ export class Terminal extends LitElement {
this.isTouchActive = false;
// Release pointer capture
- this.container!.releasePointerCapture(e.pointerId);
+ this.container?.releasePointerCapture(e.pointerId);
// Add momentum scrolling if needed (only after touch scrolling)
if (isScrolling && Math.abs(velocity) > 0.5) {
@@ -338,7 +340,7 @@ export class Terminal extends LitElement {
this.isTouchActive = false;
// Release pointer capture
- this.container!.releasePointerCapture(e.pointerId);
+ this.container?.releasePointerCapture(e.pointerId);
};
// Attach pointer events to the container (touch only)
diff --git a/web/src/server.ts b/web/src/server.ts
index b9779655..dc0d162c 100644
--- a/web/src/server.ts
+++ b/web/src/server.ts
@@ -165,6 +165,7 @@ app.get('/api/sessions', async (req, res) => {
id: sessionId,
command: sessionInfo.cmdline.join(' '),
workingDir: sessionInfo.cwd,
+ name: sessionInfo.name,
status: sessionInfo.status,
exitCode: sessionInfo.exit_code,
startedAt: sessionInfo.started_at,
@@ -188,13 +189,13 @@ app.get('/api/sessions', async (req, res) => {
// Create new session
app.post('/api/sessions', async (req, res) => {
try {
- const { command, workingDir } = req.body;
+ const { command, workingDir, name } = req.body;
if (!command || !Array.isArray(command) || command.length === 0) {
return res.status(400).json({ error: 'Command array is required and cannot be empty' });
}
- const sessionName = `session_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
+ const sessionName = name || `session_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
const cwd = resolvePath(workingDir, process.cwd());
const args = [