Commit Graph

1002 Commits (1f9e3463c323056c2020e7dec573ea0e8a83d4a1)

Author SHA1 Message Date
June McEnroe 1f9e3463c3 Document using -S to connect over IPv4 or IPv6 2022-03-13 17:33:16 -04:00
Christian Kellermann ee82e5d376 Always refresh the screen with ^L
This patch adds an explicit wrefresh call. Under some conditions
just flagging the window for redraw does not trigger a redraw and
the user has no other means to force redrawing of a window.

Without this patch resizing the window would sometimes result in
an empty chat window with no way to redraw it.

Tested under uxterm and st on OpenBSD.
2022-03-09 21:18:05 -05:00
June McEnroe c78b511dfb Update STANDARDS section authors, titles and URLs 2022-03-05 16:09:51 -05:00
June McEnroe 120349ccc2 Show own nick on /nick without params 2022-03-02 23:06:06 -05:00
June McEnroe b6c7280649 Specify commands which depend on caps
Currently only /setname.
2022-02-26 15:51:42 -05:00
June McEnroe b7fe705c91 Only add available commands to complete 2022-02-26 15:41:50 -05:00
June McEnroe 628e064056 Factor out commandAvailable 2022-02-26 15:40:11 -05:00
June McEnroe f51e7b4d2c Give examples of "general events" 2022-02-23 18:05:10 -05:00
June McEnroe 4e8ba236b6 Add missing unistd.h include in input.c 2022-02-23 12:50:31 -05:00
June McEnroe 5b3b798c49 Document the interface 2022-02-22 20:04:42 -05:00
June McEnroe c929a696eb Clean up unimplemented editing mode stuff 2022-02-20 17:16:21 -05:00
June McEnroe 78ff548b93 Save input buffer contents 2022-02-20 16:57:11 -05:00
June McEnroe da1b943fcc Share a cut buffer between all edit buffers 2022-02-20 16:20:33 -05:00
June McEnroe c8b6e331de Assert return values in edit tests 2022-02-20 16:05:24 -05:00
June McEnroe e39bba1a8a Move mbs out of struct Edit, use a global buffer
This saves 4K in the edit buffers, not to mention all the heap
allocations for the separate mbs buffers!

There might be a way to be more clever about capacities, but I don't
think it's worth it.
2022-02-20 15:42:24 -05:00
June McEnroe cca9688cca Clear edit buffer before running command
Otherwise a command that switches windows will update the status
line while the edit buffer still has input "pending", showing an
indicator.
2022-02-20 14:58:33 -05:00
June McEnroe a281bdc5e1 Show indicator in status when window has pending input 2022-02-20 14:49:17 -05:00
June McEnroe 012fd67539 Use separate edit buffers for each ID 2022-02-20 14:37:51 -05:00
June McEnroe 8065fcabc3 Make sure new cap is actually larger than new length 2022-02-20 12:24:54 -05:00
June McEnroe 157be8a8d7 Remove unused mbs.len field from struct Edit 2022-02-20 11:54:06 -05:00
June McEnroe 3b4ad30d97 Remove unneeded includes in ui.c 2022-02-19 23:25:36 -05:00
June McEnroe 5c4ecb5a0f Reimplement tab complete 2022-02-19 22:02:49 -05:00
June McEnroe da8deff767 Handle errors from editFn, etc. 2022-02-19 20:44:36 -05:00
June McEnroe 143fa1b509 Reimplement text macros 2022-02-19 20:38:12 -05:00
June McEnroe 073cebec7a Factor out input handling to input.c 2022-02-19 20:20:19 -05:00
June McEnroe 3359a5d69b Factor out window management to window.c 2022-02-19 18:28:45 -05:00
June McEnroe 70f627bc47 Enable -Wmissing-prototypes
In other words, warn when a function is missing static. I don't see
why this isn't in -Wextra.
2022-02-19 17:46:07 -05:00
June McEnroe a2a118c857 Fix edit.[ch] license notice additional permissions 2022-02-19 14:51:26 -05:00
June McEnroe 06d17aa8f1 Run line editing tests
I know, it feels wrong.
2022-02-19 00:01:34 -05:00
June McEnroe 1a2477ef7a Implement new line editing "library"
Losing tab complete and text macros, for now.

This new implementation works on an instance of a struct and does
not interact with the rest of catgirl, making it possible to copy
into another project. Unlike existing line editing libraries, this
one is entirely abstract and can be rendered externally.

