@ictechgy/lterm 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.ko.md +42 -31
  2. package/README.md +28 -23
  3. package/package.json +5 -5
package/README.ko.md CHANGED
@@ -4,19 +4,15 @@
4
4
 
5
5
  ## TL;DR
6
6
 
7
- - **무엇** — Rust로 만든 PTY 세션 데몬 + tmux 호환 shim. 이름이나 pane id로 detach·reattach할 수 있는 영속 세션을 제공합니다.
8
- - **대상** — Claude Code, Codex CLI, Gemini CLI, `oh-my-codex` / `oh-my-claude` 같은 terminal-first coding agent와, 그것을 `cmux` 안에서 돌리는 사용자.
7
+ - **무엇** — tmux 같은 영속 터미널 세션 데몬을 작게 만든 도구. AI 에이전트 도구를 위한 tmux 호환 명령 계층을 제공하며, 세션을 이름이나 pane id로 detach·reattach할 수 있습니다.
8
+ - **대상** — Claude Code, Codex CLI, Gemini CLI, `oh-my-codex` / `oh-my-claude` 같은 terminal-first coding agent 쓰는 사용자와, 이를 `cmux` 안에서 실행하는 사용자.
9
9
  - **사용법** — `lterm start`로 만들고 `lterm resume`으로 (재)접속, shim이 적용된 agent 실행에는 `lterm agent <profile>` / `lterm claude` / `lterm codex` / `lterm gemini`. tmux가 켜진 세션 안에서는 `tmux` 명령이 `lterm tmux-compat`으로 해석됩니다.
10
- - **상태** — alpha MVP. 같은 OS 사용자 안에서 쓰는 편의용 데몬이며, **샌드박스도 escape-sequence sanitizer 완전한 tmux 대체품도 아닙니다.**
10
+ - **상태** — alpha MVP. 같은 OS 사용자 안에서 쓰는 편의용 데몬이며, **샌드박스, escape-sequence sanitizer, 완전한 tmux 대체품 모두 아닙니다.**
11
11
 
12
12
  ---
13
13
 
14
- AI 에이전트 워크플로를 위해 만든 가벼운 터미널 세션 데몬입니다. tmux 호환 shim을 함께 제공합니다.
15
-
16
14
  `lterm`은 tmux 전체를 대체하려는 도구가 아닙니다. 오래 실행되는 PTY 세션을 유지하고, 클라이언트가 자유롭게 detach/reattach할 수 있게 하며, 터미널 escape sequence는 그대로 통과시키고, terminal-first agent 도구가 자주 사용하는 tmux 명령 일부를 호환 shim으로 제공합니다.
17
15
 
18
- > **상태:** alpha MVP. 로컬 detached 세션과 호환성 테스트에는 사용할 수 있지만, 아직 완전한 tmux 대체품은 아닙니다.
19
- >
20
16
  > **보안 모델:** `lterm`은 같은 OS 사용자 안에서 쓰는 편의용 데몬이며 샌드박스가 아닙니다. 다른 사용자의 Unix socket 접근은 거부하고 런타임 디렉터리는 소유자 전용 권한으로 만들지만, 같은 OS 사용자 권한으로 실행되는 프로세스는 세션을 제어할 수 있다고 보아야 합니다.
21
17
 
22
18
  ## 왜 만들었나
@@ -27,7 +23,7 @@ AI 에이전트 워크플로를 위해 만든 가벼운 터미널 세션 데몬
27
23
  2. **cmux 호환성** — cmux 안에서 실행할 때는 OSC 알림을 그대로 통과시키고 `lterm notify`를 제공하며, tmux shim은 가능한 경우 worker pane을 cmux native split으로 엽니다.
28
24
  3. **AI 도구 지원** — `lterm agent <profile>`, `lterm claude`, `lterm codex`, `lterm gemini`, `lterm omx`, `lterm omc`, `lterm install-shim`은 tmux를 전제하는 agent 도구를 위해 가짜 `tmux` 명령과 `TMUX` / `TMUX_PANE` 환경 변수를 제공합니다.
29
25
 
30
- cmux 호환 동작은 cmux가 문서화한 기능을 따릅니다. cmux는 `cmux notify`와 OSC 777 / OSC 99 알림, workspace/split을 위한 Unix socket·CLI API, 그리고 tmux 명령을 cmux pane으로 매핑하는 oh-my-codex 통합을 제공합니다.
26
+ cmux 호환 동작은 cmux가 문서화한 기능을 따릅니다. cmux는 `cmux notify`와 OSC 777 / OSC 99 알림, workspace/split을 위한 Unix socket·CLI API, 그리고 tmux 명령을 cmux native pane으로 매핑하는 tmux shim 모델을 문서화하고 있습니다.
31
27
 
32
28
  ## 설치
33
29
 
