1
0
Fork 0
forked from murx/irc9

Compare commits

...
Sign in to create a new pull request.

39 commits

Author SHA1 Message Date
375a6b3e32 Show total unread counts on server rows 2026-12-02 00:41:02 +01:00
b488fdad57 Toggle server tree folding with Enter 2026-12-02 00:32:00 +01:00
7b85ec7e5e Skip consecutive duplicate slash commands in history 2026-12-02 00:26:41 +01:00
b208b5b696 Run slash command sequences after IRC registration 2026-12-02 00:12:07 +01:00
a95f4f42b3 Support multiple commands after channel autojoin 2026-12-02 00:00:24 +01:00
172157825b Add opt-in persistent slash command history 2026-11-30 21:57:06 +01:00
30324032ce README update. 2026-11-30 01:03:35 +01:00
676b839426 Use strtok_r when wrapping chat text 2026-11-30 00:00:15 +01:00
3adceb05eb Show private chat availability notices 2026-11-29 23:58:11 +01:00
15a6c6dee9 Make scrollback length configurable from the CLI 2026-11-29 23:05:19 +01:00
54d44d370b Add CLI version and help options 2026-11-29 22:58:02 +01:00
d4f2301175 README update. 2026-11-29 22:49:42 +01:00
383bb95d76 Added screenshot. 2026-11-29 22:48:06 +01:00
7833745890 README update. 2026-11-29 22:44:37 +01:00
f63a54d15f README update. 2026-11-29 22:40:39 +01:00
b15d0ef81d Added authors to README and additional an AUTHORS file. 2026-11-29 22:37:02 +01:00
fa16526c44 Add per-server nickname blacklists 2026-11-29 21:45:56 +01:00
78f2929dd9 Use dashes for both TUI bottom borders 2026-11-29 20:42:48 +01:00
7cf0accf73 Use underscores for the chat pane bottom border 2026-11-29 20:38:47 +01:00
cb5b92c98c Added Apache-2.0 license. 2026-11-29 20:14:03 +01:00
a5c12b1cfe Pace startup channel joins per server 2026-11-29 20:02:14 +01:00
7e57211260 Add channel tree scrolling and follow window switches 2026-11-29 19:59:08 +01:00
9b5e837e3c Restore channel tree top border corners 2026-11-29 18:46:15 +01:00
a7279840f0 Draw channel tree entries below the top border 2026-11-29 18:44:24 +01:00
981a803d6c End the topic divider with a vertical bar 2026-11-29 07:58:45 +01:00
886aaec1e3 Add slash corners to the chat pane borders 2026-11-29 07:52:35 +01:00
eb4e78f269 Suppress mode-change notices in silent mode 2026-11-29 07:34:25 +01:00
67b3b2fb87 Remove the topic label from channel headers 2026-11-29 07:12:19 +01:00
5f2f1d8e0c Remove spacing after the server connection marker 2026-11-29 06:49:15 +01:00
6ed9931044 Use the full chat pane width for the topic divider 2026-11-29 06:31:21 +01:00
4bf001e7cd Remove the blank row above the TUI status bar 2026-11-29 06:03:10 +01:00
5d311bbef4 Add a top divider to the chat pane 2026-11-29 06:01:08 +01:00
38df64d3b2 Align bottom divider with the channel tree corner 2026-11-29 05:57:35 +01:00
38dca11cf8 Sort channels and private chats in the tree 2026-11-29 05:14:08 +01:00
410990c63d Suppress nickname-change notices in silent mode 2026-11-29 05:02:46 +01:00
76578805ba Handle missing config arguments on musl 2026-11-29 04:17:07 +01:00
e138004be9 Run optional commands after startup channel joins 2026-11-29 03:58:20 +01:00
b38437544f Suppress channel leave and sync notices in silent mode 2026-11-29 03:38:27 +01:00
94e16d4b32 Scroll compose input to keep the cursor visible 2026-11-29 03:28:42 +01:00
6 changed files with 769 additions and 234 deletions

4
AUTHORS Normal file
View file

@ -0,0 +1,4 @@
murx authors
Armin Jenewein <a@bsd.pm> - Founder
Johannes Findeisen <you@hanez.org> - Contributor

13
LICENSE Normal file
View file

