mrjohannchang / zsh-interactive-cd

Fish like interactive tab completion for cd in zsh
Mozilla Public License 2.0
314 stars 37 forks source link

doesn't work with BSD sed (assumes GNU sed) #21

Closed garymm closed 2 years ago

garymm commented 2 years ago

When running on MacOS, the sed commands fail with:

sed: illegal option -- -
usage: sed script [-Ealnru] [-i extension] [file ...]

I believe this is because MacOS ships with BSD sed and this assumes GNU sed.

I fixed this by installing gnu-sed and setting up PATH so that sed resolves to GNU sed, but I guess it'd be nice to have this code handle BSD sed properly, perhaps by sticking to just the subset of the interface that is common across all of POSIX, or at least detect the problem and issue a nice error message.

Details on some of the differences: https://unix.stackexchange.com/questions/13711/differences-between-sed-on-mac-osx-and-other-standard-sed

Thanks a lot for this code!

garymm commented 2 years ago

Actually I think this may have been fixed in https://github.com/changyuheng/zsh-interactive-cd/commit/a2f9cd16ea867b20a0dc76d4dbf1c2bdd8918465, but the version distributed by oh-my-zsh is really old!