Skip to content

Commit 3fccdaa

Browse files
committed
docs: update architecture and stack decision for vt100 backend
1 parent c42c4c2 commit 3fccdaa

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎docs/architecture.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ src/
3131
├── backend/
3232
│ ├── mod.rs # TerminalBackend trait
3333
│ ├── tmux.rs # TmuxBackend (tmux -CC control mode)
34-
│ └── pty.rs # PtyBackend (portable-pty + alacritty_terminal)
34+
│ └── pty.rs # PtyBackend (portable-pty + vt100)
3535
├── git/
3636
│ └── diff.rs # git2-based file change detection and diff data
3737
└── input/
@@ -46,18 +46,17 @@ src/
4646

4747
```rust
4848
trait TerminalBackend {
49-
fn create_pane(&mut self) -> PaneId;
49+
fn create_pane(&mut self, rows: u16, cols: u16) -> PaneId;
5050
fn destroy_pane(&mut self, id: PaneId);
51-
fn focus_pane(&mut self, id: PaneId);
5251
fn send_input(&mut self, id: PaneId, data: &[u8]);
53-
fn get_screen(&self, id: PaneId) -> &TerminalScreen;
5452
fn resize(&mut self, id: PaneId, rows: u16, cols: u16);
53+
fn drain_events(&mut self) -> Vec<BackendEvent>;
5554
}
5655
```
5756

5857
- `TmuxBackend`: tmux control mode(`-CC`)로 pane 생성/제어. LLM CLI 출력 완전 재현.
59-
- `PtyBackend`: portable-pty로 PTY 생성, alacritty_terminal로 VT 파싱. tmux 없는 환경 fallback.
60-
- 선택 순서: `which tmux` 성공 → TmuxBackend / 실패 → PtyBackend (경고 출력)
58+
- `PtyBackend`: portable-pty로 PTY 생성, `vt100`으로 VT 파싱. tmux 없는 환경 fallback.
59+
- 선택 순서: `tmux -V` 성공 및 control mode 초기화 성공 → TmuxBackend / 실패 → PtyBackend (경고 출력)
6160

6261
### Git Diff Pipeline
6362

@@ -67,9 +66,10 @@ trait TerminalBackend {
6766

6867
### Keyboard Routing
6968

70-
- **Upper panel focused**: Ratatui app이 모든 키 처리 (파일 탐색, 패널 전환)
69+
- **Upper panel focused**: Ratatui app이 모든 키 처리 (파일 탐색, diff/file subfocus 전환)
7170
- **Lower panel focused**: 키 입력을 active backend의 stdin으로 직접 통과
72-
- **Global shortcuts** (Ctrl+숫자: 터미널 전환, Tab: 상/하단 포커스 전환)는 항상 앱이 먼저 처리
71+
- **Global shortcuts** (`Tab`: 상/하단 포커스 전환, `Ctrl+T`: 터미널 생성, `Ctrl/Alt+숫자`: 터미널 전환)는 항상 앱이 먼저 처리
72+
- **Upper subfocus shortcuts** (`Left`/`Right`/`Shift+Tab`: 파일 리스트와 diff 뷰어 전환)는 상단 포커스에서만 앱이 처리한다.
7373

7474
## Critical Risk
7575

@@ -84,6 +84,6 @@ TmuxBackend에서 tmux prefix key와 앱 단축키 충돌을 명시적으로 처
8484
| TUI 렌더링 | ratatui 0.29 + crossterm |
8585
| Git diff | git2 0.20 |
8686
| 문법 하이라이팅 | syntect 5.3 + syntect-tui |
87-
| PTY 관리 (fallback) | portable-pty 0.9 |
88-
| VT 파싱 (fallback) | alacritty_terminal |
87+
| PTY 관리 (fallback) | portable-pty 0.8 |
88+
| VT 파싱 (fallback) | vt100 |
8989
| 터미널 백엔드 (1순위) | tmux control mode (-CC) |

‎docs/stack-decision.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
## Selected
1616

17-
- "E안: ratatui+crossterm, git2, syntect+syntect-tui, TmuxBackend(tmux control mode)+PtyBackend(portable-pty+alacritty_terminal)"
17+
- "E안: ratatui+crossterm, git2, syntect+syntect-tui, TmuxBackend(tmux control mode)+PtyBackend(portable-pty+vt100)"
1818

1919
## Open Questions
2020

0 commit comments

Comments
 (0)