summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--catgirl.13
-rw-r--r--irc.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/catgirl.1 b/catgirl.1
index 2638d6f..b8c912a 100644
--- a/catgirl.1
+++ b/catgirl.1
@@ -90,6 +90,9 @@ the same as the nickname.
 Show raw IRC protocol in the
 .Sy <raw>
 window.
+If standard error is not a terminal,
+output raw IRC protocol
+to standard error.
 .
 .It Fl w Ar pass
 Log in with
diff --git a/irc.c b/irc.c
index a8dc2dd..2ad6d19 100644
--- a/irc.c
+++ b/irc.c
@@ -111,6 +111,7 @@ void ircFmt(const char *format, ...) {
 	va_end(ap);
 	if (!buf) err(EX_OSERR, "vasprintf");
 	if (self.raw) {
+		if (!isatty(STDERR_FILENO)) fprintf(stderr, "<<< %.*s\n", len - 2, buf);
 		uiFmt(TagRaw, UICold, "\3%d<<<\3 %.*s", IRCWhite, len - 2, buf);
 	}
 	ircWrite(buf, len);
@@ -142,6 +143,7 @@ retry:
 	while (NULL != (crlf = memmem(line, &buf[len] - line, "\r\n", 2))) {
 		crlf[0] = '\0';
 		if (self.raw) {
+			if (!isatty(STDERR_FILENO)) fprintf(stderr, ">>> %s\n", line);
 			uiFmt(TagRaw, UICold, "\3%d>>>\3 %s", IRCGray, line);
 		}
 		handle(line);
='2019-10-27 00:24:48 -0400'>2019-10-27Drop clients on zero-length readsJune McEnroe 2019-10-27Explicitly tls_handshake new clientsJune McEnroe 2019-10-26Document rationaleJune McEnroe 2019-10-26Handle nick collisionJune McEnroe 2019-10-26Wait for AUTHENTICATE + from serverJune McEnroe 2019-10-26Respond to PING with same parameterJune McEnroe 2019-10-26Add undocumented flag to disable verificationJune McEnroe 2019-10-26Do not require RPL_ISUPPORT for stateReadyJune McEnroe 2019-10-26Implement graceful shutdownJune McEnroe 2019-10-26Require PASS before USERJune McEnroe 2019-10-26Track channel topicsJune McEnroe 2019-10-26Set AWAY when no clients are connectedJune McEnroe 2019-10-26Add flags to request TOPIC and NAMES on client connectJune McEnroe 2019-10-26OopsJune McEnroe 2019-10-26Disconnect client on unknown commandJune McEnroe 2019-10-26Allow reading sensitive information from filesJune McEnroe 2019-10-26Add rc scriptJune McEnroe 2019-10-25Add install and uninstall targetsJune McEnroe 2019-10-25Expand documentationJune McEnroe 2019-10-25Add AGPLv3 notice on client registrationJune McEnroe 2019-10-25Rename project pounceJune McEnroe