madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://"]
  insteadOf = madduck:

improve TS typescript handler
authormartin f. krafft <>
Thu, 1 Mar 2018 02:48:59 +0000 (15:48 +1300)
committermartin f. krafft <>
Thu, 1 Mar 2018 02:48:59 +0000 (15:48 +1300)

index b887ba64030017f38a783eee09acdc553b4be16a..f44c0582bf36edbd47b379ac5833146b8eb9bf8d 100644 (file)
@@ -86,14 +86,21 @@ zle -N _copy_reply
 bindkey '\ec' _copy_reply
 TS() {
-  local topic ret quiet
-  typeset -g REPLY
+  local topic ts ret script
-  REPLY="${TMPDIR:-/tmp}/script.${topic:-$LOGNAME}.$$.${(%):-"%D{%Y%m%d.%H%M}"}"
+  ts=${(%):-%D{%Y-%m-%d-%H%M}}
+  script="${TMPDIR:-/tmp}/$ts.$$.${topic:-$LOGNAME}.typescript"
-%# " RPS1= script -qe -c "zsh -f" -f "$REPLY"
+%# " RPS1= script -qe -c "zsh -f" -f "$script"
-  zinfo "typescript is in $REPLY ."
+  zinfo "typescript is in $script ."
+  typeset -g REPLY
+  REPLY="$script"
+  if command -v unterm >/dev/null; then
+    REPLY="${script}.txt"
+    unterm "$script" > "$REPLY"
+  zinfo "plain text transcript is in $REPLY ."
+  fi
   return $ret