contour:基于多平台的 GPU 加速终端模拟器项目

用户可将其用作日常使用的现代终端工具,它具备跨平台支持、GPU 加速渲染、字体连字、Emoji 及 grapheme cluster 等 Unicode 特性,还支持终端标签、Vi 式输入模式、可定制颜色方案和配置文件等功能。【此简介由AI生成】

分支1Tags1
文件最后提交记录最后更新时间
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前

Contour - 一款现代且真正快速的终端模拟器

持续集成构建
代码覆盖率
C++20
Discord社区
Twitch直播
开放集体赞助徽章

在KDE/Fedora上展示notcurses ncneofetch的截图

contour是一款现代且真正快速的模态虚拟终端模拟器,适合日常使用。它旨在满足具有现代功能思维的高级用户需求。

功能亮点

  • ✅ 全平台支持:Linux、macOS、FreeBSD、OpenBSD、Windows。
  • ✅ GPU加速渲染。
  • ✅ 字体连字支持(如Fira Code)。
  • ✅ Unicode:支持表情符号(🌈 💝 😛 👪 包括ZWJ、VS15、VS16变体)。
  • ✅ Unicode:支持字形簇。
  • ✅ 终端多标签页。
  • ✅ 粗体与斜体字体。
  • ✅ 高DPI显示支持。
  • ✅ 垂直行标记(快速跳转历史记录中的标记位置!)。
  • ✅ Vi风格输入模式,提升选择与复制粘贴体验,支持Vi式scrolloff特性。
  • ✅ Windows 10+及Linux的KDE/GNOME桌面环境下的透明背景模糊效果。
  • ✅ 可模糊处理的背景图片支持。
  • ✅ 运行时配置重载。
  • ✅ 256色与真彩色支持。
  • ✅ 自定义键位绑定。
  • ✅ 配色方案。
  • ✅ 配置文件(分组管理配色方案、登录Shell及相关行为)。
  • 同步渲染(通过SM ? 2026 / RM ? 2026控制)。
  • ✅ 文本重排(可通过SM ? 2028 / RM ? 2028配置)。
  • ✅ 通过OSC 8实现可点击超链接。
  • ✅ 通过OSC 52设置剪贴板内容。
  • ✅ Sixel内联图像显示。
  • ✅ 终端页面缓冲区捕获VT扩展,快速提取内容。
  • ✅ 内置受Fira Code启发的进度条支持。
  • ✅ 只读模式,防止误触运行中的应用程序(如Ctrl+C)。
  • ✅ VT320主机可编程及状态指示线支持。
  • ✅ 更多功能等你探索...

安装方式

contour已为多平台提供官方包:

其他安装包可在发布页面找到,包括:

  • Ubuntu包
  • AppImage
  • 静态编译版本
  • MacOS捆绑包
  • Windows安装程序与便携版

通过Flatpak安装

从Flathub安装

点击下方按钮从Flathub商店安装Contour。

Flathub获取

前置条件

  • 确保系统已安装flatpak(安装教程),且版本≥0.10(通过flatpak --version验证)。
  • 添加Flathub仓库:flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
  • 选择以下方式之一继续:

系统要求

  • 操作系统:较新的系统(macOS、Windows 10+、更新至最新的Linux/FreeBSD/OpenBSD)。
  • GPU:驱动需支持至少OpenGL 3.3硬件加速或软件光栅化。
  • CPU:x86-64架构AMD/Intel(需AES-NI指令集)或ARMv8(需加密扩展)。

配置指南

配置Contour需编辑$HOME/.config/contour目录下的contour.yml文件。部分功能需配合Shell集成,可通过CLI生成(见下文),当前支持zsh、fish和tcsh。

从源码编译

建议通过包管理器安装,但也可按以下步骤编译:
支持Qt 5或Qt 6,默认使用Qt 6编译。切换版本需运行QTVER=5 ./scripts/install-deps.sh获取依赖,并在cmake中添加-D CONTOUR_QT_VERSION=5标志。

类UNIX系统(Linux、FreeBSD、OpenBSD、macOS)

前置条件

./scripts/install-deps.sh

此脚本可能会要求您输入管理员密码,以便通过系统包管理器安装依赖包。

编译

您可以使用 cmake 预设来编译 contour。所有可用预设可通过 cmake --list-presets 查看。针对 Linux 或 MacOS 的发布版本编译,请分别使用 linux-releasemacos-release。FreeBSD 和 OpenBSD 用户可使用 linux-release 或手动配置 cmake。

cmake --preset linux-release
cmake --build --preset linux-release

# Optionally, if you want to install from source
cmake --build --preset linux-release --target install

Windows 10 或更新版本

系统要求

在 Windows 系统上,您必须安装 Windows 10 2018 秋季创意者更新及 Visual Studio 2019。 由于 libterminal 使用了 ConPTY API,此前的 Windows 操作系统将无法构建或运行该程序。

  1. 安装 vcpkg,建议将其放置在文件夹层级较高的位置,并将该文件夹添加到您的 PATH 环境变量中。
cd C:\
git clone https://github.com/Microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
  1. 安装 Visual Studio 生成工具(确保勾选 C++ 的命令行工具,可能需要到“单个组件”选项卡中手动添加)。
  2. 安装 Qt6(例如安装到 C:\Qt 目录)。
  3. 打开 PowerShell 的 开发者 版本。
  4. contour 源码目录下执行 .\scripts\install-deps.ps1。此步骤可能耗时 长。

编译步骤

在 PowerShell 的 开发者 版本中执行以下操作:

# change paths accordingly if you installed QT and vcpkg to somewhere else
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_PREFIX_PATH=C:\Qt\6.5.0\msvc2019_64\lib\cmake
cmake --build build/

# Optionally, if you want to install from source
cmake --build build/ --target install

发行版软件包

软件包状态

命令行界面(CLI)

  Usage:

    contour [terminal] [config FILE] [profile NAME] [debug TAGS] [live-config] [dump-state-at-exit PATH]
                       [early-exit-threshold UINT] [working-directory DIRECTORY] [class WM_CLASS]
                       [platform PLATFORM[:OPTIONS]] [session SESSION_ID] [PROGRAM ARGS...]
    contour font-locator [config FILE] [profile NAME] [debug TAGS]
    contour info vt
    contour help
    contour version
    contour license
    contour parser-table
    contour list-debug-tags
    contour generate terminfo to FILE
    contour generate config to FILE
    contour generate integration shell SHELL to FILE
    contour capture [logical] [words] [timeout SECONDS] [lines COUNT] to FILE
    contour set profile [to NAME]

参考文献

许可协议

Contour - A modern C++ Terminal Emulator
-------------------------------------------

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

项目介绍

用户可将其用作日常使用的现代终端工具,它具备跨平台支持、GPU 加速渲染、字体连字、Emoji 及 grapheme cluster 等 Unicode 特性,还支持终端标签、Vi 式输入模式、可定制颜色方案和配置文件等功能。【此简介由AI生成】

定制我的领域