My goal with this library is to be able to implement vi mode. Since
it operates on struct instances rather than globals, it might also
be possible to give catgirl separate line editing buffers for each
window, which would be a nice UX improvement.
2022-02-18 23:47:11 -05:00
June McEnroe 573bc855a6 Simplify cursor positioning in input
Do some extra work by adding the portion before the cursor to the
input window twice, but simplify the interaction with the split
point. This fixes the awkward behaviour when moving the cursor
across colour codes where the code would be partially interpreted
up to the cursor.
2022-02-18 23:39:46 -05:00
June McEnroe 0036e6e9f0 Fix M-f ordering 2022-02-18 22:40:16 -05:00
June McEnroe 28a27a2c0f Move sandman build to scripts/Makefile 2022-02-12 20:19:18 -05:00
June McEnroe c95c8cd1b4 Use compat_readpassphrase.c on Linux 2022-02-12 13:36:24 -05:00
June McEnroe edad0218c1 Copy RPP defines from oconfigure
We don't use any flags, so just define them in the compat source
file.
2022-02-12 13:36:24 -05:00
June McEnroe 6013ae1513 Import compat_readpassphrase.c from oconfigure
At 5d08070de6aadd979e3752263d2ec1e709bf037e.
2022-02-12 13:28:26 -05:00
June McEnroe 397b4ce6bd Prompt for empty server or SASL passwords 2022-02-12 13:26:38 -05:00
June McEnroe 9c384de6db Treat any amount of space and punctuation as word boundaries
This matches behaviour of, e.g. zsh -o emacs.
2022-02-09 17:55:33 -05:00
June McEnroe 8dec54801c Add M-s to (temporarily) reveal spoiler text 2022-02-03 22:10:54 -05:00
June McEnroe ceee69f905 Add C-z s to set spoiler text 2022-02-03 21:50:31 -05:00
June McEnroe 605f889ab5 Avoid sending null byte in SASL PLAIN
Woops! BASE64_SIZE is the size of the string buffer. Somehow ergo
is the only server software (that I know of) to reject the accidental
null byte.

Reported by smlavine.
2022-01-16 14:17:46 -05:00
June McEnroe e7cec13723 Use Cold for away notices in queries
So that they can be hidden with M-+.
2022-01-16 14:17:03 -05:00
June McEnroe adff312570 Refer to long option names, prefix commands with $ 2021-12-11 20:55:42 -05:00
Alyssa Ross 431230e0ea Support custom pkg-config executable names
When cross-compiling, it's common to have executables prefixed with
the name of the architecture you're building for,
e.g. aarch64-unknown-linux-musl-cc or x86_64-unknown-freebsd-pkg-config.
Lots of build tools support a PKG_CONFIG environment variable to
enable this use case.

With this change, I was able to successfully cross-compile and run
catgirl.
2021-11-22 12:30:31 -05:00
C. McEnroe 9c1b241c17 Cycle between adding colon suffix and not in tab complete
Allows completing a nick at the beginning of a message without a
colon by continuing to press tab, as well as after another nick
already followed by a colon without turning it into a comma-separated
list of nicks all followed by a colon. For example, tab can be used
to cycle between the following pairs:

    nick1: |
	nick1 |

	nick1, nick2: |
	nick1: nick2 |
2021-11-19 14:44:16 -05:00
C. McEnroe bd3e0ac76b Make the /ops response more flavourful
How did this normal sounding format string get in there!
2021-11-16 14:16:43 -05:00
C. McEnroe d06ac675c6 Handle RPL_WHOISSPECIAL
<https://modern.ircdocs.horse/index.html#rplwhoisspecial-320>
2021-11-10 20:31:27 -05:00
C. McEnroe 4363d4b535 Parse IRC formatting in timestamp string
Strip formatting when calculating the timestamp width to avoid
moving a bunch of code around. Use styleAdd (now with an initial
style parameter) to show timestamps.

This allows changing the style of the timestamps from the default
gray using literal IRC formatting codes in the string. Not ideal,
but no new options needed.

Suggested by Hoël Bézier and Sebastian LaVine.
2021-10-28 17:56:16 -04:00
psykose 27b5fd0251 Fix strptime decode for musl libc
POSIX does not define a %F for strptime[1], but does define %F for
strftime[2]. Afaik most libc's implement %F for both, but musl is very
standards-compliant and does not have %F on strptime, leading to
unparsed message tag times, which causes all backlog sent from bouncer
on startup to have a timestamp of the current time, instead of the
actual timestamp sent.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html
[2] https://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html
2021-10-26 12:27:54 -04:00
C. McEnroe fca48fd05d Increment replies for list modes with /mode
Otherwise only /ban can be used to list bans and /mode b or /mode
+b won't show the listing.
2021-10-17 11:55:43 -04:00