@ -0,0 +1,13 @@
Copyright 2026 Armin Jenewein
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -4,7 +4,7 @@
A deliberately minimal console IRC client in C. No network list, no settings 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 commands, no plugins. Just servers, windows, timestamps, and two keys to move
around. around + some more keys you can use.
## Build and run ## Build and run
@ -12,16 +12,24 @@ around.
make make
./irc9 # finds a config automatically (see below) ./irc9 # finds a config automatically (see below)
./irc9 myconfig.conf # or point at a config explicitly ./irc9 myconfig.conf # or point at a config explicitly
./irc9 -s myconfig.conf # hide join and quit notices in channel windows ./irc9 -s myconfig.conf # hide channel activity notices
``` ```
`-s` and `--silent` hide JOIN and QUIT notices in channel windows. `-v` and `--version` print the program version. `-h` and `--help` print the
version and command-line usage.
`-s` and `--silent` hide channel join, quit, leave, and sync notices, as well as
nickname-change and mode-change notices.
`-C` and `--colored` color nicknames in channel and private chats and in `-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 nicklists. Your own nick is always green in this mode, including in the status
line. line.
Use `-c RRGGBB` or `--color RRGGBB` to replace the default cyan accent on Use `-c RRGGBB` or `--color RRGGBB` to replace the default cyan accent on
the channel tree and divider. For example, `./irc9 --color FF8800` uses the channel tree and divider. For example, `./irc9 --color FF8800` uses
orange on terminals with true-color support. orange on terminals with true-color support.
Use `--scrollback LINES` to set how many lines each window retains. The default
is 500 lines. For example, `./irc9 --scrollback 2000` keeps 2000 lines per window.
Use `--history` to save submitted slash commands to `~/.irc9_history` and
recall the 64 most recent commands with Up and Down across sessions.
With no config path, irc9 looks next to the executable, in this order: 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 `irc9rc`, `config`, then `~/.irc9rc`. Paths are relative to the binary, not to
@ -38,7 +46,7 @@ lines marked `ssl`/`tls` cannot connect.
## Configuration ## Configuration
One file, nine active keywords: One file, ten active keywords:
``` ```
nick irc9user nick irc9user
@ -48,16 +56,22 @@ real Happy irc9 User
# Libera and OFTC use TLS on 6697. Use port 6667 without the ssl keyword for # 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 # 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 # user is your account name. An optional autocommand runs after registration on
# after registration on the server above it, before startup channel joins. # the server above it, before startup channel joins. Separate slash commands with
# commas. irc9 waits two seconds between commands.
# libera # libera
server irc.libera.chat 6697 ssl server irc.libera.chat 6697 ssl
name Libera Chat name Libera Chat
# Suppress incoming messages from these nicknames on this server.
# blacklist user1,user2,user3
# sasl irc9user my-sasl-password # sasl irc9user my-sasl-password
# autocommand /msg NickServ IDENTIFY irc9user $PASSWORD # autocommand /query user1,/query user2
# Build with make -B AUTOJOIN=1 and uncomment channel lines to join at startup. # Build with make -B AUTOJOIN=1 and uncomment channel lines to join at startup.
# Each channel line applies to the server above it. # Each channel line applies to the server above it.
# Optional comma-separated slash commands run after the channel join succeeds.
# irc9 waits two seconds between commands on the same line.
# channel #channel /msg ChanServ OP #channel nickname,/mode #channel
channel #irc9 channel #irc9
# channel #murx # channel #murx
# channel #zynk # channel #zynk
@ -79,21 +93,34 @@ server <host> [port] [ssl|tls]
An optional `name <display name>` line below `server` sets its label in the An optional `name <display name>` line below `server` sets its label in the
channel tree. The label defaults to the hostname. channel tree. The label defaults to the hostname.
Add `blacklist user1,user2,user3` below a `server` line to suppress incoming
channel messages, private messages, and notices from those nicknames on that
server. Matching is case-insensitive. You can add multiple blacklist lines
for the same server.
The port defaults to `6667`. The optional third token `ssl` or `tls` enables 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 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 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). 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 Place an optional `autocommand` below the corresponding `server` line,
`server` line, immediately after its `sasl` line when present. For example, immediately after its `sasl` line when present. For example,
`autocommand PRIVMSG NickServ :STATUS mynick` sends that raw IRC command. `autocommand /query user1,/query user2` opens two query windows, two seconds apart.
It runs once per successful registration, including reconnects, after SASL A comma followed by a slash, with optional spaces or tabs between them, starts
negotiation when configured and before startup channel joins. the next command. The first command can also use raw IRC syntax, as in
`autocommand PRIVMSG NickServ :STATUS mynick`. Use `/raw` for later raw commands.
The sequence 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 To enable startup channel joins, build with `make -B AUTOJOIN=1`. Add one
`channel #name` line per channel below the corresponding `server` line. `channel #name` line per channel below the corresponding `server` line.
irc9 sends the joins when that server first confirms registration. Default After registration, irc9 sends one startup JOIN every two seconds per server.
builds ignore `channel` lines. Use `make -B` to rebuild with autojoin disabled. Add comma-separated slash commands after the channel name, for example
`channel #channel /msg ChanServ OP #channel nickname,/mode #channel`.
The first command runs when the server confirms the join. irc9 waits two seconds
between commands on the same line and runs them in the joined channel's context.
A comma followed by a slash, with optional spaces or tabs between them, starts the next command.
Default builds ignore `channel` lines. Use `make -B` to rebuild with autojoin disabled.
Blank lines and whole-line comments starting with `#` are ignored. Blank lines and whole-line comments starting with `#` are ignored.
TLS certificates are verified against a system CA bundle when one is found. TLS certificates are verified against a system CA bundle when one is found.
@ -107,21 +134,23 @@ Build yours by copying `irc9rc-example` to `irc9rc` next to the binary (or to
``` ```
[irc9] irc.example / #general [irc9] irc.example / #general
/----------------------\ Topic: General discussion /----------------------\/--------------------------------------\
|* irc.example | |*irc.example | General discussion
| |-#general | | |-#general |---------------------------------------|
| |-#help(3) | | |-#help(3) |
| \-alice | [10:21] <alice> hello there | \-alice | [10:21] <alice> hello there
|* irc.other | [10:22] <bob> hi |*irc.other | [10:22] <bob> hi
\______________________/ [10:22] * alice!u@host joined #help | | [10:22] * alice!u@host joined #help
---------------------------------------------------------------- \----------------------/\--------------------------------------/
[10:23] (me@irc.example:6697 [TLS]) [10:23] (me@irc.example:6697 [TLS])
> your message here > your message here
``` ```
The left column is a tree: each server and its windows (channels and private 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 message windows). Channels appear before private message windows, with
connected server. The selected server or window is shown bold and underlined. Highlights use the uppercase names sorting before lowercase names in each group. An unread window
shows `(n)` next to its name. Each server shows its total unread count after
its name, including when folded. `*` 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. 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. 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. On short terminals, the topic leaves room for at least one chat line when possible.
@ -133,18 +162,24 @@ Channel privileges such as operator or voice appear as a trailing `*` (for examp
CTCP `ACTION`, `VERSION`, `PING`, `TIME`, and `USERINFO` are understood; KICK, CTCP `ACTION`, `VERSION`, `PING`, `TIME`, and `USERINFO` are understood; KICK,
MODE, TOPIC, and INVITE events are shown in the relevant window. MODE, TOPIC, and INVITE events are shown in the relevant window.
## Screenshot
![screenshot](screenshot.png)
## Keys ## Keys
| Key | Action | | Key | Action |
| --- | --- | | --- | --- |
| `Tab` | complete a `/` command or a nick; press again to cycle matches (recently completed nicks come first) | | `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+Left` / `Ctrl+Right` | move to the previous / next word in the input line |
| `ctrl-n` / `ctrl-p` | next / previous window (tree order, wraps around) | | `Ctrl+Up` / `Ctrl+Down` | scroll the channel tree by one row |
| `ctrl-n` / `ctrl-p` | next / previous visible window (tree order, wraps around) |
| Enter | fold or unfold the selected server when the input line is empty |
| `PageUp` / `PageDown` | scroll the current window | | `PageUp` / `PageDown` | scroll the current window |
| `ctrl-l` | clear the screen (history stays scrollable) | | `ctrl-l` | clear the screen (history stays scrollable) |
| `ctrl-t` | toggle copy view, which hides the tree, chat timestamps, and sender names | | `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 | | `ctrl-s` | save the current window’s scrollback to a new plain-text file |
| Up / Down | command history | | Up / Down | browse slash command history with `--history` |
| Left / Right, Home / End | edit the input line | | Left / Right, Home / End | edit the input line |
| `Del` | delete the character at the cursor | | `Del` | delete the character at the cursor |
@ -189,3 +224,17 @@ instead.
Anything else typed without a leading `/` is sent to the current channel or 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. private-message window. Typing in a server window tells you to pick a target.
## Authors
See [AUTHORS](AUTHORS) for project credits.
- Armin Jenewein - <a@bsd.pm> - Founder
- Johannes Findeisen - <you@hanez.org> - Contributor
## License
Copyright 2026 Armin Jenewein
The code of murx is licensed under the terms of the Apache-2.0 license. See
LICENSE for details.

877
irc9.c

File diff suppressed because it is too large Load diff

View file

@ -8,16 +8,22 @@ real Happy irc9 User
# Libera and OFTC use TLS on 6697. Use port 6667 without the ssl keyword for # 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 # 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 # user is your account name. An optional autocommand runs after registration on
# after registration on the server above it, before startup channel joins. # the server above it, before startup channel joins. Separate slash commands with
# commas. irc9 waits two seconds between commands.
# libera # libera
server irc.libera.chat 6697 ssl server irc.libera.chat 6697 ssl
name Libera Chat name Libera Chat
# Suppress incoming messages from these nicknames on this server.
# blacklist user1,user2,user3
# sasl irc9user my-sasl-password # sasl irc9user my-sasl-password
# autocommand /msg NickServ IDENTIFY irc9user $PASSWORD # autocommand /query user1,/query user2
# Build with make -B AUTOJOIN=1 and uncomment channel lines to join at startup. # Build with make -B AUTOJOIN=1 and uncomment channel lines to join at startup.
# Each channel line applies to the server above it. # Each channel line applies to the server above it.
# Optional comma-separated slash commands run after the channel join succeeds.
# irc9 waits two seconds between commands on the same line.
# channel #channel /msg ChanServ OP #channel nickname,/mode #channel
channel #irc9 channel #irc9
# channel #murx # channel #murx
# channel #zynk # channel #zynk

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB