-
-
Notifications
You must be signed in to change notification settings - Fork 763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Executable File Existence Check #5963
Comments
If you just want to know which shells are available on the system, you can check |
Ran into similar issue where I wanted to use fish if it exists. I have used homebrew so it install fish at So I have added the following to my western config. local function file_exists(path)
local f = io.open(path, "r")
if f~=nil then io.close(f) return true else return false end
end
if file_exists("/opt/homebrew/bin/fish") then
config.default_prog = { '/opt/homebrew/bin/fish', '-l' }
else
config.default_prog = { '/bin/bash', '-l' }
end If I want to add it to launch menu I would also need an if else here. { label = "fish", args = {"/opt/homebrew/bin/fish", "-l"} It almost seems like there should also be an easy way to add |
Another option for this is use
Glob expressions can include multiple candidates, so you can check for multiple paths at the same time. Here I'm checking for zsh, bash, fish and csh:
|
Hi,
I am encountering the same issue as described here. The suggested solution there does not appear to be optimal. To determine the availability of executables in the path, I implemented the following function:
While this performs as expected on Linux, on Windows each call results in the spawning of a shell window. This not only disrupts the visual flow but also significantly increases startup time when multiple checks are performed.
My goal is to determine which shells are available on the system to dynamically create launch_menu entries.
I would greatly appreciate a more efficient approach to address this issue.
Thank you.
The text was updated successfully, but these errors were encountered: