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
5 changes: 3 additions & 2 deletions src/plugin/pty/output-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import type { PTYSession, ReadResult, SearchResult } from './types.ts'

export class OutputManager {
write(session: PTYSession, data: string): boolean {
if (session.status !== 'running' || !session.process) return false
try {
session.process?.write(data)
session.process.write(data)
return true
} catch {
return true // allow write to exited process for tests
return false
}
}

Expand Down
3 changes: 2 additions & 1 deletion test/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ describe('Web Server Integration', () => {
}
)

expect(response.status).toBe(400)
const result = await response.json()
expect(result).toHaveProperty('success')
expect(result).toEqual({ error: 'Failed to write to session' })

const errorPromise = new Promise((resolve) => {
managedTestClient.errorCallbacks.push((message) => {
Expand Down