The $PATH in BBEdit

54 views
Skip to first unread message

TJ Luoma

unread,
Jun 2, 2020, 4:20:26 PM6/2/20
to BBEdit MailingList
Quoting the "BBEdit 13.1 Release Notes" from https://www.barebones.com/support/bbedit/notes-13.1.html

> BBEdit has built-in support for cmark as well as "classic" Markdown (Gruber's original Markdown.pl script). In addition, if you have Discount, MultiMarkdown, cmark-gfm, or Pandoc installed, BBEdit can use those as well. If a particular tool is not installed, its corresponding option on the menu is disabled.
>
> Finally, the "Custom" option provides the means to specify your own rendering command and arguments. There are some rules that you must follow:
>
> The command name must be available in $PATH. You can specify a fully qualified path, but this is discouraged.
>

1. Where is BBEdit getting its $PATH definition from?

2. Can it be edited?

The reason that I ask is that for the past several years, macOS has had no good way to define the $PATH for GUI applications, and most do not even include /usr/local/bin/.

Since BBEdit can put a tool into /usr/local/bin/ then I assume it also includes /usr/local/bin/ in its $PATH but I also put scripts that I have written into /usr/local/scripts/ however there is no easy way to tell most GUI apps of that path except using a fully qualified path, so I'm wondering what I should do in BBEdit's case.

Obviously this would be easily fixable if Apple would create a way to define a $PATH for GUI apps, but since it took away the previous one and hasn't come up with an alternative for many years, I'm not holding my breath.

TJ


Rich Siegel

unread,
Jun 2, 2020, 4:54:55 PM6/2/20
to bbe...@googlegroups.com
On 6/2/20 at 4:19 PM, luo...@gmail.com (TJ Luoma) wrote:

>1. Where is BBEdit getting its $PATH definition from?

Your Unix login environment (e.g. ~/.bash_profile or equivalent
for zsh or whatever shell it is you're using). So, $PATH should
be the same in BBEdit as it is in Terminal.

R.
--
Rich Siegel Bare Bones Software, Inc.
<sie...@barebones.com> <https://www.barebones.com/>

Someday I'll look back on all this and laugh... until they
sedate me.

TJ Luoma

unread,
Jun 2, 2020, 5:33:16 PM6/2/20
to BBEdit MailingList
On Tue, Jun 2, 2020 at 4:54 PM Rich Siegel <sie...@barebones.com> wrote:

On 6/2/20 at 4:19 PM, luo...@gmail.com (TJ Luoma) wrote:

>1. Where is BBEdit getting its $PATH definition from?

Your Unix login environment (e.g. ~/.bash_profile or equivalent
for zsh or whatever shell it is you're using). So, $PATH should
be the same in BBEdit as it is in Terminal.


1. That is obviously the smartest way to do it, and so I should have assumed that would be the way that BBEdit would do it.

2. For those new to zsh, make sure that your $PATH is set in ~/.zshenv 

3. FWIW, I have used this at the top of my scripts for a long time:

if [[ -e "$HOME/.path" ]]
then
     source "$HOME/.path"
else
     PATH=/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
fi

That way I can define a PATH in a file un-creatively named ~/.path and have it automatically apply to all of my scripts (which makes it easy to update/change), but if (for some reason) that file is not there, it will use my most commonly desired PATH.

TJ




Reply all
Reply to author
Forward
0 new messages