irc9/README.md

151 lines
6.5 KiB
Markdown

# irc9
![irc9](irc9.png)
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
```sh
make
./irc9 # finds a config automatically (see below)
./irc9 myconfig.conf # or point at a config explicitly
```
With no argument, 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 ncurses and a C compiler. 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, six active keywords:
```
nick mynick
user myuser # optional, defaults to nick
real My Real Name # optional
strip_formatting on # optional, default on; off shows IRC formatting
server irc.libera.chat 6697 ssl
sasl mynick my-sasl-password
server irc.oftc.net 6697 ssl
# sasl mynick my-sasl-password
server irc.example.org 6667
```
`nick`, `user`, and `real` are global. A `server` line starts a new server:
```
server <host> [port] [ssl|tls]
```
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).
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
```
irc.example / #general
┌────────────────┬──────────────────────────────────────────┐
│* irc.example │ [10:21] <alice> hello there │
│ #general │ [10:22] <bob> hi │
│ #help(3) │ [10:22] * alice!u@host joined #help │
│ alice │ │
│* irc.other │ │
│ │ │
├────────────────┴──────────────────────────────────────────┤
│ me@irc.example #general (3) connected TLS 10:23 │
│> 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).
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 your nick, server, current
window, member count, connection state (including `TLS`), and the time.
Joining a channel prints its nicklist; `/n` and `/names` print it again.
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-n` / `ctrl-p` | next / previous window (tree order, wraps around) |
| `PageUp` / `PageDown` | scroll the current window |
| `ctrl-l` | clear the screen (history stays scrollable) |
| Up / Down | command history |
| Left / Right, Home / End | edit the input line |
## 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 the current or given channel |
| `/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 |
| `/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.