@@ -43,13 +39,15 @@ brew install ictechgy/tap/lterm
43
39
  npm install -g @ictechgy/lterm
44
40
  ```
45
41
 
46
- GitHub에서 Cargo로 설치:
42
+ Homebrew와 npm 모두 `PATH`에 `lterm` 명령을 설치합니다. `lterm --version`으로 확인하세요.
43
+
44
+ GitHub에서 Cargo로 설치 (Releases 페이지의 최신 태그를 사용하세요):
47
45
 
48
46
  ```bash
49
- cargo install --git https://github.com/ictechgy/light_terminal --tag v0.1.0
47
+ cargo install --git https://github.com/ictechgy/light_terminal --tag v0.1.2
50
48
  ```
51
49
 
52
- 체크아웃에서 직접 빌드하려면 Rust 1.85 이상이 필요합니다.
50
+ 저장소를 클론한 직접 빌드하려면 Rust 1.85 이상이 필요합니다.
53
51
 
54
52
  ```bash
55
53
  cargo build --release --locked
@@ -91,7 +89,7 @@ lterm a api
91
89
  lterm -a api
92
90
  ```
93
91
 
94
- **Agent terminal 명령어 어휘:**
92
+ **Agent terminal 명령어:**
95
93
 
96
94
  | 작업 | 일반 명령 | 호환 이름 |
97
95
  | --- | --- | --- |
@@ -100,29 +98,29 @@ lterm -a api
100
98
  | 세션 열기 또는 생성 | `lterm open main` | `attach-or-new` |
101
99
  | 기존 세션 재개 | `lterm resume api` | `attach`, `a`, `-a` |
102
100
  | 세션 목록 보기 | `lterm sessions` | `list`, `ls` |
103
- | 프로세스 트리 확인 | `lterm processes api --json` | `ps` |
104
- | 정제된 scrollback 읽기 | `lterm logs api --start=-80` | `capture` |
101
+ | 프로세스 트리 확인 | `lterm processes api --json --orphans` | `ps` |
102
+ | 세션 이름 변경 | `lterm rename api api-renamed` | 없음 |
103
+ | 정제된 scrollback 읽기 | `lterm logs api --start=-80 --end=-1` | `capture` |
105
104
  | PTY에 입력 쓰기 | `lterm input api 'echo hello' --enter` | `send` |
106
105
  | 세션 종료 | `lterm close api` | `kill` |
107
- | background daemon 명시 실행 | `lterm daemon` | 없음 |
108
- | daemon과 모든 세션 종료 | `lterm shutdown` | 없음 |
106
+ | 데몬과 shim 상태 진단 | `lterm doctor --json` | `status` |
107
+ | 백그라운드 데몬 명시 실행 | `lterm daemon` | 없음 |
108
+ | 데몬과 모든 세션 종료 | `lterm shutdown` | 없음 |
109
109
 
110
- 주변 agent/shim 유틸리티도 제품 CLI 명령이며, tmux alias가 아닙니다:
110
+ 에이전트·shim 유틸리티도 제품 CLI 명령이며, tmux alias가 아닙니다:
111
111
 
112
112
  | 작업 | 제품 명령 | 호환 경계 |
113
113
  | --- | --- | --- |
114
114
  | profile 기반 agent 세션 실행 | `lterm agent claude -- --help` | sibling shortcuts: `lterm claude`, `lterm codex`, `lterm gemini`, `lterm omx`, `lterm omc` |
115
- | 사용 가능한 agent profile 확인 | `lterm agents --json` | 실행 시점의 PATH availability probe |
115
+ | 사용 가능한 agent profile 확인 | `lterm agents --json` | 실행 시점의 `PATH` 사용 가능 여부 확인 |
116
116
  | `tmux` 호환 shim 설치 | `lterm install-shim` | `lterm tmux-compat`으로 전달하는 shim 생성 |
117
- | tmux 호환 shell export 출력 | `eval "$(lterm env)"` | 신뢰할 있는 shell setup용 고정 `export` 행; 생성 path는 `shlex` quoting 기반의 유효한 POSIX shell token이며 `PATH`는 shim dir을 기존 `$PATH` 앞에 추가 |
118
- | cmux-friendly 알림 보내기 | `lterm notify --title 'Done' --body 'Tests passed'` | OSC 777 fallback은 C0 whitespace control `\n`, `\r`, `\t`를 제외한 Unicode control을 제거하고, 이 세 control과 semicolon은 공백으로 바꾸며, `U+007F`/`U+0080..U+009F`는 제거하고, control이 아닌 Unicode text는 보존 |
119
- | 원격 호스트에 attach | `lterm ssh user@host main` | 신뢰할 수 있는 host에서만 사용; host-key 확인은 SSH가 처리하고 remote PTY bytes는 정제 없이 pass-through |
117
+ | tmux 호환 shell export 출력 | `eval "$(lterm env)"` | shim dir을 `$PATH` 앞에 추가하는 신뢰된 `export` 출력 |
118
+ | cmux-friendly 알림 보내기 | `lterm notify --title 'Done' --body 'Tests passed'` | OSC 777 fallback은 터미널 제어 문자를 제거하고 Unicode text는 보존 |
119
+ | 원격 호스트에 attach | `lterm ssh user@host main` | 신뢰할 수 있는 host에서만 사용; host-key 확인은 SSH가 처리하고 remote PTY bytes는 정제 없이 전달 |
120
120
  | tmux shim namespace 직접 호출 | `lterm tmux-compat list-commands` | 제품 alias 표가 아니라 호환 namespace |
121
121
 
122
- `lterm env`는 `PATH`의 `lterm` binary를 신뢰할 수 있을 때만 `eval`
123
- 용도로 사용하세요. smoke test는 export-only 출력과 space, `$`, `'`가
124
- 포함된 생성 path가 POSIX shell token으로 round-trip되는지, 그리고 shim
125
- directory가 기존 `$PATH`를 대체하지 않고 앞에 추가되는지 검증합니다.
122
+ `eval "$(lterm env)"`는 `PATH`의 `lterm` binary를 신뢰할 수 있을 때만 사용하세요.
123
+ 명령은 shim directory를 `$PATH` 앞에 추가하는 고정 `export` 행을 출력합니다.
126
124
 
