Save full document title

11 views
Skip to first unread message

Henry Stukenborg

unread,
Feb 6, 2026, 5:42:10 PM (21 hours ago) Feb 6
to BBEdit Talk
I have a zsh function (see below) to that populates the document title based on  information about the unix command that gets piped to bbedit

e.g. Here's my function:
logbb () {
ORIG_CMD=`tail -n1 $HISTFILE| awk -F'\;' '{print $2}'`
bbedit -t "${PWD##*/} — ${ORIG_CMD} — $(date)"
}


This becomes the BBEdit document title (edited out the actual data):
<base path> — <command and params> — <date and time>

Is there any way to capture this information in BBEdit to make it part of the document automatically? You can access the info get Get Info, but I'd like to be able to automatically grab it and make it a part of the document. 

Thanks!

-Henry

Christopher Waterman

unread,
Feb 6, 2026, 8:27:35 PM (19 hours ago) Feb 6
to bbe...@googlegroups.com
To clarify, you want that title string to also be in the body of the file?


On Feb 6, 2026, at 12:55 PM, Henry Stukenborg <hstuk...@gmail.com> wrote:
This becomes the BBEdit document title (edited out the actual data):
<base path> — <command and params> — <date and time>

Is there any way to capture this information in BBEdit to make it part of the document automatically? You can access the info get Get Info, but I'd like to be able to automatically grab it and make it a part of the document. 


If that is the case you could try adding this line to your function.

logbb () {
ORIG_CMD=`tail -n1 $HISTFILE| awk -F'\;' '{print $2}'`
bbedit -t "${PWD##*/} — ${ORIG_CMD} — $(date)
echo "${PWD##*/} — ${ORIG_CMD} — $(date)" | bbedit --prepend
}

The flags —prepend will tack the piped data to the top of the doc and — will place it at the end.
Reply all
Reply to author
Forward
0 new messages