skywind3000 / z.lua

:zap: A new cd command that helps you navigate faster by learning your habits.
MIT License
2.94k stars 137 forks source link

Interactive selection mode does not works on Mac Terminal #174

Open chenzixin1 opened 1 year ago

chenzixin1 commented 1 year ago

I typed the comamdn with the parameter “-i”, but I can't interact with the termial , no > {光标位置} shown .

Here is the result.

➜ prometheus-2.41.0.darwin-arm64 z -i 8 /Users/chenzixin/Downloads/南京 11.5 /Users/chenzixin/Downloads 104 /Users/chenzixin/Downloads/prometheus-2.41.0.darwin-arm64 ➜ prometheus-2.41.0.darwin-arm64

skywind3000 commented 1 year ago

keywords are required, at least input a dot .

z -i something

or

z -i .

If you have fzf installed:

z -I something

or

z -I .
chenzixin1 commented 1 year ago

thanks for the reply

ilyagr commented 1 year ago

I recommend something like the following (for the fish shell):

function zi --wraps='z -i' --description 'alias zi=z -i and some smarts'
        if set -q argv[1]
            z -i $argv
        else
            z -i .
        end
end

The bash/zsh version would be something like (untested)

#!/bin/sh

zi() {
  if [ "$1"  = "" ]; then
    z -i .
  else
    z -i "$@"
  fi
}