siddharthkp / historie

A searchable history cli
MIT License
60 stars 2 forks source link

[zsh] Would be great to have 5-8 recent commands listed already #2

Closed hamxabaig closed 7 years ago

hamxabaig commented 7 years ago

When we type historie in the command line. It'd be great to show list of recent commands say like 5-8 of them. Right now it just shows me to search, leaving me to additional key strokes. ;)

siddharthkp commented 7 years ago

That's how it works on mac 😄

Which OS are you on?

hamxabaig commented 7 years ago

haha, I'm on mac too. I'm using zsh in terminal.

siddharthkp commented 7 years ago

Interesting 🤔

Which terminal are you using?

hamxabaig commented 7 years ago

@siddharthkp zsh.

hamxabaig commented 7 years ago

Thought it'll help.

screen shot 2017-07-11 at 3 26 52 pm
siddharthkp commented 7 years ago

Hmm,

historie uses sindresorhus/shell-history

Can you check if that works with zsh?

If not, I'll try to implement it.

hamxabaig commented 7 years ago

@siddharthkp shell-history gives me all of the commands that were typed. Its working.

siddharthkp commented 7 years ago

I just tried with zsh, working for me 🙈

Can you help me debug this?

hamxabaig commented 7 years ago

Umm strange. Yeah sure, would love to help.

hamxabaig commented 7 years ago

After typing historie, it gives me nothing (as in screenshot above). But when i try to filter by typing some command name. It actually gives me the list. o.O

siddharthkp commented 7 years ago

Here's the line for the starting case:

https://github.com/siddharthkp/historie/blob/master/history.js#L15

hamxabaig commented 7 years ago

@siddharthkp Sure, I'll check this. Forked 🎉

willhoney7 commented 7 years ago

FWIW, I'm using zsh (with ohmyz.sh) and it works properly. Not sure what the cause would be for your case.

hamxabaig commented 7 years ago

@siddharthkp I checked and problem was that hint was empty when typing historie. So filtering commands with empty hint was returning empty choices. I added a check when hint is empty then i just resolve it with recent 8 commands.