News for hackers. Stuff that matters.
Re:Facebook PathPicker by xxbondsxx on Thursday May 07, 2015 @01:21PM (#9506701)
Hey everyone, I'm in the main engineer on this project if anyone has questions.

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.

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.

After a while we realized this would probably be helpful to all, so we open sourced it today!

Re:Facebook PathPicker by JohnBooty on Thursday May 07, 2015 @01:53PM (#9506931)
Oh wow, thanks! I was just thinking about this today - how I'm always cut-and-pasting file paths from ag (silver surfer) results at the console.

One thing I noticed: FPP gets confused by filenames with multiple dots. If a file is named for example "dev_backup.ldif.gz", FPP thinks that "ldif.gz" is the entire file name.

Re:Facebook PathPicker by xxbondsxx on Thursday May 07, 2015 @02:41PM (#9507288)
Yep, this is where our regexes start to fall short. Mind opening a github issue for this? We can likely add another option in our "fallback" regex, but it's a fine line to draw between overmatching and undermatching.

For instance, we currently match on "add/remove" output from git status which is less than fortunate. For performance reasons we don't actually go check if each of those files exists (since sometimes you want to pipe hundreds of results into fpp [EDIT: and are using an expandrive or network mount])

Re:Facebook PathPicker by ploxiln on Thursday May 07, 2015 @03:17PM (#9507554)

    [pierce@plo-pro team15]$ time (find . -print0 | xargs -0 stat -f '%N' | wc -l)
        4901
    
    real	0m0.079s
    user	0m0.043s
    sys	0m0.060s
Re:Facebook PathPicker by xxbondsxx on Thursday May 07, 2015 @03:21PM (#9507581)
@ploxiln -- edited my comment explaining a lot of devs here use network mounts (in which case checking for existence takes a lot longer). I'd love to explore this though, either behind a config setting or eventually as the default behavior! What do you think?
Re:Facebook PathPicker by sandyarmstrong on Thursday May 07, 2015 @03:44PM (#9507739)
I think to have usable matching you're going to have to go that way, unless you want to write custom parsing code for each command's output.
Re:Facebook PathPicker by ploxiln on Thursday May 07, 2015 @04:03PM (#9507882)
yeah, if the files are not either local or on an NFS mount with sub-millisecond latency (my test took ~ 1 second over NFS to a VM), it's going to take too long. I hadn't thought of that situation
Re:Facebook PathPicker by jankassens on Thursday May 07, 2015 @04:34PM (#9508098)
You could test for a single file (possible with a timeout) and see if it's "fast enough" to check all files.

You could also check in the background and update the display if the heuristic turned out wrong.

Re:Facebook PathPicker by o_____________o on Friday May 08, 2015 @11:54AM (#9512371)
Open all silver searcher "Foo" results in Sublime:

subl `ag -l Foo`

Re:Facebook PathPicker by neikos on Thursday May 07, 2015 @07:38PM (#9509129)
I'm not sure you know, but just in case, ag also has a -l flag with which it will just spit out the filenames!
Re:Facebook PathPicker by aristus on Thursday May 07, 2015 @01:36PM (#9506812)
Good work! when I was at FB I rolled my own, called "gitsh":

https://gist.github.com/aristus/2304335

One of the most useful features is range selection syntax, eg, run git rm on items 4-16.

Re:Facebook PathPicker by xxbondsxx on Thursday May 07, 2015 @02:00PM (#9506991)
Ah yes I remember this! I was always bad at typing out the numbers though. We support range selection as well, but it does require a keypress for each (which is less than ideal if you have a ton of entries).

Maybe we'll integrate some kind of line-number-selection-mode one day!

Re:Facebook PathPicker by kbd on Thursday May 07, 2015 @02:33PM (#9507223)
> so I'd see a lot of (new) engineers select the text with their mouse

What did the more experienced engineers do differently?

Re:Facebook PathPicker by xxbondsxx on Thursday May 07, 2015 @02:40PM (#9507276)
A lot of the more experienced engineers had cooked up their own regexes / bash aliases / crazy combination of vim macros to handle the above, but everyone had their own one-off solution that was either hard to learn or hard to generalize. The demand was definitely there though which was part of what got us motivated to build something anyone could use and learn.
Re:Facebook PathPicker by CGamesPlay on Thursday May 07, 2015 @03:35PM (#9507687)
When I was there, I would literally just never close files related to what I was working on. I had editor sessions lasting months so I didn't have to reopen all of my files.
Re:Facebook PathPicker by umanwizard on Thursday May 07, 2015 @01:55PM (#9506948)
Dude, this is awesome. I've often thought about making a tool that does exactly this, but put it on the back burner of my mind. Really cool to see someone else had the same idea, but went a step further to actually execute it :)
Re:Facebook PathPicker by fredkelly on Thursday May 07, 2015 @04:19PM (#9507970)
This looks very cool - thank you.

I've been using Pick by Thoughtbot [1] for the same purpose, but if I understand correctly fpp will automatically extract file paths from any command without me needing to chain in awk/grep ?

[1] https://robots.thoughtbot.com/announcing-pick

Re:Facebook PathPicker by nightpool on Thursday May 07, 2015 @04:34PM (#9508099)
Yeah, that seems to be the idea. It has a bunch of regexes for parsing different kinds of outputs, and some fallback ones.
Re:Facebook PathPicker by goatslacker on Friday May 08, 2015 @04:42AM (#9510572)
Hey - I was the person who used this tool the most while I was at FB. Thanks a bunch for open sourcing this I've been missing it.
Re:Facebook PathPicker by UUMMUU on Thursday May 07, 2015 @02:51PM (#9507365)
Very cool tool. Just curious as to why directories are not selectable. I did "ls | fpp" and everything got listed (directories and files) but only the files were selectable.
Re:Facebook PathPicker by xxbondsxx on Thursday May 07, 2015 @03:22PM (#9507587)
Yeah, we don't match on directories since the regex would overmatch other results (we would basically have to match anything that is words with a slash). However if we added support for checking for file / directory existence we could definitely add support for that
Re:Facebook PathPicker by atarian on Thursday May 07, 2015 @04:13PM (#9507939)
I think if you added the ability to traverse directories, that would take this tool to the next level. I kind of expected the tool to be similar to NERD Tree or Vim's explorer, which would be incredibly useful.
Re:Facebook PathPicker by ugh123 on Thursday May 07, 2015 @06:06PM (#9508670)
Don't forget about mc (midnight commander). Which is still hella useful

http://en.wikipedia.org/wiki/Midnight_Commander

Re:Facebook PathPicker by UUMMUU on Friday May 08, 2015 @09:03AM (#9511380)
Sounds like something I should give a try myself in a pull request.
Re:Facebook PathPicker by Zolomon on Thursday May 07, 2015 @04:09PM (#9507919)
I have been thinking about a more general tool that allows you to select text in different ways from some input, and either copy the selection into your paste ring or as fpp does.

I am still thinking about different selection modes and how the UI would work. Usually I see a need to either copy several full lines, or columns from a table like structure (rectangle selection) or from a regex.

Looks good so far!

Re:Facebook PathPicker by fragmede on Thursday May 07, 2015 @04:32PM (#9508083)
urxvt supports URL highlighting, so I can just click on URLs in my terminal and they open in my web browser. It's extendable too, so pdf filenames can be made into links that open in your chosen pdf viewer. I see no reason why this couldn't be extended to arbitrary filenames in your chosen text editor.
Re:Facebook PathPicker by BonoboBoner on Thursday May 07, 2015 @02:31PM (#9507207)
Thank you for making the mouse a thing in a keyboard driven world. As someone who grew up with gaming and learned IT as a result I never was able to fully give up on the mouse during my daily workflows. I admire people who can use VIM etc only by keyboard, but my muscle memory just says: mouse.

Thanks for establishing something that embraces this.

Re:Facebook PathPicker by stephengillie on Thursday May 07, 2015 @05:32PM (#9508442)
You sound like a Windows admin living in a Linux/BSD world.

I struggle to do everything with Powershell, but almost everything I do has a mouse input. I use a gaming mouse for system administration - a Razer Naga Epic with the 12 thumb buttons.

They're a 3x4 array; I bind them to:

  Row One
  1. F5
  2. Up arrow
  3. F2
  Row Two
  4. Left arrow
  5. Down arrow
  6. Right arrow
  Row Three
  7. Tab
  8. Delete
  9. Backspace
  Row Four
  10. Enter
  11. Spacebar
  12. ESC
I can do the work of 2-3 admins, and I'm faster than poorly-written scripts.
Re:Facebook PathPicker by brazzledazzle on Thursday May 07, 2015 @09:23PM (#9509502)
You should use whatever works for you but this strikes me as very bizarre I have to admit. I started out with a mouse as well and I can see this being something I would have attempted if I hadn't just put my head down and forced myself to get used to keeping my hands on the keyboard.
Re:Facebook PathPicker by stephengillie on Friday May 08, 2015 @09:57AM (#9511729)
As I said, it would be nice to be able to do everything with Powershell (or even Cygwin), but the every module isn't available for every version of Powershell, and the last 2 versions of Powershell don't work with some older (but still supported) versions of Windows.

Want to control you audio from Powershell? There's a cmdlet[1] for that. But it only works on Powershell 4.0 and higher. And PS 4.0 is only available on Win7, (not Win8) Win8.1, and Server 2008-2012.

So on my gaming PC, where I thought putting Win8 Enterprise from my MSDN would be a good idea, I can only change the volume via mouse, or keyboard volume buttons.

[1] https://github.com/cdhunt/WindowsAudioDevice-Powershell-Cmdl...

Re:Facebook PathPicker by pc86 on Friday May 08, 2015 @04:24PM (#9513954)
You're not able to upgrade your gaming PC?
Re:Facebook PathPicker by stephengillie on Friday May 08, 2015 @06:36PM (#9514513)
Because of my infinite foresight in installing the Enterprise version, my upgrade path requires a full reinstall.

Everything works fine so it's not a very high priority - I'd rather be Minecrafting - either playing the game or adding to the server.

Re:Facebook PathPicker by Kiro on Thursday May 07, 2015 @02:58PM (#9507416)
Just want to echo the dead comment:

ossreality 6 minutes ago [dead]

lol, what are you talking about, this isn't mouse-enabled?

Re:Facebook PathPicker by jakejake on Thursday May 07, 2015 @06:32PM (#9508823)
I'm only slightly ashamed to admit I like using a mouse. I get that some people can work faster with all-keyboard controls. I use both. I also like GUIs for certain things. The only thing I don't like GUIs for is when there is some repetitive thing that I have to do 50 times a day and would require 3 or 4 clicks or menu selections - for those I'd always rather have a single command. Sometimes I make those into shell scripts that I can click with my mouse though!
Re:Facebook PathPicker by doorhammer on Thursday May 07, 2015 @09:24PM (#9509504)
Might already be familiar with it, but if you aren't, you should check out sikuli script [1] for when you have a repetitive GUI task you have to perform that can't be directly scripted. I've used it to script some really complex workflows through GUI's

It's also just weird and interesting to program something to move through a GUI as fast as is possible

1: http://www.sikuli.org/

Re:Facebook PathPicker by stinos on Friday May 08, 2015 @03:02AM (#9510349)
Wow. Never heard of it, but this must be the most amazing software idea I've seen in a while. It's gonna be a playful day :P
Re:Facebook PathPicker by doorhammer on Friday May 08, 2015 @09:32AM (#9511589)
Hahah, awesome.

Yeah, getting the scripts to run and be robust is definitely an art sort of thing, but I've used it to create what amounts to a CLI's for legacy apps that you could only interface with through GUI's.

It's also fun to run across stuff like "Oh, the developer of this platform wasn't expecting me to be able to respond to a window within 20ms of it popping up on the screen."

Be interested to see what you think, if you have time to leave a comment

Re:Facebook PathPicker by stinos on Friday May 08, 2015 @02:46PM (#9513440)
Didn't have all the time I wanted today but played with 'hello world' samples and it's a fun new way of scripting for me. I don't have an immediate use for it but next time I feel something needs automation I'm definitely going to give it a go.
Re:Facebook PathPicker by jakejake on Saturday May 09, 2015 @03:40PM (#9517430)
That's great, we have an app that can't be tested with Selenium, Sikuli looks promising.
Re:Facebook PathPicker by Dewie3 on Friday May 08, 2015 @08:10AM (#9511085)
> I'm only slightly ashamed to admit I like using a mouse.

I wish that you weren't even slightly ashamed. Anything can turn into a senseless religion, also supposed productivity.

Re:Facebook PathPicker by gilini on Thursday May 07, 2015 @04:00PM (#9507861)
lol, someone's gonna be disappointed trying fpp for the first time
Re:Facebook PathPicker by staz on Thursday May 07, 2015 @01:38PM (#9506839)
Look pretty nice. Have you considered integrating fuzzy finding in it? Or making it cooperate with fzf?
Re:Facebook PathPicker by GutenYe on Friday May 08, 2015 @05:11AM (#9510656)
How to install it in Linux?
Re:Facebook PathPicker by pliny on Friday May 08, 2015 @05:19AM (#9510685)
Re:Facebook PathPicker by encoderer on Thursday May 07, 2015 @09:28PM (#9509518)
Do you work on developer tools at FB or was this extra-curricular?
Re:Facebook PathPicker by Splendor on Thursday May 07, 2015 @01:25PM (#9506725)
This looks very useful. Thanks for sharing it.
Re:Facebook PathPicker by akshayaurora on Friday May 08, 2015 @02:12AM (#9510216)
Not sure, how much I'm going to use this. But I just hate the name (or command) `fpp`. Why put Facebook in the name?
Re:Facebook PathPicker by itsbits on Thursday May 07, 2015 @01:39PM (#9506841)
do we need to open any specific mode in terminal for FPP?
Re:Facebook PathPicker by xxbondsxx on Thursday May 07, 2015 @01:58PM (#9506973)
Don't think so itsbits -- we strip out color codes and it works just fine inside tmux, but let us know if you have any issues on GitHub!
Re:Facebook PathPicker by itsbits on Thursday May 07, 2015 @02:05PM (#9507028)
sure thanks
Re:Facebook PathPicker by FiloSottile on Thursday May 07, 2015 @02:25PM (#9507162)
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.

(Same works for URLs, with the default browser)

Re:Facebook PathPicker by vcarl on Thursday May 07, 2015 @02:40PM (#9507283)
Holy crap, that's amazing. I had no idea, thanks for spreading the word.
Re:Facebook PathPicker by namuol on Thursday May 07, 2015 @06:37PM (#9508841)
Wow I just posted about this[1] as some hypothetical "dream feature" but it already exists. I don't use iTerm2 (or OS X, for that matter), but I'm wondering now if other terminals support it in some way or another...

[1]: https://news.ycombinator.com/item?id=9508828

Re:Facebook PathPicker by jonalmeida on Thursday May 07, 2015 @11:39PM (#9509846)
This exists in a few linux terminal shells. Notably, gnome-terminal.
Re:Facebook PathPicker by tracker1 on Thursday May 07, 2015 @03:49PM (#9507785)
I wish that I could have iTerm2 for windows (where I use conemu) and Linux (guake has similar features, but an alien ui imho)... I tend to really like tabbed console sessions, and usually have a few local and ssh sessions open at a time while working.
Re:Facebook PathPicker by biftek on Thursday May 07, 2015 @03:12PM (#9507511)
Unfortunately using tmux breaks that behavior.
Re:Facebook PathPicker by evanw on Thursday May 07, 2015 @06:42PM (#9508864)
I believe you can still achieve this with tmux by using Command+Option+Click.
Re:Facebook PathPicker by biftek on Wednesday May 13, 2015 @04:08PM (#9541615)
Really late, but thanks! It works!
Re:Facebook PathPicker by kawsper on Thursday May 07, 2015 @08:08PM (#9509249)
I run tmux and I can CMD+Click hyperlinks and filereferences with linenumbers. I just upgraded to 2.0, maybe you could try that too.
Re:Facebook PathPicker by fmela on Friday May 08, 2015 @02:54AM (#9510333)
Thanks! You made me very glad I came to the comments section.
Re:Facebook PathPicker by ghuntley on Thursday May 07, 2015 @09:46PM (#9509569)
Holy crap
Re:Facebook PathPicker by kashifzaidi1 on Thursday May 07, 2015 @02:53PM (#9507387)
Kudos, never knew that!
Re:Facebook PathPicker by TomNomNom on Thursday May 07, 2015 @04:48PM (#9508190)
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):

  grep -nri searchterm * | vim - 
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.

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:

  :%!grep -v ^test
Re:Facebook PathPicker by jstx on Thursday May 07, 2015 @05:27PM (#9508420)
This is fantastic. Thanks for sharing.
Re:Facebook PathPicker by fiatjaf on Thursday May 07, 2015 @04:30PM (#9508060)
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.
Re:Facebook PathPicker by tsiki on Thursday May 07, 2015 @04:50PM (#9508215)
Same goes for Google, but you could argue that it's for a reason. FB/Google have a reputation to uphold and they strive to make sure their name isn't associated with subpar stuff. Plus, they have a lot of brilliant developers to work on this stuff. In the end of the day, it's largely about knowing which of these cool utilities have a better chance of being usable and well thought-out, as nobody wants to spend time on figuring out a utility which turns out to be unusable.
Re:Facebook PathPicker by stass on Thursday May 07, 2015 @06:29PM (#9508798)
> FB/Google have a reputation to uphold and they strive to make sure their name isn't associated with subpar stuff. Plus, they have a lot of brilliant developers to work on this stuff.

Why do you think so? My experience was quite the opposite... One can argue that large companies don't care about their reputation as much as small companies and individuals do as responsibility gets diluted among the larger number of people. This was certainly the case with most of the tech companies.

Re:Facebook PathPicker by ameen on Friday May 08, 2015 @06:22AM (#9510820)
Not the parent, but it's mostly because open sourced tools from larger companies were usually built internally to solve a pain point. Of course they wouldn't want it to be subpar and affect their efficiency.

> Large companies don't care about their reputation as much as small companies and individuals do as responsibility gets diluted among the larger number of people. This was certainly the case with most of the tech companies.

I think this speaks more about that particular engineer's ownership of the project rather than company itself.

Re:Facebook PathPicker by Dewie3 on Friday May 08, 2015 @08:14AM (#9511110)
> FB/Google have a reputation to uphold and they strive to make sure their name isn't associated with subpar stuff.

Have you seen the "google" group/whatever it's called on Github? A lot of the repos that are posted here have large disclaimers, or here in the comments, that the project is not associated with Google itself but rather by the particular employees that are working on it. So Google doesn't mind letting their employees put up repos of their misc "scratch their itch"/side-project/pet projects, it seems.

> Plus, they have a lot of brilliant developers to work on this stuff.

Someone works at Google/Facebook/... -> commence reflex fawning.

Re:Facebook PathPicker by fiatjaf on Thursday May 07, 2015 @06:14PM (#9508713)
You are right. Thank you.
Re:Facebook PathPicker by fiatjaf on Friday May 08, 2015 @09:27AM (#9511559)
Well, the numbers changed, now you'll not need at least 10 of them, but rather 20 or 30 of them.
Re:Facebook PathPicker by climaxius on Thursday May 07, 2015 @03:05PM (#9507470)
A while back I wrote a similar tool in go to scratch my own itch and use it every day: https://github.com/robbiev/numberwang
Re:Facebook PathPicker by alexsop2 on Thursday May 07, 2015 @03:49PM (#9507786)
πŸŽ‰ That’s numberwang! πŸŽ‰
Re:Facebook PathPicker by feedjoelpie on Thursday May 07, 2015 @04:08PM (#9507905)
Re:Facebook PathPicker by ramses0 on Friday May 08, 2015 @01:36AM (#9510127)
Me, similarly:

https://github.com/ramses0/bash-dialog

...depends on dialog command being installed, or you could use bash's built-in "select" command.

Re:Facebook PathPicker by nathan_f77 on Friday May 08, 2015 @09:55AM (#9511720)
Re:Facebook PathPicker by 616c on Thursday May 07, 2015 @03:28PM (#9507639)
Surprisingly, I rarely see reference to that show the programming/IT world. That made my day, thanks.
Re:Facebook PathPicker by michaelmior on Thursday May 07, 2015 @01:32PM (#9506782)
I use fzf[0] for similar purposes.

[0] https://github.com/junegunn/fzf

Re:Facebook PathPicker by xxbondsxx on Thursday May 07, 2015 @01:38PM (#9506837)
Yeah fzf is great -- there are a few differences since PathPicker can execute any command with the selected file(s) (rather than just write it to stdout) and runs in tmux with no issues, but fzf has great vim integration and I believe actually verifies the file matches.

Glad more people are working in the productivity space though!

Re:Facebook PathPicker by michaelmior on Thursday May 07, 2015 @01:50PM (#9506909)
I haven't really had issues with fzf in tmux. Personally I just write a couple of my own aliases on top of fzf and it works great. I have ^T bound to open fzf and then edit the file I pick in vim. For me I find that editing files and selecting files to add to my VCS are my two uses cases. The latter I solve with scm_breeze[0].

[0] https://github.com/ndbroadbent/scm_breeze

Re:Facebook PathPicker by qiemem on Thursday May 07, 2015 @04:14PM (#9507942)
The fact that it just outputs to stdout means you can run any command with output from fzf as well. Just

anycommand $(fzf)

Re:Facebook PathPicker by guac on Thursday May 07, 2015 @05:02PM (#9508277)
or `xargs` / gnu parallel
Re:Facebook PathPicker by thameera on Thursday May 07, 2015 @10:04PM (#9509633)
Except for commands like git add.
Re:Facebook PathPicker by iopuy on Thursday May 07, 2015 @03:55PM (#9507826)
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:

junk/foo/bar.txt

instead of just

./junk/foo/bar.txt

?

Re:Facebook PathPicker by xxbondsxx on Thursday May 07, 2015 @07:07PM (#9509008)
Hey @iopuy can you file an issue on github? For paths that are not absolute or relative (and thus ambiguous), we:

-- Try to detect the top-level version control directory -- Use that if one is found

But we could possibly pipe the current working directory into the python context from bash and go from there

Re:Facebook PathPicker by iopuy on Friday May 08, 2015 @02:42PM (#9513422)
Re:Facebook PathPicker by slajax on Thursday May 07, 2015 @04:15PM (#9507950)
Please, this!
Re:Facebook PathPicker by stass on Thursday May 07, 2015 @06:26PM (#9508778)
This is a great tool.

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.

"PathPicker should work with most Bash environments" -- what does that even mean?

Re:Facebook PathPicker by hodgesmr on Thursday May 07, 2015 @03:12PM (#9507514)
I see a lot of alternatives to this in the comments. Allow me to offer another: https://github.com/garybernhardt/selecta
Re:Facebook PathPicker by philsnow on Thursday May 07, 2015 @03:26PM (#9507623)
Re:Facebook PathPicker by skeoh on Thursday May 07, 2015 @07:55PM (#9509199)
Oh wow, peco is really impressive. Thanks for the link!
Re:Facebook PathPicker by sargegood on Thursday May 07, 2015 @07:48PM (#9509170)
Love this one.
Re:Facebook PathPicker by staunch on Thursday May 07, 2015 @02:29PM (#9507186)
Some people, when confronted with a command line problem, think "I know, I'll use my mouse." Now they have two problems.

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.

Re:Facebook PathPicker by asmosoinio on Thursday May 07, 2015 @03:36PM (#9507696)
And with this tool you do exactly that? Instead of selecting the filenames with your mouse, you keep hands on keyboard and select with arrow keys.
Re:Facebook PathPicker by xxbondsxx on Thursday May 07, 2015 @03:22PM (#9507595)
Couldn't agree more staunch! I silently weep every time I have to use the mouse during development
Re:Facebook PathPicker by Retra on Thursday May 07, 2015 @04:51PM (#9508219)
Just turn that frown upside down. Use your mouse for all input and get rid of that pesky keyboard.
Re:Facebook PathPicker by serve_yay on Thursday May 07, 2015 @04:05PM (#9507888)
You're silly.
Re:Facebook PathPicker by jlongster on Thursday May 07, 2015 @02:58PM (#9507420)
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.

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.

Re:Facebook PathPicker by reedlaw on Thursday May 07, 2015 @09:21PM (#9509498)
Yes, when I saw the git example I immediately thought of magit for Emacs which can also jump around files and commits from within git results.
Re:Facebook PathPicker by Cacti on Thursday May 07, 2015 @11:11PM (#9509791)
First thing this reminded me of was Helm in Emacs.
Re:Facebook PathPicker by labianchin on Thursday May 07, 2015 @05:49PM (#9508557)
That is great!

But when using the command, it does not work with defined bash/zsh aliases. Anyone has any idea how to do that?

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

Re:Facebook PathPicker by kentor on Thursday May 07, 2015 @07:21PM (#9509071)
same problem here. need to make it aware of my aliases :\
Re:Facebook PathPicker by ComputerGuru on Thursday May 07, 2015 @03:39PM (#9507711)
Is there a way of using this with instructions that take only one parameter, akin to xargs or parallel?

i.e. Instead of calling `command file1 file2 file3 ...` it would call `command file1; command file2; command file3; ...`?

Re:Facebook PathPicker by jbnicolai on Friday May 08, 2015 @04:38AM (#9510564)
I wrote a small snippet to integrate this with tmux. Simply press <Leader-i> for the current buffer to be run through fpp.

See a small example here: http://recordit.co/U2TYvbPC9p

And here's the corresponding code: https://github.com/jbnicolai/tmux/blob/master/.tmux.conf#L12...

Re:Facebook PathPicker by sheldonk on Thursday May 07, 2015 @01:30PM (#9506762)
Re:Facebook PathPicker by xxbondsxx on Thursday May 07, 2015 @01:41PM (#9506849)
Percol was actually a source of inspiration as well, but I got tired of typing things like:

git checkout $(git branch | percol)

Since I had to almost compose my command beforehand rather than decide once I saw the output. So we take the opposite approach. Great UI though!

Re:Facebook PathPicker by pimlottc on Thursday May 07, 2015 @04:35PM (#9508106)
Does fpp support history for its command prompt? With the percol approach, you can easily re-run the same command with a different selection.
Re:Facebook PathPicker by muaddirac on Thursday May 07, 2015 @06:29PM (#9508804)
Some of this is reminiscent of xiki: http://xiki.org/
Re:Facebook PathPicker by pierrec on Thursday May 07, 2015 @03:52PM (#9507802)
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.

Although I kind of enjoy the process of going though each one and studying how the features fit my own workflow.

Re:Facebook PathPicker by aerique on Tuesday May 19, 2015 @05:34AM (#9568862)
Like /u/Sbn, I'd like to hear about the experiences you've gathered with these tools so far. I'm in the process of choosing one of these tools and I cannot find a good overview of all their features, pros and cons.
Re:Facebook PathPicker by Sbn on Thursday May 07, 2015 @11:50PM (#9509871)
Well if you've gone through each then you're the best person to write a review! :-)
Re:Facebook PathPicker by renata on Thursday May 07, 2015 @06:48PM (#9508904)
If you're only using this with git, I use git-number[1] for this purpose.

[1] https://github.com/holygeek/git-number

Re:Facebook PathPicker by daliwali on Friday May 08, 2015 @01:51AM (#9510176)
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).

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.

Re:Facebook PathPicker by AdamTReineke on Friday May 08, 2015 @02:13AM (#9510219)
They probably wrote it at work or on a company machine or discussed it on company time, all of which can make it company property. (Read up on moonlighting.)
Re:Facebook PathPicker by encoderer on Friday May 08, 2015 @01:37PM (#9513034)
In the time it took you to write all that, you could've answered this question for yourself. He wrote it at work, as part of his job, at Facebook. And if he's not "troubled" by it, why are you?
Re:Facebook PathPicker by 0x0 on Thursday May 07, 2015 @01:54PM (#9506940)
Looks nice. Is it better than the built-in "arrow-keys-browseable" menu completion of zsh? (Random "screenshot" available at http://www.masterzen.fr/2009/04/19/in-love-with-zsh-part-one... under "Menu selection")

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.

Re:Facebook PathPicker by namuol on Thursday May 07, 2015 @06:33PM (#9508828)
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 http:// links, but not fs links.

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.

Re:Facebook PathPicker by hellbanner on Thursday May 07, 2015 @02:05PM (#9507030)
Props for giving back.
Re:Facebook PathPicker by barun on Saturday May 09, 2015 @12:10AM (#9515461)
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

Also, it is failing to select the entire file if there are spaces in it

Re:Facebook PathPicker by thinkingfish on Friday May 08, 2015 @01:28AM (#9510107)
Would be nice to allow filters- for example, leave out any results that match patterns in .gitignore.
Re:Facebook PathPicker by serve_yay on Thursday May 07, 2015 @04:03PM (#9507880)
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)
Re:Facebook PathPicker by scott_karana on Thursday May 07, 2015 @04:04PM (#9507885)
And in case anyone didn't know about something that does the same for URLs on-screen: here's urlview.

http://linuxcommand.org/man_pages/urlview1.html

:-)

Re:Facebook PathPicker by jiuren on Friday May 08, 2015 @09:10AM (#9511435)
Impressive. I was very happy with percol. Now I see other possibility. I really like the "select first, then comes the command" approach.

I hope you can add support of selecting directories, and fuzzily filtering results(like what percol does).

Re:Facebook PathPicker by hammerha on Saturday May 09, 2015 @01:18PM (#9516960)
There's a nice command line interface git client called `tig`. https://github.com/jonas/tig
Re:Facebook PathPicker by ptman on Friday May 08, 2015 @03:09AM (#9510363)
I like using vipe from moreutils ( https://joeyh.name/code/moreutils/ )

find . |vipe | xargs ...

Re:Facebook PathPicker by milin on Friday May 08, 2015 @03:28PM (#9513656)
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.
Re:Facebook PathPicker by trumbitta2 on Friday May 08, 2015 @05:19AM (#9510688)
Thanks for giving back!

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.

Re:Facebook PathPicker by blago on Friday May 08, 2015 @02:17AM (#9510232)
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.
Re:Facebook PathPicker by ww520 on Thursday May 07, 2015 @06:07PM (#9508673)
This looks awesome and very useful.

As an alternative, I usually just run ag to search files inside Emacs, and use Emacs to navigate the results.

Re:Facebook PathPicker by liquidise on Thursday May 07, 2015 @04:49PM (#9508209)
iTerm2 has historic completion if you hit CMD + ; after typing a couple of characters. works wonders for path retrieval.
Re:Facebook PathPicker by Sbn on Thursday May 07, 2015 @11:45PM (#9509856)
Tangential question- how does one manage these utils on multiple machines? I use dotfiles for regular dot files.
Re:Facebook PathPicker by frou_dh on Thursday May 07, 2015 @03:32PM (#9507658)
Seems to trip up as soon as paths have spaces in them.

Nice concept though, makes a good companion for "mdfind" on OS X.

Re:Facebook PathPicker by amelius on Thursday May 07, 2015 @04:29PM (#9508057)
This reminds me of Norton Commander :)
Re:Facebook PathPicker by mortdeus on Thursday May 07, 2015 @07:14PM (#9509042)
The point of piping is that output shouldn't ever be as complicated as this...
Re:Facebook PathPicker by raman325 on Thursday May 07, 2015 @03:45PM (#9507749)
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?

EDIT: should note i am using iTerm on a Mac

Re:Facebook PathPicker by vikiomega9 on Thursday May 07, 2015 @02:54PM (#9507393)
The brew install seems broken?
Re:Facebook PathPicker by vecinu on Thursday May 07, 2015 @03:09PM (#9507500)
Make sure you run a 'brew update' prior to 'brew install fpp'.

If that is not your issue then yes, I can't seem to symlink fpp properly in /bin either.

Re:Facebook PathPicker by xxbondsxx on Thursday May 07, 2015 @03:25PM (#9507613)
Yeah brew will need to be updated to pull down the latest recipes. I'll add this to our launch page
Re:Facebook PathPicker by Cacti on Thursday May 07, 2015 @11:09PM (#9509787)
Reminds me of Helm in Emacs.
Re:Facebook PathPicker by MetaMonk on Thursday May 07, 2015 @05:20PM (#9508382)
This is awesome! Thanks!
Re:Facebook PathPicker by mscrivo on Thursday May 07, 2015 @03:13PM (#9507523)
very nice! Anyone get this working in an msysgit bash shell?
Re:Facebook PathPicker by govilk on Friday May 08, 2015 @08:35AM (#9511211)
Very useful. Thanks
Re:Facebook PathPicker by manan19 on Thursday May 07, 2015 @08:32PM (#9509349)
Why is this at the top of HN? :/
Re:Facebook PathPicker by andyl on Thursday May 07, 2015 @02:04PM (#9507023)
This looks great. Is there a streamlined install for Ubuntu?
Re:Facebook PathPicker by xxbondsxx on Thursday May 07, 2015 @02:08PM (#9507059)
@andyl We are working on getting a linuxbrew recipe working. There's shouldn't be anything blocking this from working on linux systems (assuming Python 2.7 is installed).

In the meantime you can try the manual installation method listed in the README: https://github.com/facebook/pathpicker/

@itsbits Why do you say that? curious if you found anything

Re:Facebook PathPicker by function_seven on Thursday May 07, 2015 @02:22PM (#9507147)
I just tried to git clone it with

    $ sudo git clone [email protected]:facebook/PathPicker.git
    Cloning into 'PathPicker'...
    Permission denied (publickey).
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
Any ideas? Thanks.

EDIT: Nevermind. It's an issue with using sudo to git. I can use my own account, but I can't do it in /usr/local.

Re:Facebook PathPicker by motoboi on Thursday May 07, 2015 @03:38PM (#9507709)
Just try using git over https. You probably have your own key to github.com and the server will access deny it when accessing someone else's repo.
Re:Facebook PathPicker by rmc on Thursday May 07, 2015 @03:07PM (#9507482)
If it's pure python why not use pip?
Re:Facebook PathPicker by xxbondsxx on Thursday May 07, 2015 @03:24PM (#9507608)
@rmc we have a dependency on a bash script as well, since we need to redirect stdin to tty input and such. So getting the bash file to distribute with PIP and symlink as well was slightly complicated.

I only recently realized that the entire program could be ported over to python (the stdin redirection is supported in python as well) but I still think homebrew is slightly more popular than having pip installed, especially with all the JS development going on today

Re:Facebook PathPicker by nightpool on Thursday May 07, 2015 @04:37PM (#9508115)
pip would probably be a lot better from a cross-platform perspective then something really obscure like linuxbrew.
Re:Facebook PathPicker by andyl on Thursday May 07, 2015 @06:01PM (#9508630)
+1 for pip over linuxbrew
Re:Facebook PathPicker by rmc on Friday May 08, 2015 @03:56AM (#9510467)
> I still think homebrew is slightly more popular than having pip installed

I disagree. On Linux, we have operating system package managers. pip is popular among python programmers, for python packages. Asking to install another random package manager is unlikely to be popular.

Re:Facebook PathPicker by ChristianBundy on Thursday May 07, 2015 @04:55PM (#9508248)
If it works on Linux, why not use linuxbrew?
Re:Facebook PathPicker by rmc on Friday May 08, 2015 @03:57AM (#9510469)
Because I have no idea what that is? Using what seems like a ported OSX semi-package manager on ubuntu seems strange.
Re:Facebook PathPicker by dan15 on Friday May 08, 2015 @12:03AM (#9509902)
Why not actual Linux packages (DEB and RPM)?
Re:Facebook PathPicker by itsbits on Thursday May 07, 2015 @02:06PM (#9507034)
just went through their code. Currently not possible
Re:Facebook PathPicker by numair on Thursday May 07, 2015 @04:35PM (#9508103)
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.

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...

If you're a passionate engineer at Facebook working on an open source project, please go work on it somewhere else!

Re:Facebook PathPicker by superuser2 on Thursday May 07, 2015 @04:42PM (#9508146)
False. They fixed it about a month ago.

>Notwithstanding the foregoing, if Facebook or any of its subsidiaries or corporate affiliates files a lawsuit alleging patent infringement against you in the first instance, and you respond by filing a patent infringement counterclaim in that lawsuit against that party that is unrelated to the Software, the license granted hereunder will not terminate under section (i) of this paragraph due to such counterclaim.

Source: https://github.com/facebook/PathPicker/blob/master/PATENTS

See also the announcement of the change: https://news.ycombinator.com/item?id=9356508

Re:Facebook PathPicker by lstyls on Thursday May 07, 2015 @07:47PM (#9509163)
Even if this was the case (this was poor wording in the original PATENTS which has since been fixed) you are only subject to these constraints in any code you provide that includes the source code. Since this is a shell tool, that is largely irrelevant. For the same reason, you can compile and release binaries from closed source binaries using gcc even though it is licensed under GPL.
Re:Facebook PathPicker by Eduard on Thursday May 07, 2015 @04:45PM (#9508168)
What is a patent Trojan horse? I just read the PATENTS file, but cannot think of a scenario that could affect me negatively. Can you give one?
Re:Facebook PathPicker by mcintyre1994 on Thursday May 07, 2015 @04:56PM (#9508256)
(IANAL, I did complain here about the old patents file)

An older version of their patents file used language that suggested to some that the license would be void if you attempted to defend against a patent suit from Facebook and it could therefore be dangerous to use.

They recently updated the file to clarify some terms, particularly the one the parent is complaining about, and I haven't heard anybody complaining about the new language.

Re:Facebook PathPicker by xxbondsxx on Thursday May 07, 2015 @07:10PM (#9509020)
Yep, we had a bit of a brouhaha over the original update to our patents file and clarified the language afterwards, I think it's a bit more straightforward now!