- C 99.1%
- Makefile 0.9%
| .gitignore | ||
| irc9.c | ||
| irc9.png | ||
| irc9rc-example | ||
| Makefile | ||
| README.md | ||
irc9
A deliberately minimal console IRC client in C. No network list, no settings commands, no plugins. Just servers, windows, timestamps, and two keys to move around.
Build and run
make
./irc9 # finds a config automatically (see below)
./irc9 myconfig.conf # or point at a config explicitly
./irc9 -s myconfig.conf # hide join and quit notices in channel windows
-s and --silent hide JOIN and QUIT notices in channel windows.
-C and --colored color nicknames in channel and private chats and in
nicklists. Your own nick is always green in this mode, including in the status
line.
Use -c RRGGBB or --color RRGGBB to replace the default cyan accent on
the channel tree and divider. For example, ./irc9 --color FF8800 uses
orange on terminals with true-color support.
With no config path, irc9 looks next to the executable, in this order:
irc9rc, config, then ~/.irc9rc. Paths are relative to the binary, not to
the current working directory.
Connection attempts (DNS, connect and TLS handshake) run in the background, so the interface opens and stays usable even when the network is down or DNS is slow; failed servers retry automatically.
Requires a C compiler and an ANSI-compatible terminal with an alternate screen.
TLS is compiled in automatically when OpenSSL development files are available (pkg-config --exists openssl); no
special flags are needed. Without OpenSSL the client still builds, but server
lines marked ssl/tls cannot connect.
Configuration
One file, nine active keywords:
nick irc9user
user irc9user
real Happy irc9 User
# strip_formatting off # default on; off renders IRC bold/color/etc.
# Libera and OFTC use TLS on 6697. Use port 6667 without the ssl keyword for
# plain TCP. The optional sasl line applies to the server above it; the SASL
# user is your account name. An optional autocommand sends one raw IRC command
# after registration on the server above it, before startup channel joins.
# libera
server irc.libera.chat 6697 ssl
name Libera Chat
# sasl irc9user my-sasl-password
# autocommand /msg NickServ IDENTIFY irc9user $PASSWORD
# Build with make -B AUTOJOIN=1 and uncomment channel lines to join at startup.
# Each channel line applies to the server above it.
channel #irc9
# channel #murx
# channel #zynk
# oftc
# server irc.oftc.net 6697 ssl
# name OFTC
# sasl irc9user my-sasl-password
# autocommand PRIVMSG NickServ :STATUS irc9user
# channel #linux
nick, user, and real are global. A server line starts a new server:
server <host> [port] [ssl|tls]
An optional name <display name> line below server sets its label in the
channel tree. The label defaults to the hostname.
The port defaults to 6667. The optional third token ssl or tls enables
TLS; use port 6697 for Libera and OFTC. A sasl <user> <pass> line applies to
the most recent server line and enables SASL PLAIN for that server only. The
SASL user is your account name (for many people this is the same as the nick).
Place an optional autocommand <IRC command> below the corresponding
server line, immediately after its sasl line when present. For example,
autocommand PRIVMSG NickServ :STATUS mynick sends that raw IRC command.
It runs once per successful registration, including reconnects, after SASL
negotiation when configured and before startup channel joins.
To enable startup channel joins, build with make -B AUTOJOIN=1. Add one
channel #name line per channel below the corresponding server line.
irc9 sends the joins when that server first confirms registration. Default
builds ignore channel lines. Use make -B to rebuild with autojoin disabled.
Blank lines and whole-line comments starting with # are ignored.
TLS certificates are verified against a system CA bundle when one is found. If no usable bundle is available, verification is disabled rather than blocking the connection.
Build yours by copying irc9rc-example to irc9rc next to the binary (or to
~/.irc9rc).
Layout
[irc9] irc.example / #general
/----------------------\ Topic: General discussion
|* irc.example |
| |-#general |
| |-#help(3) |
| \-alice | [10:21] <alice> hello there
|* irc.other | [10:22] <bob> hi
\______________________/ [10:22] * alice!u@host joined #help
----------------------------------------------------------------
[10:23] (me@irc.example:6697 [TLS])
> your message here
The left column is a tree: each server and its windows (channels and private
message windows). An unread window shows (n) next to its name. * marks a
connected server. The selected server or window is shown bold and underlined. Highlights use the
terminal's default background so transparency is preserved where supported.
Channel topics wrap to the chat pane width and stay at the top while you scroll.
On short terminals, the topic leaves room for at least one chat line when possible.
The right pane shows the current window's scrollback with [HH:MM] timestamps.
Joins, parts and quits include the full hostmask; joins and parts also name the
channel. The status line above the input shows the time, nick, server, port, TLS state, and user modes.
Joining a channel prints its nicklist. /n and /names print it again.
Channel privileges such as operator or voice appear as a trailing * (for example, alice*).
CTCP ACTION, VERSION, PING, TIME, and USERINFO are understood; KICK,
MODE, TOPIC, and INVITE events are shown in the relevant window.
Keys
| Key | Action |
|---|---|
Tab |
complete a / command or a nick; press again to cycle matches (recently completed nicks come first) |
Ctrl+Left / Ctrl+Right |
move to the previous / next word in the input line |
ctrl-n / ctrl-p |
next / previous window (tree order, wraps around) |
PageUp / PageDown |
scroll the current window |
ctrl-l |
clear the screen (history stays scrollable) |
ctrl-t |
toggle copy view, which hides the tree, chat timestamps, and sender names |
ctrl-s |
save the current window’s scrollback to a new plain-text file |
| Up / Down | command history |
| Left / Right, Home / End | edit the input line |
At the save prompt, type a path and press Enter, or press Esc or Ctrl-G to cancel. Existing files are protected from overwrites.
Commands
There is no command for changing settings — edit the config file and restart instead.
| Command | Action |
|---|---|
/join #chan |
join a channel |
/n [chan] / /names [chan] |
show a channel's nicklist (default: current window) |
/part [#chan] [reason] / /leave [#chan] [reason] |
leave the current or given channel and remove it from the tree |
/nick newnick |
change nickname |
/msg nick text |
send a private message |
/notice target text |
send a notice |
/query [nick] |
open or focus a private-message window, or close the current private chat with no nick |
/whois nick |
show server information about a nick |
/who [mask] |
request a user list |
/me text |
send a CTCP ACTION |
/ctcp nick text |
send a raw CTCP request |
/ping nick |
send an IRC PING |
/away [message] |
set or clear away status |
/topic [text] |
query or set the current channel's topic |
/invite nick [#chan] |
invite a nick (current channel by default) |
/kick nick [reason] |
kick from the current channel |
/mode [target] [modes] |
query or set a mode |
/op, /deop, /voice, /devoice |
short forms of common channel modes |
/ban mask, /unban mask |
add or remove a channel ban |
/list [args] |
list channels |
/motd, /time, /version, /admin, /info, /links, /lusers, /stats [args] |
request server information |
/raw line |
send a raw IRC line (CRLF is appended) |
/close, /wc |
close the current non-server window |
/clear |
clear the current window's scrollback |
/reconnect |
reconnect the current server |
/quit [reason] |
disconnect and quit |
/help |
reminder of the above |
Anything else typed without a leading / is sent to the current channel or
private-message window. Typing in a server window tells you to pick a target.
