Hey everyone, I'm in the main engineer on this project if anyone has questions.<p>Facebook has a large codebase, so naturally we have a lot of long filenames and paths. It's a pain to type these out by hand, so I'd see a lot of (new) engineers select the text with their mouse before pasting it into the command line.<p>This is pretty inefficient and I knew there had to be a better way, so a few of us started hacking on a set of python regexes and a curses UI. Before long we had a pretty simple / easy command line utility that sped up everyones' day.<p>After a while we realized this would probably be helpful to all, so we open sourced it today!
One of the best little-known features of iTerm2 is Semantic History. Cmd-click on filenames and they will be opened by the default application (or you can configure an action to be performed). It's working directory aware and works great with all output. I connected it to Sublime and it even works with line numbers.<p>(Same works for URLs, with the default browser)
I have a similar workflow already that may be of use to vim users. I pipe file lists (from grep etc) into vim (using a '-' to tell vim to read from stdin):<p><pre><code> grep -nri searchterm * | vim -
</code></pre>
You can then use 'gF' over a file name to open the file in question (and be taken to the right line number if specified in the form somefile.txt:42). You can use '<c-w>gF' to open the file in a new tab, or '<c-w>F' to open the file in a split instead.<p>As an added bonus you can re-filter the file list from within vim to, for example, remove things from a test directory without having to run the original command again:<p><pre><code> :%!grep -v ^test</code></pre>
Dozens of cool utilities like this are created every week and launched at Show HN, but without "Facebook" in their names you need at least 10 of them to get the many points this thread has gathered.
A while back I wrote a similar tool in go to scratch my own itch and use it every day: <a href="https://github.com/robbiev/numberwang" rel="nofollow">https://github.com/robbiev/numberwang</a>
I use fzf[0] for similar purposes.<p>[0] <a href="https://github.com/junegunn/fzf" rel="nofollow">https://github.com/junegunn/fzf</a>
Hey guys, great tool. Just want to point out it doesn't play well with ack (a better grep) because ack does not prepend a "./" to the file list returned from "ack -l 'foo'". Any way to make it work with the following:<p>junk/foo/bar.txt<p>instead of just<p>./junk/foo/bar.txt<p>?
This is a great tool.<p>However, he authors/documentation seem to be confused about bash vs shell. In the documentation these terms seems to be used interchangeably. In the code, the main script depends on bash directly (and for it to be installed in a very particular place) but does not seem to use any bash-specific features. However, the script it launches at the end is launched via "sh" which is not bash, so if there're bash specific features in it it would fail.<p>"PathPicker should work with most Bash environments" -- what does that even mean?
I see a lot of alternatives to this in the comments. Allow me to offer another: <a href="https://github.com/garybernhardt/selecta" rel="nofollow">https://github.com/garybernhardt/selecta</a>
<i>Some people, when confronted with a command line problem, think "I know, I'll use my mouse." Now they have two problems.</i><p>I'm joking, and this looks neat, but the optimal solution is almost certainly to keep your hands on the keyboard while in the shell.
This is awesome. I wonder if any of this was Emacs inspired. A very common UX in Emacs is to list things in a buffer and directly manipulate the items to execute commands. For example, in dir-mode, you can select multiple files and rename them, or mark several files for deletion and execute it.<p>It really is a fantastic way to bring an interactive interface into a text-based world. This looks like a cool way to bring it to the terminal.
That is great!<p>But when using the command, it does not work with defined bash/zsh aliases. Anyone has any idea how to do that?<p>Say I have "alias g=git", when I use the command "g diff", the following error happens:
.fbPager.sh: line 4: g: command not found
Is there a way of using this with instructions that take only one parameter, akin to xargs or parallel?<p>i.e. Instead of calling `command file1 file2 file3 ...` it would call `command file1; command file2; command file3; ...`?
I wrote a small snippet to integrate this with tmux. Simply press <Leader-i> for the current buffer to be run through fpp.<p>See a small example here: <a href="http://recordit.co/U2TYvbPC9p" rel="nofollow">http://recordit.co/U2TYvbPC9p</a><p>And here's the corresponding code: <a href="https://github.com/jbnicolai/tmux/blob/master/.tmux.conf#L127" rel="nofollow">https://github.com/jbnicolai/tmux/blob/master/.tmux.conf#L12...</a>
Going though this thread, so far we have fpp, selecta, peco, percol, numberwang, fzf... Wewh! They are all, how could we call it, command line selector tools? What I'd love to read is a nice comparative review of these tools.<p>Although I kind of enjoy the process of going though each one and studying how the features fit my own workflow.
If you're only using this with git, I use git-number[1] for this purpose.<p>[1] <a href="https://github.com/holygeek/git-number" rel="nofollow">https://github.com/holygeek/git-number</a>
Is there a reason why this is named Facebook PathPicker instead of PathPicker? It seems that the original author is giving up rights of their software to Facebook (it says copyright Facebook right in the license).<p>What troubles me is that this tool seems completely unrelated to Facebook's business so why must they assert ownership of their employee's side project? On the other hand, it could be the author's intent to give up their rights to Facebook, which seems dumb, there's nothing the author could gain from that other than the Facebook brand in front.
Looks nice. Is it better than the built-in "arrow-keys-browseable" menu completion of zsh? (Random "screenshot" available at <a href="http://www.masterzen.fr/2009/04/19/in-love-with-zsh-part-one/" rel="nofollow">http://www.masterzen.fr/2009/04/19/in-love-with-zsh-part-one...</a> under "Menu selection")<p>I've always been wanting an integrated file picker on unix that was as efficient as the ones in the venerable 4DOS (and 4NT) shells.
Related: It would be great if your terminal were just clever enough to identify paths and allow you to click on them to open them. Many do this for <a href="http://" rel="nofollow">http://</a> links, but not fs links.<p>Bonus: include <line>:<column> in the path since most editors support jumping in the file with this format, which would make it much easier to navigate to a specific spot in your code where an error is occurring from the output of the error.
This tool is awesome. It would be better if you add a search feature in the selector UI. I know that we could do that in the command itself but it would if helpful in case we forgot previously or need further filtering<p>Also, it is failing to select the entire file if there are spaces in it
I don't use an editor that runs in the terminal so I only ever want a tool like this for the command mode. When you use it right it's pretty nice, but the first time I was unceremoniously dumped into vim. (Yes I know about the EDITOR variable)
And in case anyone didn't know about something that does the same for URLs on-screen: here's urlview.<p><a href="http://linuxcommand.org/man_pages/urlview1.html" rel="nofollow">http://linuxcommand.org/man_pages/urlview1.html</a><p>:-)
Impressive. I was very happy with percol.
Now I see other possibility. I really like the "select first, then comes the command" approach.<p>I hope you can add support of selecting directories, and fuzzily filtering results(like what percol does).
There's a nice command line interface git client called `tig`. <a href="https://github.com/jonas/tig" rel="nofollow">https://github.com/jonas/tig</a>
I like using vipe from moreutils ( <a href="https://joeyh.name/code/moreutils/" rel="nofollow">https://joeyh.name/code/moreutils/</a> )<p>find . |vipe | xargs ...
Looks like it has issues running with nosetests. It would be awesome, if I could do nosetests runtests.py | fpp and if any test fails, i could select it and it would open it up in my editor.
Thanks for giving back!<p>I'm not sure how this would speed up my workflow more than a combination of tab completion, CTRL-R, and quick rushes of double-click-to-select-then-third-button-to-paste, though.
I use a combination of grep (to filter), awk (for projection), and xargs (to execute) to achieve similar result but it probably takes a little longer to construct.
cool idea, thanks for sharing! for some reason, everything is working but the ability to move up and down, regardless of whether i use arrow keys or j/k. any ideas?<p>EDIT: should note i am using iTerm on a Mac
Haven't we learned by now, my fellow HN readers? All of Facebook's open source "gifts" are patent Trojan horses. Go take a look at their PATENTS file before going anywhere near this stuff.<p>The fact that Facebook, at such a level of wealth and success, gets away with this stuff is despicable. It's also an insult to the great legacy of companies like Sun, which gave freely without strangling its beneficiaries. It says a lot about the culture and leadership at the company, but that's been well-documented...<p>If you're a passionate engineer at Facebook working on an open source project, please go work on it somewhere else!