127
125
  `lterm ssh`는 remote PTY bytes를 local terminal로 정제 없이 전달하므로,
128
126
  compromised remote는 local terminal emulator가 허용하는 control sequence를
@@ -141,11 +139,17 @@ escape 처리가 여기에 포함됩니다. 직접 `ssh`하듯 신뢰할 수 있
141
139
 
142
140
  `lterm sessions`는 기본적으로 하위 pane을 숨기고, 기존 첫 5개 tab-separated 열(`name`, `pane`, `alive`, `cwd`, `command`)을 유지한 뒤 attach 상태(`attached` / `detached`)와 parent pane(`-` 또는 pane id)을 뒤에 붙입니다. 호환 이름인 `lterm list`와 `lterm ls`도 같은 출력 형식을 유지합니다. attach된 클라이언트는 아래쪽 한 줄에 파란 상태 바를 표시하고, PTY는 그 줄을 제외한 영역으로 resize됩니다. 예전처럼 전체 터미널을 raw 모드로 재개하려면 `lterm resume --no-status api`(호환 이름: `lterm attach --no-status api`)를 쓰거나, 상태줄 처리가 충돌하는 클라이언트에서는 `LTERM_NO_STATUS=1` / `LTERM_STATUS=0`을 설정하세요.
143
141
 
142
+ `lterm rename <target> <new-name>`은 실행 중인 세션의 프로세스를 재시작하지 않고 이름만 바꿉니다. 현재 이름과 동일한 이름으로 바꾸면 no-op success이고, 다른 세션이 이미 쓰는 이름으로 바꾸면 conflict error로 실패합니다. `<target>`은 세션 이름, session id, pane id(`%0`), 또는 bare pane 번호(`0`)를 받으며, `<new-name>`은 `--name`과 같은 이름 규칙을 따릅니다.
143
+
144
+ `lterm doctor`(호환 이름: `lterm status`)는 client/daemon version, protocol 호환성, runtime/data/socket/shim path, shim directory가 `PATH`에 있는지 등을 보고합니다. 이 명령은 daemon을 시작하지 않습니다. 현재 socket에서 호환 daemon이 응답하지 않으면 `daemon_reachable=no` / `false`로 표시됩니다. 일반 client 동작 중 접근 가능한 daemon이 다른 lterm 또는 protocol version을 보고하면 stderr에 경고를 출력하며, 보통 binary upgrade 뒤 예전 daemon이 살아 있는 상황을 뜻합니다.
145
+
146
+ `lterm logs <target>`은 `--start` / `-S`와 `--end` / `-E` line offset을 받습니다. 0 이상의 값은 absolute scrollback line index이고, 음수 값은 현재 scrollback line count에서 뒤로 셉니다. `--end`는 inclusive라 `lterm logs api -S0 -E0`은 첫 번째 줄만 capture합니다. Capture 출력은 계속 정제된 text이며, attach된 PTY stream은 raw 그대로 유지됩니다.
147
+
144
148
  `LTERM_STATUS_STYLE=full` 또는 `LTERM_STATUS_STYLE=minimal` 로 시각 스타일을 선택할 수 있습니다. `full`(로컬 터미널 기본값)은 검정 글자 + bright-blue 배경, `minimal`은 SGR 색을 모두 생략한 plain text로 동작합니다. SSH 세션(`SSH_CONNECTION` / `SSH_CLIENT` / `SSH_TTY` 감지)에서는 자동으로 `minimal`이 적용되어 Termius 같은 모바일 SSH 클라이언트의 색 충돌을 줄입니다.
145
149
 
146
150
  attach된 PTY가 alternate screen buffer로 진입하면(예: `vim`, `less`, `htop`이 `\x1b[?1049h` 사용) lterm은 status bar를 일시 중단해 alt-screen 앱의 UI와 충돌을 피합니다. 앱이 alt-screen을 종료하는 즉시 status bar가 다시 그려집니다.
147
151
 
148
- `lterm resume` / `lterm attach` 도중 panic 이나 abort 가 발생해도 process-wide hook 이 최소 복구 sequence (scroll region 리셋, 커서 보이기, alt-screen 종료, SGR 리셋) 를 emit 해 사용자 터미널이 raw mode 나 hidden cursor 상태로 남지 않습니다.
152
+ `lterm resume` / `lterm attach` 도중 panic이나 abort가 발생해도 process-wide hook이 최소 복구 sequence(scroll region 리셋, 커서 보이기, alt-screen 종료, SGR 리셋)를 emit해 사용자 터미널이 raw mode나 hidden cursor 상태로 남지 않습니다.
149
153
 
150
154
  CJK 문자나 이모지(ZWJ family, 국기, 결합 문자 포함)가 들어간 세션 이름은 `unicode-width` / `unicode-segmentation` 으로 디스플레이 폭을 계산해 정렬되므로 wide character가 섞여도 status bar 패딩이 어긋나지 않습니다.
151
155
 
@@ -153,12 +157,14 @@ child 애플리케이션이 `CSI u` enhancement sequence로 Kitty keyboard proto
153
157
 
154
158
  **세션 확인 및 제어:**
155
159
 
160
+ `--children`는 관리되는 자식 pane을 포함하고, `--all`은 기본 목록에서 숨겨지는 세션까지 포함합니다.
161
+
156
162
  ```bash
157
163
  lterm sessions
158
164
  lterm sessions --children
159
165
  lterm sessions --all
160
- lterm processes api
161
- lterm logs api --start=-80
166
+ lterm processes api --orphans
167
+ lterm logs api --start=-80 --end=-1
162
168
  lterm input api 'echo hello' --enter
163
169
  ```
164
170
 
@@ -218,7 +224,7 @@ Claude/Codex/Gemini profile은 각 도구의 자체 TUI/status/alternate-screen
218
224
  launcher 제어 옵션은 agent의 흔한 short flag(`-c` 등)를 빼앗지 않도록 long-only(`--name`, `--cwd`, `--detach`, `--status`, `--no-status`)입니다. 이 옵션들은 `claude`, `codex`, `gemini`, `omx`, `omc`, `agent <profile>`에 동일하게 적용됩니다.
219
225
  `--detach`는 각 field의 control character와 Unicode line/paragraph separator를 공백으로 바꾼 `name<TAB>pane<TAB>command`를 출력하며, 나중에 `lterm resume <name>` 또는 호환 이름 `lterm attach <name>`으로 다시 붙으면 됩니다. detach record에는 `--cwd`가 포함되지 않으므로 나중에 필요하면 session을 조회하세요.
220
226
  명시한 `--name`은 lterm의 일반 session-name 문법을 따르고 사용 중이지 않아야 합니다. 충돌 시 자동 suffix를 붙이지 않고 conflict error로 실패합니다.
221
- 이름에는 ASCII 문자/숫자와 `.`, `_`, `-`만 사용할 수 있고, `-` 또는 `%`로 시작할 수 없으며, UUID처럼 보이면 안 되고, 128바이트를 넘을 수 없습니다.
227
+ 이름에는 ASCII 문자/숫자와 `.`, `_`, `-`만 사용할 수 있고, `-` 또는 `%`로 시작할 수 없으며, 숫자만으로 이뤄질 수 없고, UUID처럼 보이면 안 되고, 128바이트를 넘을 수 없습니다.
222
228
  `lterm agents` 또는 `lterm agents --json`으로 profile 기본값과 현재 `PATH`에서 binary를 찾을 수 있는지 확인할 수 있습니다. JSON row의 `kind` 값은 `built-in`, `custom`, `configured` 중 하나입니다. `lterm agents codex my-agent --json`처럼 profile 이름을 넘기면 선택한 built-in/custom/configured profile만 확인합니다. availability는 실행 시점의 PATH probe입니다.
223
229
  반복해서 쓰는 custom alias는 명시적인 JSON config 파일로 넘길 수 있습니다.
224
230
 
@@ -260,7 +266,7 @@ lterm run -- codex exec "저장소를 요약해줘"
260
266
 
