aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc.d/clwr.bash9
1 files changed, 9 insertions, 0 deletions
diff --git a/bash/bashrc.d/clwr.bash b/bash/bashrc.d/clwr.bash
new file mode 100644
index 00000000..a12ced4c
--- /dev/null
+++ b/bash/bashrc.d/clwr.bash
@@ -0,0 +1,9 @@
+# Clear screen, accept line, write to all args, loop; use this as e.g. an input
+# tmux window for a minimal IRC client like ii(1). Uses read -e to allow
+# newlines.
+clwr() {
+ while { clear && IFS= read -er line ; } ; do
+ printf '%s\n' "$line"
+ done
+}
+