dwmkerr / dwmkerr/shellwright

feat: record existing terminal session

Open
#49 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
37
Forks
5
Avg merge
3d 23h
Merged PRs (30d)
1

Description

## Summary

Allow shellwright to attach to and record an existing terminal session, rather than spawning a new one.

## Use Case

Currently shellwright spawns processes via `shell_start`. But often you're already running something (claude code, vim, htop) and want to start recording mid-session. This feature would let you attach shellwright to an existing PTY and capture what's happening.

## Proposed Approach

New tool: `shell_attach` or `shell_record_external`

Options:
1. **Attach by PID** - attach to an existing process's PTY
2. **Attach by TTY** - attach to a specific TTY device (e.g., `/dev/ttys001`)
3. **Pipe mode** - shellwright reads from stdin, useful with `script` or `tmux`

## Example Usage

```json
{
"tty": "/dev/ttys001",
"cols": 80,
"rows": 24
}
```

Or integration with `tmux capture-pane` / `script` command.

## Technical Considerations

- Reading from existing PTY requires appropriate permissions
- May need to poll/capture the terminal buffer periodically
- Could leverage `tmux` or `screen` for easier capture
- Alternative: provide a CLI mode where shellwright wraps an existing command

## Alternative: Wrapper Mode

```bash
shellwright wrap -- claude
```

This would be simpler - shellwright spawns the process but the user interacts with it directly in their terminal, while shellwright records in the background.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.