Fakerr / git-recall

An interactive way to peruse your git history from the terminal
MIT License
2.12k stars 47 forks source link

Cannot navigate with arrows in terminal on macOS #3

Closed kevinquillen closed 7 years ago

kevinquillen commented 7 years ago

Installed git-hlog by copying the script to /usr/local/bin and chmod u+x on it.

The command works,

Navigated to a folder with a git repo with history, typed:

git hlog -d 10

It shows me commits from the last 10 days. However, there is a warning at the top of the output:

/usr/local/bin/git-hlog: line 134: lesskey: command not found

I cannot navigate down the commits with the arrow keys whatsoever. On top of that, hitting tab expands the commit but overlaps everything in the window (zsh or bash exhibit the same behavior in the vanilla Terminal app on mac).

Quitting out prints this to terminal:

rm: /Users/kevinquillen/.lsh_less_keys_tmp: No such file or directory

Doing which lesskey results in lesskey not found which is likely why this isn't working for me at the moment.

Looks like a great tool otherwise and would love to get this working!

kevinquillen commented 7 years ago

Looks like OSX does not ship with the lesskey option for less. Following this post, I ran

brew install homebrew/dupes/less

Now I do not get either error stated above, but I still cannot navigate commits with arrow keys, and tab expands and overwrites the existing window instead of expanding below the prompt.

Fakerr commented 7 years ago

Hey Kevin, thanks for reporting the issues.

Concerning the tab expands, right now the script cannot handle the case where the sum of lines between the commits and a commit's diff is higher than the terminal screen. For that case, I'm using the less command to display the diff in a separate screen (I recognize that it is a sort of limitation and it makes the tool less nicer but I'm trying to figure out a way to get rid of less but it's not that trivial ...). Actually, I should have precised that in the README to avoid confusions.

For the arrow keys problem, I need your help here. Can you tell me which term are you using ? (echo $TERM).

kevinquillen commented 7 years ago

xterm-256color

Fakerr commented 7 years ago

Hmm, not sure why it's not working. Can you update the script you installed with the latest version and try to use j and k to navigate the list ? I wanna see if it's related to the arrow keys ansi code and not from something else. Thanks.

oguzkonya commented 7 years ago

I had the same issue, and applied the less fix. And I confirm that arrow keys do not work, but j and k keys work.

Cheers

Fakerr commented 7 years ago

Issue resolved with Bash 4.3 or >