From 0f981c053497c6834acc31a258217a0e8411807d Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Tue, 15 Feb 2022 23:56:34 -0500 Subject: [PATCH] bin: Add new `demo(1)` for `script(1)` support I frequently want to get the output of commands to a coworker and script(1) would be a nice tool to use, with a few caveats: 1. Escape sequences don't transfer well 2. Muscle memory has me using my aliases demo(1) solves both of these by spawning a new shell without my aliases and with TERM=dumb to prevent the sequences. It also sets a blank prompt, which is frequently desirable when sharing snippets (frequently my PWD is not useful / adds noise). Excited to try it out tomorrow! --- bin/demo | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 bin/demo diff --git a/bin/demo b/bin/demo new file mode 100755 index 0000000..0e07a47 --- /dev/null +++ b/bin/demo @@ -0,0 +1,11 @@ +#!/bin/sh +# demo -- script(1) wrapper with shell config for better copy/pasta +cat </tmp/demo.env +export TERM=dumb +export PAGER=cat +alias g="echo 'Use the full command during demo(1)!'" +PS1='\$ ' +EOM + +export ENV=/tmp/demo.env +script /tmp/demo.out -- libgit2 1.1.1