Skip to content
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

"browse" is broken: command not found: type -t xdg-open #47

Closed
blueyed opened this issue Jul 29, 2010 · 3 comments
Closed

"browse" is broken: command not found: type -t xdg-open #47

blueyed opened this issue Jul 29, 2010 · 3 comments

Comments

@blueyed
Copy link
Contributor

blueyed commented Jul 29, 2010

browse_command calls command, but that fails in both zsh and bash for me:
$ git browse
/home/user/bin/hub:648: command not found: type -t xdg-open
/home/user/bin/hub:648: command not found: type -t cygstart
Please set $BROWSER to a web launcher to use this command.

The same with zsh.

The fix appears to be using which instead, where I will provide a topic branch for in a moment.

@rtomayko
Copy link
Contributor

type is writing those error messages to stderr. It's working properly. I think stderr just needs to be redirected to /dev/null.

@blueyed
Copy link
Contributor Author

blueyed commented Jul 30, 2010

  1. it will never work with zsh, where -t is not known:
    % type -t foo
    zsh: bad option: -t
  2. It seems that with bash, the builtin type does not get properly handled with ````, unlike to when usingsystem: "command not found: type -t xdg-open" means that`type -t xdg-open`is being executed as command, and not`type`with`-t xdg-open`as command arguments.
    I do not know why`which` is different (apparently it is a shell builtin, too), but it works.
    Where have you tested this, bash I assume?

In zsh and bash (both via cygwin now):
% ruby -e 'type type'
-e:1: command not found: type type

When used in the shell directly:
% type type
type is a shell builtin

You're (partly) right about redirecting stderr though: this is required for which, but it should not be required for type: the command not found: type type error does not mean that type is not found, but that type type is not found (as a command).
I will add redirection to stderr to my topic branch.

@defunkt
Copy link
Contributor

defunkt commented Aug 9, 2010

Merged in 76081e5, thanks!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants