dundalek/closh

Incorrect result with non-existing command

dundalek opened this issue · 0 comments

E.g. in JVM version

$ jeroen  (sh-value "git2" "--version")
git2: command not found
{:stdout "", :stderr "", :code 0}

In lumo version (returns negative return code):

(sh-value "git2" "--version")

Command 'git2' not found, did you mean:

  command 'gitl' from snap gitl (1.1)
  command 'gitg' from deb gitg
  command 'git' from deb git
  command 'gitk' from deb gitk

See 'snap info <snapname>' for additional versions.

git2: command not found
{:stdout "", :stderr "", :code -2}

bash returns code 127:

me@thinkpad:~$ git2

Command 'git2' not found, did you mean:

  command 'gitl' from snap gitl (1.1)
  command 'gitg' from deb gitg
  command 'gitk' from deb gitk
  command 'git' from deb git

See 'snap info <snapname>' for additional versions.

me@thinkpad:~$ $?
127: command not found

Also when stderr is redirected then no output is shown:

me@thinkpad:~$ git2 2> /dev/null
me@thinkpad:~$ echo $?
127