dundalek / closh

Bash-like shell based on Clojure
Eclipse Public License 1.0
1.61k stars 65 forks source link

Pressing tab: error when fish isn't installed #99

Closed jeroenvandijk closed 5 years ago

jeroenvandijk commented 5 years ago

After the fix of #92 I now get an error when tabbing that fish hasn't been installed:

$ (sOct 11, 2018 1:52:43 PM org.jline.utils.Log logr
INFO: Error while finding completion candidates
java.io.IOException: Cannot run program "fish" (in directory "/Users/jeroen/bin/closh"): error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at closh.zero.platform.process$shx.invokeStatic(process.clj:88)
    at closh.zero.platform.process$shx.invoke(process.clj:46)
    at closh.zero.platform.process$shx.invokeStatic(process.clj:49)
    at closh.zero.platform.process$shx.invoke(process.clj:46)
    at closh.zero.service.completion$get_completions_spawn.invokeStatic(completion.cljc:33)
    at closh.zero.service.completion$get_completions_spawn.invoke(completion.cljc:28)
    at closh.zero.service.completion$complete_fish.invokeStatic(completion.cljc:51)

Looking at the code, it is indeed assumed fish is installed. Is this a requirement of closh? Should be optional, right?

(Checked out at 1e7aaaf1b129b7991fbcbe1b3d1a24234cea1958)

dundalek commented 5 years ago

Yeah, these should not throw and be wrapped in try/catch. The idea is to try fish first because it has imho the best completions. Then fall back to other shells.

Looks like I need to do more testing on fresh environments.