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

Quote cd invocations for enhancd compatibility #57

Closed
wants to merge 1 commit into from

Conversation

ilkka
Copy link

@ilkka ilkka commented Dec 1, 2015

Enhancd aliases cd such that plain "cd -q" doesn't work any more. Add quotes to use the unaliased cd, which makes this again compatible with enhancd.

This fixes #56.

Enhancd aliases cd such that plain "cd -q" doesn't work any more. Add quotes to use the unaliased cd, which makes this again compatible with enhancd.
ilkka pushed a commit to ilkka/dotfiles that referenced this pull request Dec 1, 2015
Remember to fix the "cd -q" bits if supercrabtree/k#57
isn't merged yet.
@ELLIOTTCABLE
Copy link

… wow, I've never looked into the semantics of the command itself being in quotes.

Does this definitely work? And, hell, I've never seen it before … is it sufficiently idiomatic / common? (I come from less-zsh-specific lands; though, I definitely see command used a lot)

@ilkka
Copy link
Author

ilkka commented Dec 2, 2015

I think it's the idiomatic way of skipping alias expansion in all shells, yeah. And it 100% fixed it for me, I'm rockin' a hacked version right now :) As for command, that's actually more foreign for me. I am using command -v instead of which to see if stuff is installed for… some reason I can't really remember, but it is objectively better IIRC. I dunno how you'd use command here though.

@ELLIOTTCABLE
Copy link

well, in this context, command is the POSIX-sh way to “run this builtin, ignoring all shell functions and the $PATH”, AFAIK. Has nothing to do with aliases, now that I think about it (I never use aliases.)

Maybe it's in fact best if we use both, then? command 'cd' …, that might be taking it too early

@ilkka
Copy link
Author

ilkka commented Jan 6, 2016

Walp, I set up a new machine and bumped into this again, and decided to take another look. man zshbuiltins has this to say about command:

The simple command argument is taken as an external command instead of a function or builtin and is executed. If the POSIX_BUILTINS option is set, builtins will also be executed but certain special properties of them are suppressed.

So in fact without special configuration (I don't believe POSIX_BUILTINS is set by default) command cd does not work.

@ELLIOTTCABLE
Copy link

Whoa, what. This conflicts with everything I've ever used command for. Going to take some investigation on my part.

If I suggested badly … forgive me! D:

@ilkka
Copy link
Author

ilkka commented Jan 7, 2016

@ELLIOTTCABLE hey don't worry, I didn't know that either and was quite surprised when command cd didn't work :)

@jedahan
Copy link

jedahan commented Jan 8, 2016

Maybe checkout #59 ? Sorry for submitting without looking at the pull requests TT

@supercrabtree
Copy link
Owner

Hi @ilkka and @ELLIOTTCABLE I installed enhancd and @jedahan's (#59) pull request fixed the issue. So I merged that and will close this.

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

Successfully merging this pull request may close these issues.

Incompatible with enhancd
4 participants