# 配置 | Liu Terminal

> Liu Terminal 配置。通过 JSON 配置文件自定义主题、快捷键、字体和设置。

URL: https://liu.software/zh/docs/config/  
Language: zh  
Updated: 2026-10-20

config.json 位于 ~/.config/Liu/config.json。键为扁平的顶层字符串和数字（非嵌套对象）。Liu 在启动时加载，并在文件在磁盘上更改时自动重新加载。未知键会被忽略。

## 文件布局

```
~/.config/Liu/
├── config.json        # 主应用设置
├── keybindings.json   # 自定义快捷键（请参阅快捷键页面）
├── known_hosts        # OpenSSH 格式的已知主机
├── vault.db           # AES-256-GCM 加密的 SQLite 金库（PBKDF2 密钥派生）
└── themes/
    ├── my-theme.json
    └── ...
```

## 顶层字段

`theme` string `"Liu"`

活动主题名称。须匹配 18 个内置主题之一或 ~/.config/Liu/themes/ 中的 JSON 文件。

`font_path` string `"JetBrainsMono-Regular.ttf"`

主字体文件。裸文件名相对于内置 fonts 目录解析；也支持绝对路径。

`font_size` number `16`

DPI 缩放前的点数大小。

`enable_ligatures` boolean `true`

切换编程连字塑形。

`cursor_style` number `0`

0 = block · 1 = underline · 2 = bar

`cursor_blink` boolean `true`

仅在聚焦面板中闪烁。

`scrollback` number `1000`

每个面板行数（限制在 0–20000）。内存随 cols × scrollback 增长。

`vault_auto_lock_minutes` number `15`

闲置 N 分钟后自动锁定（0 = 仅手动锁定）。

`quake_mode` boolean `false`

启用 Quake 式下滑窗口（需要 quake\_hotkey）。

`quake_hotkey` string ``"Ctrl+`"``

quake\_mode 为 true 时的全局热键字符串。

## 其他支持的键

上表显示最常编辑的值。加载器还接受以下扁平顶层分组：

- `line_height`, `font_normalize`, `font_smoothing`, `font_weight` and `fallback_font_0` … `fallback_font_3` control font metrics and fallback fonts. Defaults: `1.0`, `true`, `true`, `0`; font weight is clamped to `0–2`.
- `tab_sleep_idle_minutes` defaults to `20`; `confirm_close_agent`, `bold_is_bright`, `show_scrollbar`, `show_tab_bar`, `show_toolbar_icons` and `show_git_badge` default to `true`. `bidi_enabled`, `hide_title_bar` and `show_status_bar` default to `false`.
- `sidebar_width` defaults to `240` and is clamped to `160–500`; `opacity` defaults to `1.0` and is clamped to `0.2–1.0`; `padding` defaults to `2`.
- `browser_enabled`, `browser_last_url` and `browser_recent_0` … `browser_recent_7` store browser state. The in-app browser is available on the macOS WebKit build.
- `option_as_alt` accepts `off`, `left`, `right` or `both`; `prompt_recall` accepts `off`, `badge` or `always`. `cursor_animate` defaults to `false`, `notify_command_threshold` to `10`, and `allow_osc52_write` to `false`.
- `background_image`, `notes_vault_path`, `background_mode` (`stretch`/`center`/`tile`/`fill`), `background_opacity`, `background_blur` and `background_blur_radius` configure the image layer. The defaults are empty path, empty path, `fill`, `0.3`, `false` and `10`.
- `quake_mode`, `quake_hotkey`, `quake_height_ratio` and `quake_animation_duration` default to `false`, `` Ctrl+` ``, `0.4` and `0.2`; their numeric ranges are `0.1–1.0` and `0–10`.
- `profile_count` plus `profile_<index>_name`, `_font_path`, `_font_size`, `_theme`, `_cursor_style` and `_opacity` define up to 16 profiles. Translate-on-Tab and Voice keys are documented on their dedicated pages.
- `site_count` plus `site_<index>_name`, `_path`, `_command` and `_port` define up to 32 Site Manager entries; runtime process state is not persisted.

style\_tab\_gap、style\_sidebar\_min\_width 和 style\_terminal\_padding 等样式键也会持久化到 config.json。工具栏高度和标签宽度是编译时布局常量，不是可配置键。

## 示例

```
{
  "theme": "Tokyo Night",
  "font_path": "JetBrainsMono-Regular.ttf",
  "font_size": 14,
  "enable_ligatures": true,
  "cursor_style": 2,
  "cursor_blink": false,
  "scrollback": 5000,
  "vault_auto_lock_minutes": 30,
  "quake_mode": true,
  "quake_hotkey": "Ctrl+`"
}
```

每个窗口的标签数硬上限为 32（src/ui/ui.h 中的 MAX\_TABS）：无法在此配置。GPU 后端在编译时选择（macOS 为 Metal，其他为 OpenGL）。scrollback 等数值字段在加载时会被限制在安全范围内。

[返回 介绍 ↺](https://liu.software/zh/docs.md)
