extensions icon indicating copy to clipboard operation
extensions copied to clipboard

process.env.PATH should be defined with the user shell PATH

Open remorses opened this issue 4 days ago • 0 comments

Description

Currently many extensions hardcode the executable paths, this is needed because on Mac and Windows you cannot run executables by name if there is no PATH defined to let the Node.js know where to find the executable path

Here is an example extension that hardcodes the executable path to the brew directory (this causes many issues, for example for users that installed executables in different locations, or in the case brew installs binaries in a different location)

https://github.com/raycast/extensions/blob/27c8726a793b985df4cc8f1a771e354e9c12b195/extensions/video-downloader/src/utils.ts#L42

The same extension also runs a which command to find where yt-dlp is installed in windows: https://github.com/raycast/extensions/blob/27c8726a793b985df4cc8f1a771e354e9c12b195/extensions/video-downloader/src/utils.ts#L44

If instead Raycast defined the env variable PATH with the user defined PATH extensions would be able to just use the executable name instead of the full path in exec calls

Who will benefit from this feature?

Extensions that currently have to hard code paths to brew executables will become much simpler and work in Windows without any modifications or complex workarounds

In the future supporting Linux will not require any change to extensions code

Anything else?

Related to https://github.com/raycast/extensions/issues/170

@mathieudutour what do you think?

remorses avatar Dec 22 '25 20:12 remorses