- Fix off-by-one in redraw_window circular buffer indexing (<= to <) that caused stale content after 500 lines filled - Add /clear command to reset current window scrollback - Add TCP keepalive and application-level ping timeout to detect dead connections
Mirk — Holck's IRC Client
A lightweight terminal IRC client written in C with automatic charset conversion and ircII-style window levels.
Features
- Automatic charset conversion — detects UTF-8, UTF-16 (BOM), and ISO-8859-1 input; always sends ISO-8859-1 on the wire
- Window levels — isolated windows with independent 500-line scrollback:
- Window 1: Status and private messages
- Windows 2–9: Channels
- Status bar — shows current window, channel, nick prefix (@/+), channel modes, and activity indicator
- UTF-8 terminal support — full multi-byte input editing
- Tab completion — nick completion with cycling (
:suffix at line start, space mid-line) - Query mode —
/q nickto set a default PM target - CTCP VERSION reply with OS info
- SIGWINCH handling (terminal resize)
- Ident — works with system identd on port 113
- Real name from passwd GECOS field
- Charset logger — logs raw incoming bytes with hex dump and detected encoding to
irc.log
Building
make
Requires only a C compiler and POSIX headers. No external dependencies.
Usage
./irc <nick> <server> [port]
Port defaults to 6667.
Key Bindings
| Key | Action |
|---|---|
| ESC+1–9 | Switch window |
| Tab | Nick completion (cycle with repeated Tab) |
| Ctrl-A | Beginning of line |
| Ctrl-E | End of line |
| Ctrl-U | Kill to beginning (yank buffer) |
| Ctrl-K | Kill to end (yank buffer) |
| Ctrl-Y | Yank (paste) |
| Ctrl-P | Page up (scroll back in history) |
| Ctrl-N | Page down (scroll forward) |
| Ctrl-D | Quit (EOF) |
| Ctrl-C | Quit prompt (Y/N, default N) |
Commands
| Command | Description |
|---|---|
/join #channel |
Join channel (assigned to current window) |
/part [#channel] |
Part channel (defaults to current) |
/msg <target> <text> |
Send private message |
/q <nick> |
Set query target (type text to send to them) |
/q |
Clear query target |
/me <action> |
Send action to channel/query |
/slap <nick> |
Slap with a large trout |
/nick <newnick> |
Change nickname |
/mode <target> <modes> |
Set mode |
/topic [#channel] |
View topic |
/topic #channel <text> |
Set topic |
/names [#channel] |
List users in channel |
/whois <nick> |
WHOIS query |
/wii <nick> |
Extended WHOIS (queries remote server) |
/trans |
Toggle public translation echo on/off |
/quit [reason] |
Quit (default: "See you later") |
/raw <line> |
Send raw IRC command |
Typing text without a / prefix sends to the channel on the current window (or query target on window 1).
Window Workflow
- Press ESC+2 to switch to window 2
/join #channel— the channel is bound to that window- Press ESC+3,
/join #other— second channel on window 3 - ESC+1 to check status and private messages
Each window maintains its own scrollback. Switching redraws the full history.
CTCP VERSION Reply
Holck's Mirk, OS: Linux 6.x.x x86_64 :: This space available for rent
AI Translation
Optional auto-translation of messages in non-Latin scripts (Cyrillic, CJK, Arabic, etc.). Requires an OpenAI-compatible API (ollama, vLLM, or OpenAI).
Configure ~/.hircrc (created on first run with empty/disabled values):
ai_type=ollama
ai_host=localhost:11434
ai_key=
ai_model=llama3
ai_target_lang=english
ai_skip_langs=swedish,english
Host can include port (host:port) or use a separate ai_port= line. When configured, foreign-script messages are shown immediately with an italic translation appearing below after 1-5 seconds. Leave values empty to disable.
License
Public domain.