Skip to content

Path returned by which depends on CWD contents #994

Description

@tiymat

Describe the bug:

[~] > g cat
Error in `g` (0,1): no data returned
[~] > which cat
cat => (/usr/bin/cat) cat - concatenate files and print on the standard output
[~] > touch cat
[~] > which cat
cat => (cat) cat - concatenate files and print on the standard output

Note the change from /usr/bin/cat when there's no cat file in CWD to cat when there is.

Expected behaviour:
/usr/bin/cat is printed, regardless of CWD contents.

Screenshots:
N/A

Platform (please complete the following information):

  • OS, output from uname -a if supported: 7.0.11-arch1-1
  • Terminal Emulator: kitty 0.47.1
  • Murex version, output from version --no-app-name: 7.2.1001 (unknown)

Additional context
Should regular files not on $PATH even be returned by which at all? If so, should the absolute path be returned, or the path relative to CWD?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnexpected behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions