Welcome to muxkit!
muxkit is a lightweight terminal multiplexer written in C. It enables multiple terminal sessions to be created, accessed, and controlled from a single screen. muxkit sessions can be detached from the screen and continue running in the background, then later reattached.
- β¨ Session Management - Create, detach, and reattach terminal sessions
- πͺ Multiple Panes - Split terminal window into multiple panes vertically
- π Scrollback History - Review terminal output with history scrolling
- π Internationalization - Built-in English and Chinese language support
- π Lightweight - Minimal dependencies, fast startup
- π Daemon Mode - Server runs as background daemon
- πΎ Session Persistence - Screen state preserved when detached
muxkit depends on the following libraries:
- libvterm - Terminal emulator library (included in
vendor/) - Standard C Library - POSIX-compliant system
To build muxkit, you need:
- C compiler (gcc or clang)
- CMake 3.10 or higher
- make
brew tap LatosProject/muxkit https://github.com/LatosProject/muxkit.git
brew install muxkit# Using an AUR helper (e.g., yay)
yay -S muxkit
# Or manually
git clone https://github.com/LatosProject/muxkit.git
cd muxkit/aur
makepkg -si# Build .deb package from source
git clone https://github.com/LatosProject/muxkit.git
cd muxkit
dpkg-buildpackage -us -uc -b
sudo dpkg -i ../muxkit_0.4.4-1_*.deb# Install build dependencies
sudo dnf install cmake gcc make
# Build and install from source
git clone https://github.com/LatosProject/muxkit.git
cd muxkit
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
cmake --build build
sudo install -m 755 build/muxkit /usr/local/bin/muxkitTo build and install muxkit from source:
# Clone the repository
git clone https://github.com/LatosProject/muxkit.git
cd muxkit
# Build
cmake -B build -S .
cmake --build build
# Install (optional)
sudo cp build/muxkit /usr/local/bin/- macOS: Works out of the box with Xcode Command Line Tools
- Linux: Requires build-essential package
# Start a new session
muxkit
# List all sessions
muxkit -l
# Attach to a detached session (session ID 0)
muxkit -s 0
# Kill a session
muxkit -k 0
# Show help
muxkit -hAll commands are prefixed with Ctrl+B:
| Key Combination | Action |
|---|---|
Ctrl+B d |
Detach from current session |
Ctrl+B % |
Split pane vertically |
Ctrl+B o |
Switch to next pane |
Ctrl+B [ |
Scroll up (view history) |
Ctrl+B ] |
Scroll down |
Ctrl+B s |
Toggle synchronized input mode |
Ctrl+B Ctrl+B |
Send literal Ctrl+B to shell |
Note: Press Esc or q to exit scroll mode.
Configuration files are located in ~/.local/share/muxkit/muxkit-<uid>/:
keybinds.conf- Custom key bindings (optional)
Example keybinds.conf:
prefix d detach_session
prefix % new_pane
prefix o next_pane
prefix [ scroll_up
prefix ] scroll_down
Available actions:
detach_session- Detach from sessionnew_pane- Create new panenext_pane- Switch to next panescroll_up- Scroll up to view historyscroll_down- Scroll downsync_input- Toggle synchronized input mode (bar cursor)
muxkit/
βββ src/
β βββ core/ # Main entry point
β βββ client/ # Client-side logic
β βββ server/ # Server daemon
β βββ ui/ # Rendering and input
β βββ common/ # Shared utilities
βββ include/ # Header files
βββ vendor/ # Third-party libraries (libvterm)
βββ CMakeLists.txt # Build configuration
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Terminal β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Client Process β
β ββββββββββ ββββββββββββ ββββββββββββββββββββββββ β
β β Raw β β Event β β Signal Handler β β
β β Mode β β Loop β β (SIGWINCH/SIGCHLD) β β
β ββββββββββ ββββββββββββ ββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
Unix Domain Socket
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Server Process (Daemon) β
β ββββββββββ ββββββββββββ ββββββββββββββββββββββββ β
β βSession β β Event β β Child Monitor β β
β βManager β β Loop β β (SIGCHLD) β β
β ββββββββββ ββββββββββββ ββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
PTY Master/Slave
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Shell Process β
β (bash/zsh/sh) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Bug reports, feature suggestions, and code contributions are welcome!
Please open a GitHub issue or pull request at:
https://github.com/LatosProject/muxkit
Before contributing:
- Read the code style in existing files
- Add appropriate comments and documentation
- Test your changes thoroughly
For detailed API documentation, see the header files in include/:
window.h- Window and pane managementrender.h- Terminal renderingclient.h- Client state machineserver.h- Server daemon
Generate Doxygen documentation:
doxygen DoxyfileRun muxkit with verbose logging. Log files will be created in ~/.local/share/muxkit/muxkit-<uid>/:
client.log- Client logserver.log- Server log
Check logs for debugging:
tail -f ~/.local/share/muxkit/muxkit-$(id -u)/client.log
tail -f ~/.local/share/muxkit/muxkit-$(id -u)/server.log| Technology | Description |
|---|---|
| PTY (Pseudo-terminal) | Virtual terminal pairs using posix_openpt, grantpt, ptsname |
| Unix Domain Sockets | Local IPC between client and server |
| FD Passing | Cross-process file descriptor passing via SCM_RIGHTS |
| Signal Handling | SIGCHLD for child monitoring, SIGWINCH for window resize |
| Daemon Process | Double-fork pattern for background service |
| termios | Raw mode terminal control |
| libvterm | Terminal emulation library |
MIT License - Copyright (c) 2024 LatosProject
See LICENSE file for details.
Version: 0.4.4 Author: LatosProject Homepage: https://github.com/LatosProject/muxkit