261
267
  이 세션 안에서는 `tmux`가 `lterm tmux-compat` shim으로 해석됩니다. 이 shim은 호환 계층이지 모든 `lterm` 제품 명령의 두 번째 철자가 아닙니다. 현재 shim은 AI orchestration 스크립트가 자주 사용하는 다음 명령 subset을 구현합니다.
262
268
 
263
- - **세션** — `new-session`, `attach-session`, `has-session`, `list-sessions`, `kill-session`
269
+ - **세션** — `new-session`, `attach-session`, `has-session`, `list-sessions`, `rename-session`, `kill-session`
264
270
  - **조회** — `list-windows`, `list-clients`, `list-commands`, `show-options`, `show-window-options`
265
271
  - **Pane** — `split-window`, `list-panes`, `display-message`, `capture-pane`, `send-keys`, `kill-pane`, `resize-pane`
266
272
  - **Buffer / popup** — `display-popup`, `wait-for`, `load-buffer`, `save-buffer`, `paste-buffer`
@@ -269,6 +275,11 @@ lterm run -- codex exec "저장소를 요약해줘"
269
275
  호환성 참고: lterm은 각 root session을 하나의 pseudo-window로 모델링합니다
270
276
  (`window_index=0`, `window_panes=1`). lterm은 client별 process/TTY metadata를
271
277
  노출하지 않기 때문에 `client_pid`와 `client_tty`는 빈 문자열로 확장됩니다.
278
+ `lterm tmux-compat list-commands --verbose`는 `command`, alias, support tier,
279
+ usage를 tab-separated로 출력하고, `--json`은 machine-readable row를 출력합니다.
280
+ Support tier는 lterm compatibility boundary 안에서 `full`, `partial`, `noop`
281
+ 중 하나입니다. `LTERM_DEBUG_TMUX=1`을 설정하면 지원하지 않는 tmux command가
282
+ shim에 도달했을 때 opt-in stderr diagnostic row를 출력합니다.
272
283
  tmux `-f` filter는 조용히 무시하지 않고 의도적으로 거부합니다.
273
284
 
274
285
  ## cmux 동작
@@ -321,7 +332,7 @@ lterm ssh devbox main -- -p 2222 -i ~/.ssh/id_ed25519
321
332
 
322
333
  **Capture 출력은 사람/AI가 읽기 쉽도록 정제됩니다.** `lterm logs`(호환 이름: `lterm capture`)와 `tmux capture-pane`은 captured scrollback을 출력할 때 일반적인 터미널 제어 시퀀스를 제거합니다.
323
334
 
324
- **프로세스 가시성.** `lterm processes [session]`(호환 이름: `lterm ps [session]`)은 각 세션 child 아래의 process tree를 보여 줍니다. Codex/OMX/MCP subprocess가 누적되어 메모리 누수처럼 커지기 전에 확인하는 용도입니다. 시스템 `ps`는 절대 경로로 호출하며, 형식이 잘못된 process row는 추측하지 않고 건너뜁니다.
335
+ **프로세스 가시성.** `lterm processes [session]`(호환 이름: `lterm ps [session]`)은 process-group id와 함께 각 세션 child 아래의 process tree를 보여 줍니다. `--orphans`를 추가하면 기록된 session root의 descendant가 아니지만 같은 process group에 남아 있는 row도 함께 보여 주므로, Codex/OMX/MCP subprocess가 누적되어 메모리 누수처럼 커지기 전에 확인할 있습니다. 시스템 `ps`는 절대 경로로 호출하며, 형식이 잘못된 process row는 추측하지 않고 건너뜁니다.
325
336
 
326
337
  **Socket 위치.** 커스텀 `LTERM_SOCKET` 경로는 소유자 전용 디렉터리 안에 있어야 합니다. 격리된 socket 위치가 필요할 때는 `LTERM_RUNTIME_DIR`를 우선 사용하세요.
327
338
 
package/README.md CHANGED
@@ -4,19 +4,15 @@
4
4
 
5
5
  ## TL;DR
6
6
 
7
- - **What** — A Rust-based PTY session daemon with a tmux-compatible shim. Persistent sessions you can detach and reattach by name or pane id.
7
+ - **What** — A persistent terminal session daemon (like tmux, but smaller) with a tmux-compatible command layer for AI agent tooling. Detach and reattach by name or pane id.
8
8
  - **Who it's for** — Terminal-first coding agents such as Claude Code, Codex CLI, Gemini CLI, `oh-my-codex` / `oh-my-claude`, and users running them inside `cmux`.
9
9
  - **How** — `lterm start` to create, `lterm resume` to (re)connect, `lterm agent <profile>` / `lterm claude` / `lterm codex` / `lterm gemini` for shimmed agent runs. Inside a tmux-enabled session, the `tmux` command resolves to `lterm tmux-compat`.
