Live data from Hacker News

Show HN: tere – A Faster Alternative to cd+ls

github.com

41–50 of 206 posts

Re: Show HN: tere – A Faster Alternative to cd+ls

#41
post #13

> "Tere" means "hello" in Estonian. It also feels nice to type. I really thought it was initially a typo on "tree" (the tool's purpose is to navigate the folder tree) that the author decided to keep.

I think the origin might be ”[ter]minal file [e]xplorer”, though the author might correct me here. ”Tere” is also, perhaps unsurprisingly, used in Finnish.

I would say that terminal explorer is what I had in mind initially (and incidentally, I also speak Finnish, heh). But a misspelling of tree is certainly a valid interpretation as well :)

Re: Show HN: tere – A Faster Alternative to cd+ls

#42
post #38

I strongly dislike the idea of automatically jumping into a folder when there’s only one match: it feels like a feature optimised for very slow typers that actively penalises fast typers, because it makes things generally unpredictable: will one character be enough to navigate, or two, or three? It depends on the siblings, and if you type more characters than are required, you will be penalised by ending up somewhere…

I'm a fast typer, and I understand where you're coming from! But note how there's a small (200ms by default but can be configured) delay when the auto-cd happens. This is actually pretty important, because otherwise it's impossible to see where you cd'd to. Importantly, during this delay, the keystrokes are eaten (so they are not fed down to the next level), and from my experience this is enough to basically never ac…

OK, delay sounds good.

Re: Show HN: tere – A Faster Alternative to cd+ls

#45
post #43

I also created a such tool llama: https://github.com/antonmedv/llama But with fuzzy searching.

Nice, looks like this is indeed very similar to tere! I guess the biggest difference is that the current search is not as "sticky", looks like it's cleared automatically after a while, which is similar to the behavior of the windows file explorer. I added it to the list of similar programs in the README (it's in the develop branch for now).

Re: Show HN: tere – A Faster Alternative to cd+ls

#47
post #37

Congrats for getting this out! > I also wanted an excuse to learn This is the best reason ever, and not just for you: seeing your GIF I thought "could I achieve that with fzf?". Turns out, yes I can: function fcd() { local dir; while true; do # exit with ^D dir="$(ls -a1p | grep '/$' | grep -v '^./$' | fzf --height 40% --reverse --no-multi --preview 'pwd' --preview-window=up,1,border-none --no-info)" if [[ -z "${dir}…

Nice! exa (an attempt at a better ls) has a -D option, so then it is `exa -a1D` without the grep. I created a second version that also adds -R for searching the recursive directory tree with `exa -a1DR | grep : | cut -d ':' -f 1`

Re: Show HN: tere – A Faster Alternative to cd+ls

#49
post #40
post #37

Congrats for getting this out! > I also wanted an excuse to learn This is the best reason ever, and not just for you: seeing your GIF I thought "could I achieve that with fzf?". Turns out, yes I can: function fcd() { local dir; while true; do # exit with ^D dir="$(ls -a1p | grep '/$' | grep -v '^./$' | fzf --height 40% --reverse --no-multi --preview 'pwd' --preview-window=up,1,border-none --no-info)" if [[ -z "${dir}…

Thanks for the kind words! :) While digging up alternatives (of course after I had already written most of the functionality), I briefly tried out fzf. I think at that time I couldn't find an example snippet like yours to do the cding, so I didn't look into it much more. With some basic settings, it was also not easy (or even possible?) to go up in the folder tree, but I see that your example handles that. If you're…

> fzf (or another very similar tool that is designed for this purpose, broot) can be more efficient

Well, fzf is only a selection tool, it's more about the tool that feeds fzf data ;) That's why I used a dumb ls in my example. Maybe a difference with yours is that it does perform cd on each loop, and there's no way to bail out and not cd.

> it might take a while for it to scan all subfolders.

Haha yeah, for recursive cases I was using ripgrep as fzf default command:

    rg --files --no-ignore --hidden --follow --glob "!{.git,node_modules}/*" | fzf
And now I just discovered fd[0]:

    fd --no-ignore --hidden --follow --strip-cwd-prefix | fzf
(...at least essentially, my setup is a bit more tunable and complex, I have a few of these with varying flags depending on the situation and goal)

[0]: https://github.com/sharkdp/fd#using-fd-with-fzf

Re: Show HN: tere – A Faster Alternative to cd+ls

#50

This looks very cool. The demo has convinced me to try it, well done! Also typical hacker news - "why don't you just use Vim"? Ha. Ignore the naysayers.

I was well prepared mentally for the HN cynicism, and I did spend quite a bit of mental energy to justify the existence of tere to myself. Luckily I have a good rebuttal: I already use vim! :)
Post reply on HN