commit ca19a7b3647d76fc1b55f1eacca0cf36000de131 (patch)
parent 69eb88690cbb651923da27521a3fd6fda5ddcddf
Author: Alex Karle <alex@alexkarle.com>
Date: Sat, 9 Oct 2021 01:06:57 -0400
irc: Add tic(1) -- ic(1) in tmux(1)
This is a fun little extension of ic(1). I found it really annoying to
have what I was typing double-shown to me (i.e. once I sent the message,
it'd appear multiplexed with the stdin feed). One solution I found was
to open a completely separate viewing panel in tmux(1) that would be
tailing the log file, with only a 1 line prompt-panel for ic(1) (with
its stdout redirected to /dev/null).
This works really well, but was a pain to set up--tmux commands to the
rescue! I was able to automate the panel setup in a new session, which
is _so_ cool :)
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/bin/tic b/bin/tic
@@ -0,0 +1,7 @@
+#!/bin/sh
+# tic -- ic(1) in tmux(1)
+# argv is passed to ic!
+tmux new-session \
+ 'log="$HOME/.irc/$(date +%F).log"; touch $log && tail -f $log | siccolor' \; \
+ split-pane "env NOCOLOR=1 ic $* >/dev/null" \; \
+ resize-pane -y 1