10
10
  - **Status** — alpha MVP. A same-user convenience daemon — **not** a sandbox, an escape-sequence sanitizer, or a full tmux replacement.
11
11
 
12
12
  ---
13
13
 
14
- A lightweight terminal session daemon with a tmux-compatible shim, built for AI-agent workflows.
15
-
16
14
  `lterm` is intentionally smaller than tmux. It keeps long-running PTY sessions alive, lets clients detach and reattach at will, forwards terminal escape sequences unchanged, and translates the subset of tmux commands commonly used by terminal-first agent tooling.
17
15
 
18
- > **Status:** alpha MVP. Usable for local detached sessions and compatibility testing — not yet a full tmux replacement.
19
- >
20
16
  > **Security model:** `lterm` is a same-user convenience daemon, not a sandbox. It rejects cross-user Unix-socket peers and uses owner-only runtime directories, but any process running as your OS user should be considered capable of controlling your sessions.
21
17
 
22
18
  ## Why this exists
@@ -43,10 +39,12 @@ With npm on supported macOS/Linux platforms:
43
39
  npm install -g @ictechgy/lterm
44
40
  ```
45
41
 
46
- With Cargo from GitHub:
42
+ Homebrew and npm both install the `lterm` command on your `PATH`; verify with `lterm --version`.
43
+
44
+ With Cargo from GitHub (use the latest tag from the Releases page):
47
45
 
48
46
  ```bash
49
- cargo install --git https://github.com/ictechgy/light_terminal --tag v0.1.0
47
+ cargo install --git https://github.com/ictechgy/light_terminal --tag v0.1.2
50
48
  ```
51
49
 
52
50
  From this checkout, use Rust 1.85 or newer:
@@ -100,31 +98,29 @@ lterm -a api
100
98
  | Open or create a session | `lterm open main` | `attach-or-new` |
101
99
  | Resume an existing session | `lterm resume api` | `attach`, `a`, `-a` |
102
100
  | List sessions | `lterm sessions` | `list`, `ls` |
103
- | Inspect process trees | `lterm processes api --json` | `ps` |
104
- | Read sanitized scrollback | `lterm logs api --start=-80` | `capture` |
101
+ | Inspect process trees | `lterm processes api --json --orphans` | `ps` |
102
+ | Rename a session | `lterm rename api api-renamed` | None |
103
+ | Read sanitized scrollback | `lterm logs api --start=-80 --end=-1` | `capture` |
105
104
  | Write input to a PTY | `lterm input api 'echo hello' --enter` | `send` |
106
105
  | Stop a session | `lterm close api` | `kill` |
106
+ | Diagnose daemon and shim state | `lterm doctor --json` | `status` |
107
107
  | Run the background daemon explicitly | `lterm daemon` | None |
108
108
  | Stop the daemon and all sessions | `lterm shutdown` | None |
109
109
 
110
- Adjacent agent/shim utility commands are also product CLI commands, not tmux
111
- aliases:
110
+ Agent and shim utilities are also product CLI commands, not tmux aliases:
112
111
 
113
112
  | Task | Product command | Compatibility boundary |
114
113
  | --- | --- | --- |
115
114
  | Launch a profiled agent session | `lterm agent claude -- --help` | Sibling shortcuts: `lterm claude`, `lterm codex`, `lterm gemini`, `lterm omx`, `lterm omc` |
116
115
  | Inspect available agent profiles | `lterm agents --json` | PATH availability probe at command runtime |
117
116
  | Install the `tmux` compatibility shim | `lterm install-shim` | Creates a shim that forwards to `lterm tmux-compat` |
118
- | Print shell exports for tmux compatibility | `eval "$(lterm env)"` | Fixed `export` lines for trusted shell setup; generated paths are valid POSIX shell tokens from `shlex` quoting, and `PATH` prepends the shim dir to `$PATH` |
119
- | Send a cmux-friendly notification | `lterm notify --title 'Done' --body 'Tests passed'` | OSC 777 fallback drops Unicode controls except the C0 whitespace controls `\n`, `\r`, and `\t`, replaces those controls and semicolons with spaces, drops `U+007F`/`U+0080..U+009F`, and preserves non-control Unicode text |
117
+ | Print shell exports for tmux compatibility | `eval "$(lterm env)"` | Emits trusted `export` lines that prepend the shim dir to `$PATH` |
118
+ | Send a cmux-friendly notification | `lterm notify --title 'Done' --body 'Tests passed'` | OSC 777 fallback strips terminal controls while preserving Unicode text |
120
119
  | Attach to a remote host | `lterm ssh user@host main` | Use trusted hosts; SSH handles host-key checks, and remote PTY bytes pass through without sanitization |
121
120
  | Call the tmux shim namespace directly | `lterm tmux-compat list-commands` | Compatibility namespace, not a product alias table |
122
121
 
123
- `lterm env` is meant for `eval` only when you trust the `lterm` binary on
124
- your `PATH`; its smoke coverage requires export-only output, verifies that
125
- generated paths containing spaces, `$`, and `'` round-trip as POSIX shell tokens,
126
- and confirms the shim directory extends the existing `$PATH` rather than
127
- replacing it.
122
+ Use `eval "$(lterm env)"` only when you trust the `lterm` binary on your `PATH`.
123
+ It emits fixed `export` lines that prepend the shim directory to `$PATH`.
128
124
 
