Skip to content

Repository files navigation

MothTerm

MothTerm is a Linux-first GTK3 terminal emulator using VTE for terminal emulation and POSIX PTYs.

Build

make check-deps
make check
make build
./mothterm

For a stripped release binary use make release; make install installs the binary and desktop entry. The repository can use locally extracted VTE headers under .deps/vte-root when the system development package is unavailable.

-e 适合执行完整 shell 语句;也可以直接传递 positional arguments,例如 ./mothterm printf hello 'a b',程序会逐项进行 shell quoting。两种形式不能同时使用。--cwd DIR 设置子进程工作目录;可重复的 --env NAME=VALUE 覆盖或新增环境变量;--empty-env 禁止继承宿主环境。无效工作目录会在启动前拒绝。

Configuration is read from ~/.config/mothterm/config.json. Missing files use defaults. Invalid dimensions or scrollback values are rejected. Settings can be saved atomically through config.Save for embedding applications.

Features

  • GTK3 window with VTE terminal and default shell
  • empty-env explicitly starts the child with no inherited environment; repeated --env values can populate it.
  • Font, colors, cursor blinking, audible bell, scrollback, and window size configuration; zoom scale is persisted atomically in the configuration file
  • Independent tabs with shell title updates and PTY cleanup on close
  • New/close tab, copy, paste, select all, reset, zoom, and quit menu actions
  • Go-side terminal.CommandSpec and terminal.Session abstraction for future backends
  • Desktop entry, dependency check, debug/release builds, and Makefile install target

GTK/VTE C APIs remain inside bridge/; Go application code uses the bridge configuration API and the terminal abstraction types.

开源协作

项目采用 MIT License。贡献代码前请阅读 CONTRIBUTING.md;安全问题请参阅 SECURITY.md

常用检查命令:

make check          # gofmt、go vet、go test
make build          # Debug 构建
make release        # 可发布构建
make integration    # GTK/VTE 端到端测试,需要 DISPLAY 和 xdotool

集成测试在缺少图形环境或 xdotool 时返回退出码 77,表示测试被跳过。

项目文档

仓库目录和开发约定见 AGENTS.md

About

mothterm

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages