Skip to content
Merged
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
49 changes: 48 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ npm install -g tmux-tui
tmuxtui
```

Keyboard shortcuts:
Keyboard shortcuts (all customizable via config file):

| Key | Action |
|-----|--------|
Expand All @@ -56,10 +56,57 @@ Keyboard shortcuts:
| `x` | Detach session |
| `d` | Kill session (with confirm) |
| `c` | Config — window management |
| `i` | Session details (windows & panes) |
| `/` | Search sessions |
| `s` | Toggle favorite |
| `f` | Filter favorites only |
| `R` | Refresh session list |
| `Tab` | Mark / unmark session |
| `X` | Batch detach marked sessions |
| `D` | Batch kill marked sessions |
| `h` | Help |
| `q` | Quit |

When creating a new session, press `Tab` to switch between the name and path fields.

### Configuration

Create `~/.config/tmuxtui/config.json` to customize behavior:

```json
{
"defaultSort": "lastAttached",
"confirmBeforeKill": true,
"autoAttachOnCreate": false,
"refreshInterval": 0,
"keybindings": {
"quit": "escape",
"new": "n",
"kill": "d"
},
"ui": {
"showPath": true,
"showSessionId": false,
"sessionNameWidth": 20
}
}
```

#### Config options

| Option | Default | Description |
|--------|---------|-------------|
| `defaultSort` | `"lastAttached"` | Sort mode: `"lastAttached"`, `"name"`, or `"created"` |
| `confirmBeforeKill` | `true` | Show confirmation before killing sessions |
| `autoAttachOnCreate` | `false` | Auto-attach after creating a new session |
| `refreshInterval` | `0` | Auto-refresh interval in seconds (0 = disabled) |
| `ui.showPath` | `true` | Show session working directory |
| `ui.showSessionId` | `false` | Show tmux session ID |
| `ui.sessionNameWidth` | `20` | Session name column width (10-60) |
| `keybindings.*` | see defaults | Remap any keyboard shortcut |

All keybinding names: `select-up`, `select-down`, `attach`, `new`, `rename`, `kill`, `detach`, `search`, `favorite`, `favorites-filter`, `refresh`, `help`, `quit`, `batch-mark`, `batch-detach`, `batch-kill`, `detail`, `config`.

### Config mode (window management)

Press `c` on any session to enter config mode. This lets you manage windows within the selected session.
Expand Down
49 changes: 48 additions & 1 deletion README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ npm install -g tmux-tui
tmuxtui
```

快捷键:
快捷键(全部可通过配置文件自定义)

| 按键 | 操作 |
|------|------|
Expand All @@ -56,10 +56,57 @@ tmuxtui
| `x` | 分离会话 |
| `d` | 销毁会话(需确认) |
| `c` | 配置 — 窗口管理 |
| `i` | 查看会话详情(窗口和 pane) |
| `/` | 搜索会话 |
| `s` | 收藏/取消收藏 |
| `f` | 仅显示收藏会话 |
| `R` | 刷新会话列表 |
| `Tab` | 标记/取消标记会话 |
| `X` | 批量分离已标记会话 |
| `D` | 批量销毁已标记会话 |
| `h` | 帮助 |
| `q` | 退出 |

创建新会话时,按 `Tab` 在名称和路径输入框之间切换。

### 配置文件

创建 `~/.config/tmuxtui/config.json` 自定义行为:

```json
{
"defaultSort": "lastAttached",
"confirmBeforeKill": true,
"autoAttachOnCreate": false,
"refreshInterval": 0,
"keybindings": {
"quit": "escape",
"new": "n",
"kill": "d"
},
"ui": {
"showPath": true,
"showSessionId": false,
"sessionNameWidth": 20
}
}
```

#### 配置项说明

| 选项 | 默认值 | 说明 |
|------|--------|------|
| `defaultSort` | `"lastAttached"` | 排序方式:`"lastAttached"`、`"name"` 或 `"created"` |
| `confirmBeforeKill` | `true` | 销毁会话前是否需要确认 |
| `autoAttachOnCreate` | `false` | 创建会话后是否自动 attach |
| `refreshInterval` | `0` | 自动刷新间隔(秒),0 = 关闭 |
| `ui.showPath` | `true` | 显示会话工作目录 |
| `ui.showSessionId` | `false` | 显示 tmux 会话 ID |
| `ui.sessionNameWidth` | `20` | 会话名列宽度(10-60) |
| `keybindings.*` | 见默认值 | 自定义任意快捷键 |

所有可配置的键绑定名称:`select-up`、`select-down`、`attach`、`new`、`rename`、`kill`、`detach`、`search`、`favorite`、`favorites-filter`、`refresh`、`help`、`quit`、`batch-mark`、`batch-detach`、`batch-kill`、`detail`、`config`。

### 配置模式(窗口管理)

在任意会话上按 `c` 进入配置模式,管理该会话下的窗口。
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tmux-tui",
"version": "1.3.3",
"version": "1.4.0",
"description": "Terminal UI for tmux session management",
"type": "module",
"bin": {
Expand Down
Loading
Loading