129
125
  `lterm ssh` forwards remote PTY bytes to the local terminal without sanitizing
130
126
  terminal control sequences, so a compromised remote can drive terminal features
@@ -142,6 +138,12 @@ This table is the product CLI surface for humans and agents. `lterm tmux-compat
142
138
 
143
139
  `lterm sessions` hides child panes by default, preserves the original first five tab-separated columns (`name`, `pane`, `alive`, `cwd`, `command`), then appends attach state (`attached` / `detached`) and parent pane (`-` or a pane id). The compatibility names `lterm list` and `lterm ls` keep the same output shape. Attached clients render a small blue status bar on the bottom row showing the current session and pane; the PTY is resized to the remaining rows. For the older raw full-terminal resume, use `lterm resume --no-status api` (or compatibility name `lterm attach --no-status api`), or set `LTERM_NO_STATUS=1` / `LTERM_STATUS=0` for clients whose status-line handling conflicts with lterm.
144
140
 
141
+ `lterm rename <target> <new-name>` renames a running session without restarting its process. Renaming a session to its current name is a no-op success, while renaming over a different in-use name fails with a conflict error. `<target>` accepts a session name, session id, pane id (`%0`), or bare pane number (`0`); `<new-name>` follows the same syntax rules as `--name`.
142
+
143
+ `lterm doctor` (compatibility name: `lterm status`) reports client/daemon versions, protocol compatibility, runtime/data/socket/shim paths, and whether the shim directory is on `PATH`. It does not start the daemon; `daemon_reachable=no` / `false` means no compatible daemon answered on the current socket. Normal client operations warn on stderr when a reachable daemon reports a different lterm or protocol version, which usually means an old daemon survived a binary upgrade.
144
+
145
+ `lterm logs <target>` accepts `--start` / `-S` and `--end` / `-E` line offsets. Non-negative values are absolute scrollback line indexes; negative values count back from the current scrollback line count. `--end` is inclusive, so `lterm logs api -S0 -E0` captures only the first line. Capture output remains sanitized text; attached PTY streams remain raw.
146
+
145
147
  Set `LTERM_STATUS_STYLE=full` or `LTERM_STATUS_STYLE=minimal` to choose the visual style. `full` (default for local terminals) shows black text on a bright-blue background; `minimal` drops all SGR colors in favor of plain text. SSH sessions (detected via `SSH_CONNECTION`, `SSH_CLIENT`, or `SSH_TTY`) default to `minimal` to avoid color-mapping issues on mobile SSH clients like Termius.
146
148
 
147
149
  When the attached PTY enters the alternate screen buffer (e.g. `vim`, `less`, `htop` via `\x1b[?1049h`), lterm suspends its status bar to avoid conflicting with the application's UI. The status bar is redrawn immediately when the application exits alt-screen.
@@ -154,12 +156,14 @@ When a child application enables the Kitty keyboard protocol through `CSI u` enh
154
156
 
155
157
  **Inspect or control a session:**
156
158
 
159
+ `--children` includes managed child panes; `--all` includes sessions that are normally hidden from the default list.
160
+
157
161
  ```bash
158
162
  lterm sessions
159
163
  lterm sessions --children
160
164
  lterm sessions --all
161
- lterm processes api
162
- lterm logs api --start=-80
165
+ lterm processes api --orphans
166
+ lterm logs api --start=-80 --end=-1
163
167
  lterm input api 'echo hello' --enter
164
168
  ```
165
169
 
@@ -219,7 +223,7 @@ Known Claude/Codex/Gemini profiles default to a raw full-terminal attach without
219
223
  Launcher controls are long-only (`--name`, `--cwd`, `--detach`, `--status`, `--no-status`) so common agent short flags such as `-c` pass through naturally. They apply uniformly to `claude`, `codex`, `gemini`, `omx`, `omc`, and `agent <profile>`.
220
224
  `--detach` prints `name<TAB>pane<TAB>command` with control characters and Unicode line/paragraph separators in each field replaced by spaces; resume later with `lterm resume <name>` or compatibility name `lterm attach <name>`. The detach record does not echo `--cwd`; query the session if you need to inspect it later.
221
225
  Explicit `--name` values use lterm's normal session-name syntax and must be free; they do not auto-suffix on conflict, so an in-use name fails with a conflict error.
222
- Names may contain ASCII letters, digits, `.`, `_`, and `-`, must not start with `-` or `%`, must not look like a UUID, and are limited to 128 bytes.
226
+ Names may contain ASCII letters, digits, `.`, `_`, and `-`, must not start with `-` or `%`, must not consist only of digits, must not look like a UUID, and are limited to 128 bytes.
223
227
  Use `lterm agents` (or `lterm agents --json`) to inspect profile defaults and whether their binaries are currently available in `PATH`. JSON rows use `kind` values of `built-in`, `custom`, or `configured`. Pass profile names, such as `lterm agents codex my-agent --json`, to inspect a selected built-in/custom/configured set; availability is a point-in-time PATH probe.
224
228
  For reusable custom aliases, pass an explicit JSON config file:
225
229
 
@@ -261,7 +265,7 @@ lterm run -- codex exec "summarize the repository"
261
265
 
262
266
  Inside that session, `tmux` resolves to the `lterm tmux-compat` shim. This is a compatibility layer, not a second spelling of every `lterm` product command. The shim implements the command subset most AI orchestration scripts rely on:
263
267
 
264
- - **Sessions** — `new-session`, `attach-session`, `has-session`, `list-sessions`, `kill-session`
268
+ - **Sessions** — `new-session`, `attach-session`, `has-session`, `list-sessions`, `rename-session`, `kill-session`
265
269
  - **Queries** — `list-windows`, `list-clients`, `list-commands`, `show-options`, `show-window-options`
266
270
  - **Panes** — `split-window`, `list-panes`, `display-message`, `capture-pane`, `send-keys`, `kill-pane`, `resize-pane`
267
271
  - **Buffers / popups** — `display-popup`, `wait-for`, `load-buffer`, `save-buffer`, `paste-buffer`
@@ -271,6 +275,7 @@ Compatibility notes: lterm models each root session as one pseudo-window
271
275
  (`window_index=0`, `window_panes=1`). `client_pid` and `client_tty` expand to
272
276
  empty strings because lterm does not expose per-client process or TTY metadata.
273
277
  tmux `-f` filters are intentionally rejected instead of being silently ignored.
278
+ Use `lterm tmux-compat list-commands --verbose` for tab-separated `command`, alias, support tier, and usage fields, or `--json` for machine-readable rows. Support tiers are `full`, `partial`, and `noop` within lterm's compatibility boundary. Set `LTERM_DEBUG_TMUX=1` to emit an opt-in stderr diagnostic row when an unsupported tmux command reaches the shim.
274
279
 
275
280
  ## cmux behavior
276
281
 
@@ -322,7 +327,7 @@ the old code until they are stopped.
322
327
 
323
328
  **Capture output is sanitized for human/AI consumption.** `lterm logs` (compatibility name: `lterm capture`) and `tmux capture-pane` strip common terminal control sequences before printing scrollback.
324
329
 
325
- **Process visibility.** `lterm processes [session]` (or compatibility name `lterm ps [session]`) shows the process tree rooted at each session child, so long-running Codex/OMX/MCP subprocess buildup stays visible before it becomes a memory-leak surprise. The system `ps` is invoked by absolute path, and malformed process rows are skipped rather than guessed at.
330
+ **Process visibility.** `lterm processes [session]` (or compatibility name `lterm ps [session]`) shows the process tree rooted at each session child, including process-group ids. Add `--orphans` to also include same-process-group rows that are no longer descendants of the recorded session root, so long-running Codex/OMX/MCP subprocess buildup stays visible before it becomes a memory-leak surprise. The system `ps` is invoked by absolute path, and malformed process rows are skipped rather than guessed at.
326
331
 
327
332
  **Socket location.** Custom `LTERM_SOCKET` paths must live in an owner-only directory. Prefer `LTERM_RUNTIME_DIR` when you need an isolated socket location.
328
333
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ictechgy/lterm",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Lightweight tmux-compatible terminal session daemon with cmux-friendly notifications.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "homepage": "https://github.com/ictechgy/light_terminal#readme",
@@ -30,10 +30,10 @@
30
30
  "LICENSE-MIT"
31
31
  ],
32
32
  "optionalDependencies": {
33
- "lterm-darwin-arm64": "0.1.0",
34
- "lterm-darwin-x64": "0.1.0",
35
- "lterm-linux-arm64": "0.1.0",
36
- "lterm-linux-x64": "0.1.0"
33
+ "lterm-darwin-arm64": "0.1.2",
34
+ "lterm-darwin-x64": "0.1.2",
35
+ "lterm-linux-arm64": "0.1.2",
36
+ "lterm-linux-x64": "0.1.2"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=16"