Coder Social home page Coder Social logo
PathPicker

facebook / PathPicker Goto Github PK

View Code? Open in Web Editor NEW
4.8K 128.0 273.0 1.4 MB

PathPicker accepts a wide range of input -- output from git commands, grep results, searches -- pretty much anything. After parsing the input, PathPicker presents you with a nice UI to select which files you're interested in. After that you can open them in your favorite editor or execute arbitrary commands.

Home Page: https://facebook.github.io/PathPicker/

License: MIT License

CSS 3.66% HTML 6.05% Python 86.23% Shell 3.49% Ruby 0.56%

PathPicker's Introduction

PathPicker

tests License: MIT

Facebook PathPicker is a simple command line tool that solves the perpetual problem of selecting files out of bash output. PathPicker will:

  • Parse all incoming lines for entries that look like files
  • Present the piped input in a convenient selector UI
  • Allow you to either:
    • Edit the selected files in your favorite $EDITOR
    • Execute an arbitrary command with them

It is easiest to understand by watching a simple demo:

Examples

After installing PathPicker, using it is as easy as piping into fpp. It takes a wide variety of input -- try it with all the options below:

  • git status | fpp
  • hg status | fpp
  • git grep "FooBar" | fpp
  • grep -r "FooBar" . | fpp
  • git diff HEAD~1 --stat | fpp
  • find . -iname "*.js" | fpp
  • arc inlines | fpp

and anything else you can dream up!

Requirements

PathPicker requires Python 3.

Supported Shells

  • Bash is fully supported and works the best.
  • ZSH is supported as well, but won't have a few features like alias expansion in command line mode.
  • csh/fish/rc are supported in the latest version, but might have quirks or issues in older versions of PathPicker. Note: if your default shell and current shell is not in the same family (bash/zsh... v.s. fish/rc), you need to manually export environment variable $SHELL to your current shell.

Installing PathPicker

Homebrew

Installing PathPicker is easiest with Homebrew for mac:

  • brew update (to pull down the recipe since it is new)
  • brew install fpp

Linux

On Debian-based systems, run these steps: fakeroot:

$ git clone https://github.com/facebook/PathPicker.git
$ cd PathPicker/debian
$ ./package.sh
$ ls ../pathpicker_*_all.deb

On Arch Linux, PathPicker can be installed from Arch User Repository (AUR). (The AUR fpp-git package.)

If you are on another system, or prefer manual installation, please follow the instructions given below.

Manual Installation

If you are on a system without Homebrew, it's still quite easy to install PathPicker, since it's essentially just a bash script that calls some Python. These steps more-or-less outline the process:

  • cd /usr/local/ # or wherever you install apps
  • git clone https://github.com/facebook/PathPicker.git
  • cd PathPicker/

Here we create a symbolic link from the bash script in the repo to /usr/local/bin/ which is assumed to be in the current $PATH:

  • ln -s "$(pwd)/fpp" /usr/local/bin/fpp
  • fpp --help # should work!

Add-ons

For tmux users, you can additionally install tmux-fpp which adds a key combination to run PathPicker on the last received stdout. This makes jumping into file selection mode even easier. (Check it out here!)

Advanced Functionality

As mentioned above, PathPicker allows you to also execute arbitrary commands using the specified files. Here is an example showing a git checkout command executed against the selected files:

The selected files are appended to the command prefix to form the final command. If you need the files in the middle of your command, you can use the $F token instead, like:

cat $F | wc -l

Another important note is that PathPicker, by default, only selects files that exist on the filesystem. If you want to skip this (perhaps to selected deleted files in git status), just run PathPicker with the --no-file-checks (or -nfc, for short) flag.

How PathPicker works

PathPicker is a combination of a bash script and some small Python modules. It essentially has three steps:

  • Firstly, the bash script redirects all standards out into a python module that parses and extracts out filename candidates. These candidates are extracted with a series of regular expressions, since the input to PathPicker can be any stdout from another program. Rather than make specialized parsers for each program, we treat everything as noisy input, and select candidates via regexes. To limit the number of calls to the filesystem (to check existence), we are fairly restrictive on the candidates we extract.

The downside to this is that files that are single words, with no extension (like test), that are not prepended by a directory will fail to match. This is a known limitation to PathPicker, and means that it will sometimes fail to find valid files in the input.

  • Next, a selector UI built with curses is presented to the user. At this point you can select a few files to edit, or input a command to execute.

  • Lastly, the python script outputs a command to a bash file that is later executed by the original bash script.

It's not the most elegant architecture in the world but, in our opinion, it provides a lot of utility.

Documentation & Configuration

For all documentation and configuration options, see the output of fpp --help.

Join the PathPicker community

See the CONTRIBUTING.md file for how to help out.

License

PathPicker is MIT licensed.

PathPicker's People

Contributors

pcottle avatar KapJI avatar lastquestion avatar pallavagarwal07 avatar code-reaper08 avatar frantic avatar metavida avatar rjdean123 avatar 64kramsystem avatar sethwoodworth avatar dduong42 avatar wasade avatar prubel avatar ssgelm avatar dmitryvinn avatar weakish avatar david-caro avatar engz avatar gsheld avatar hlian avatar ismith avatar JonathanAquino avatar ngavalas avatar robertbachmann avatar thiagowfx avatar timgates42 avatar TimSpence avatar groomsy avatar deelam avatar dragonxlwang avatar

Stargazers

Michael Vu avatar  avatar Tiémé Togola avatar JohnTitor avatar  avatar kpakda avatar  avatar  avatar  avatar  avatar lee avatar Eren Birk avatar  avatar Chaz avatar JamOS avatar  avatar Tan Le avatar GuangGuang avatar Andrew avatar  avatar  avatar Rayat Rahman avatar Kirishima avatar Josh Peters avatar Mike Oertli avatar Anton Pretorius avatar  avatar Byron Hambly avatar  avatar Sergey Ogryzkov avatar Timothée Ravier avatar Jeff Cox avatar Anna Allen avatar Tom Bamford avatar Burak Ercan avatar Frank Perrakis avatar  avatar Hadrien avatar Alex avatar sun xin avatar Victor avatar AlpineYahoo avatar  avatar JN avatar Johnson ZHUANG avatar fonieX avatar Konstantin L avatar Ilya Kashnitskiy avatar Jai A P avatar  avatar  avatar  avatar  avatar Adam Schoenfeld avatar  avatar Tobias Cudnik avatar  avatar Rostom Zouaghi avatar Christoph Lindstädt avatar  avatar neelabalan avatar  avatar Codey Oxley avatar William Randall avatar R M avatar Pedro Batista avatar Khaled Hassan avatar  avatar Arthur Melo avatar Sanaf avatar George Marecheau avatar Alexander Dahl avatar  avatar Kai Ehrhardt avatar Matheus Marabesi avatar  avatar Patrik Ragnarsson avatar Vishesh avatar yzzyx avatar Nate Crisler avatar otfsenter avatar algers avatar Tejas Nikhar avatar Tobias Alrøe avatar  avatar Chan Simpson avatar frankfanslc avatar Dolev Hadar avatar  avatar David T. Crosby avatar Derhnyel avatar nopeno avatar Vishwa.R avatar Eli Johnson avatar  avatar bytewalker avatar  avatar N Jannasch avatar Programmer PEPE avatar yyancy avatar

Watchers

Kozo Nishida avatar Stig Kleppe-Jørgensen avatar Noam  Vergain avatar Imran Ansari avatar Henry Huang avatar evandrix avatar Rakhmad Azhari avatar JN avatar Scott Bulua avatar Jason Paul Cole avatar Michalis™ avatar netrix avatar mingfeng.zhang avatar McNichol Design avatar Temesghen Kahsai avatar HoNooD avatar Hui Peng avatar timelyportfolio avatar James Cloos avatar poldyaev avatar Nick Bien avatar John Ruffer avatar  avatar Aaron Kushner avatar Lin Xu avatar Peter Cottle avatar Ismail K avatar M. Tong avatar J C Lawrence avatar Christian QH ✔  avatar Raphael Giovanini avatar yager avatar Umer Sami avatar Juri avatar Michael Anthony avatar 保卫战 avatar Java_Python_Go avatar Neo0815 avatar Tolkien avatar  avatar Mustapha Ben Daoud Barki avatar C++1y avatar  avatar  avatar Shokax avatar aditya avatar Rubio avatar tanzhiqiang avatar Ruslan Sayfutdinov avatar  avatar Qiushi Mou avatar Chihang Wang avatar  avatar Duc avatar  avatar Konstantin avatar Tsung-hsien Chen avatar 陈云云 avatar Luís da Costa Almeida avatar Paul S. Mash avatar  avatar yongnianliu avatar rachmat hidayat avatar  avatar Eric Smith avatar Armond St.Juste avatar Brian J King avatar  avatar Mateusz Piórko avatar Sid Rajaram avatar Kinshu.eth avatar danzamerlot avatar Hrishi avatar misspluff avatar  avatar  avatar  avatar Pankaj Kumar avatar Carlos Damian Arroyo Flores avatar Jonathan & Freda Harvey avatar  avatar Facebook Whois Bot avatar  avatar  avatar  avatar Shashank Rajput avatar  avatar David avatar  avatar  avatar  avatar  avatar  avatar bubble_wp avatar  avatar  avatar  avatar  avatar  avatar  avatar

PathPicker's Issues

line selection mode

Detecting paths is cool and everything, but I think it would be even more useful if there was a mode that treats every full input line as a "filename" (or other single parameter) and passes all selected lines to the output command, either one-by-one, or space-separated on the command line.

If this sounds useful to anyone else, I'll try to implement it and submit a pull request. It definitely seems to me like an entirely useful mode of operation.

By the way, thanks for fpp, it's a really awesome tool.

Arbitrary command mode doesn't have aliases or shell functions

When executing a command in arbitrary command mode, fpp is unaware of any aliases or shell functions I may have defined in my .zshrc (I'm using zsh but I've tested this in bash as well).

For example I have an alias gco="git checkout"and running gco in the arbitrary command mode gives:

.fbPager.sh: line 4: gco: command not found

Curses error

https://www.technovelty.org/linux/a-short-tour-of-term.html
My terminal is set to xterm-color and I am getting following error

Traceback (most recent call last):
File "/usr/local/Cellar/fpp/0.5.5/libexec/src/choose.py", line 56, in
curses.wrapper(doProgram)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/curses/wrapper.py", line 43, in wrapper
return func(stdscr, _args, *_kwds)
File "/usr/local/Cellar/fpp/0.5.5/libexec/src/choose.py", line 27, in doProgram
screen.control()
File "/usr/local/Cellar/fpp/0.5.5/libexec/src/screenControl.py", line 275, in control
self.printAll()
File "/usr/local/Cellar/fpp/0.5.5/libexec/src/screenControl.py", line 493, in printAll
self.printChrome()
File "/usr/local/Cellar/fpp/0.5.5/libexec/src/screenControl.py", line 503, in printChrome
self.helperChrome.output(self.mode)
File "/usr/local/Cellar/fpp/0.5.5/libexec/src/screenControl.py", line 63, in output
curses.curs_set(INVISIBLE_CURSOR)
_curses.error: curs_set() returned ERR

Fails when relative path is not prepended with "./"

Doesn't play well with ack (or any other tool with similar output) because ack does not prepend a "./" to the file list returned from . E.g.

ack -l 'foo'
junk/foo/bar.txt

ack -l 'foo' | fpp <------- Does not work needs ./junk/foo/bar.txt instead.

Allow specifying command as an argument to fpp

Would this be possible? Something like:

git status | fpp -c 'git add'

So that the default action is overridden and I can just hit 'enter' after selecting files to run git add on them.

dotfiles are ignored

for instance if I have
.gitignore
in my git status output. it can't be selected using PathPicker.

PathPicker could be pure Python (no bash script)

@zmwangx posted an example script of this:

https://gist.github.com/zmwangx/23806da530a39bb1c0cf

Rather than use bash to redirect stdin and connect to tty, we could do it all in pure python. Not sure what the big benefits would be here besides not having to mix languages and all of that (and easier option handling).

It was pure python we could distribute via pip which means easy installation for linux users, but then we would have duplication between homebrew and pip which is discouraged. should file to historical reasons though

_curses.error: curs_set() returned ERR

In rxvt-unicode, I hit this every time I try switching to command mode:

Traceback (most recent call last):
  File "PathPicker/src/choose.py", line 58, in <module>
    curses.wrapper(doProgram)
  File "7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "PathPicker/src/choose.py", line 30, in doProgram
    screen.control()
  File "PathPicker/src/screenControl.py", line 271, in control
    self.processInput(inKey)
  File "PathPicker/src/screenControl.py", line 344, in processInput
    self.beginEnterCommand()
  File "PathPicker/src/screenControl.py", line 434, in beginEnterCommand
    self.helperChrome.output(self.mode)
  File "PathPicker/src/screenControl.py", line 62, in output
    curses.curs_set(BLOCK_CURSOR)
_curses.error: curs_set() returned ERR

The man page seems to indicate that the terminal doesn't support that setting, and it does work fine in xterm.

Bad brew instructions

This:

brew upgrade; brew install fpp; fpp

Should probably be this:

brew update; brew install fpp; fpp

Python 3.0 compatibility

I'm on 10.10.3. Ran brew install fpp and then fpp, and got this:

File "/usr/local/Cellar/fpp/0.5.3/libexec/src/processInput.py", line 126
    print USAGE_STR
                  ^
SyntaxError: Missing parentheses in call to 'print'
  File "/usr/local/Cellar/fpp/0.5.3/libexec/src/choose.py", line 54
    print 'Nothing to do!'
                         ^
SyntaxError: Missing parentheses in call to 'print'
sh: /Users/dan/.fbPager.sh: No such file or directory

fpp doesn't pass path to command properly for paths in the top dir w/out ./ prefix

The output of ack -l or grep -l that lists as demonstrated below is parsed properly by fpp (the interactive selection works), but when you execute a command on it (for example open the editor) it doesn't pass the proper path.

In the case of the first file listed below, fpp passes the following to vim:

/home/user/www/system-images/android-22/default/x86_64

when the proper path is:

/home/user/**vendor/android/sdk/**system-images/android-22/default/x86_64/source.properties

  1. The CWD is /home/user/vendor/android/sdk/
  2. I have no idea where the www/ is coming from
ack xml -l | head                                                                                                                                                                    130 ↵
system-images/android-22/default/x86_64/source.properties
system-images/android-22/default/x86_64/NOTICE.txt
system-images/android-22/google_apis/x86_64/source.properties
system-images/android-22/google_apis/x86_64/NOTICE.txt
system-images/android-21/default/x86_64/source.properties
system-images/android-21/default/x86_64/NOTICE.txt
system-images/android-21/google_apis/x86/source.properties
system-images/android-21/google_apis/x86/NOTICE.txt
system-images/android-21/google_apis/x86_64/source.properties
system-images/android-21/google_apis/x86_64/NOTICE.txt

Having problem running on Linux (Ubuntu 12.04 Precise)

I checked out the repo to: /usr/local/src/PathPicker and created the symlink like this:
[email protected]:/usr/local/bin# ln -s /usr/local/src/PathPicker/fpp fpp

then when i try running fpp, i see this message:

[email protected]:~$ which fpp
/usr/local/bin/fpp
[email protected]:~$ fpp --help
/usr/local/bin/fpp: line 18: cd: /usr/local/bin//usr/local/src/PathPicker: No such file or directory
python2: can't open file '/src/printHelp.py': [Errno 2] No such file or directory

more info:

[email protected]:~$ readlink /usr/local/bin/fpp
/usr/local/src/PathPicker/fpp
[email protected]:~$ ls -al /usr/local/bin/fpp
lrwxrwxrwx 1 root root 29 May  7 16:45 /usr/local/bin/fpp -> /usr/local/src/PathPicker/fpp
[email protected]:~$ ls -al /usr/local/src/PathPicker/
total 60
drwxrwxr-x 5 hmuser hmuser 4096 May  7 16:37 .
drwxr-xr-x 3 root   root   4096 May  7 16:25 ..
drwxrwxr-x 2 hmuser hmuser 4096 May  7 16:24 assets
-rw-rw-r-- 1 hmuser hmuser 1918 May  7 16:24 CONTRIBUTING.md
-rwxrwxr-x 1 hmuser hmuser 1454 May  7 16:24 fpp
-rw-rw-r-- 1 hmuser hmuser  561 May  7 16:24 fpp.rb
drwxrwxr-x 8 hmuser hmuser 4096 May  7 16:24 .git
-rw-rw-r-- 1 hmuser hmuser   89 May  7 16:24 .gitignore
-rw-rw-r-- 1 hmuser hmuser 4502 May  7 16:24 index.html
-rw-rw-r-- 1 hmuser hmuser 1531 May  7 16:24 LICENSE
-rwxrwxr-x 1 hmuser hmuser  347 May  7 16:24 makeDist.sh
-rw-rw-r-- 1 hmuser hmuser 1981 May  7 16:24 PATENTS
-rw-rw-r-- 1 hmuser hmuser 3332 May  7 16:24 README.md
drwxrwxr-x 2 hmuser hmuser 4096 May  7 16:42 src

good thing is, the issue is fixed by changing the commented out line to the line after:

while [ -h "$WHEREAMI" ]; do
  # WHEREAMI=$(dirname "$WHEREAMI")"/"$(readlink "$WHEREAMI")
  WHEREAMI=$(readlink "$WHEREAMI")
done

hopefully this helps.

Doesn't handle paths with spaces in them

Both the highlighting and file-opening are tripped up by paths with spaces in them.

I tested with the output of OS X's mdfind -name foo (one path per line) piped into fpp.

Canceling (Control-c) a command produces noisy output

If I'm not mistaken, canceling CTRL+c should produce no output like most/all other commands.

Currently, this is what happens (on Ubuntu bash 4.2 at least, untested elsewhere) :

$ grep -ir 'foo' . | fpp
^CTraceback (most recent call last):
  File "/usr/local/PathPicker/src/processInput.py", line 144, in <module>
    doProgram()
  File "/usr/local/PathPicker/src/processInput.py", line 120, in doProgram
    lineObjs = getLineObjs()
  File "/usr/local/PathPicker/src/processInput.py", line 102, in getLineObjs
    inputLines = sys.stdin.readlines()
KeyboardInterrupt
Nothing to do!
:D

Testing multiple version of python.

There's an excellent tox package that can test multiple version of python in one command.
The only requirement is for the user to have the version installed.

Say you have all of this:

python26 -V
python27 -V
python33 -V
python34 -V

You can run one command to automatically test all of it:

tox

I already have it running in my local branch, let me know if you think this is good and I'll create a PR.

breaks when the file path contains duplicate dir names

git diff --stat
tweets/server/src/main/scala/com/twitter/tweets/Tweets.scala | 17 +++++++++++++---

git diff --stat | fpp
.../tweets/Tweets.scala | 17 ++++-

when you navigate to the item in fpp it attempts to open .../tweets/Tweets.scala which doesn't exist. The full path that's printed out when not using fpp is the correct path.

navigate by text line, not matched line

I'd like to be able to navigate up and down by line, and not automatically jump to the next line match. I'd imagine we could add a mode to flip the navigation keys into, or maybe alternately add new keys.

I'd prefer the former. I'd also like it to be a --command-line-switch so it can be passed in all the time.

I'll submit a PR for this sometime soon, as it would make path picker easier to use for me. Unless someone objects strongly, I'll implement a text-mode versus a match-mode, and have a key to flip between the two, and a command line option. And update the docs. and add it to the menu. Whew.

I have a directory that breaks fpp

$ ls Music|fpp
Traceback (most recent call last):
File "/home/jackson/src/PathPicker/src/choose.py", line 55, in <module>
curses.wrapper(doProgram)
File "/usr/local/lib/python2.7/curses/wrapper.py", line 43, in wrapper
return func(stdscr, *args, **kwds)
File "/home/jackson/src/PathPicker/src/choose.py", line 26, in doProgram
screen.control()
File "/home/jackson/src/PathPicker/src/screenControl.py", line 266, in control
self.moveCursor()
File "/home/jackson/src/PathPicker/src/screenControl.py", line 498, in moveCursor
self.stdscr.move(y, x)
_curses.error: wmove() returned ERR

I put a pastebin of 'ls Music' here:
http://pastebin.ca/raw/2999325

I can't figure out what it's puking on though, I made another directory with some of the odd characters used and fpp handles that one fine...

Doesn't detect files without extensions

You can reproduce this issue by putting a Makefile or Dockerfile in a directory and ls | fpp. It will work with other files in the directory that have an extension.

Ctrl + C quits with exception

Traceback (most recent call last):
  File "/usr/local/Cellar/fpp/0.5.3/libexec/src/choose.py", line 58, in <module>
    curses.wrapper(doProgram)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/local/Cellar/fpp/0.5.3/libexec/src/choose.py", line 30, in doProgram
    screen.control()
  File "/usr/local/Cellar/fpp/0.5.3/libexec/src/screenControl.py", line 262, in control
    inKey = self.getKey()
  File "/usr/local/Cellar/fpp/0.5.3/libexec/src/screenControl.py", line 490, in getKey
    charCode = self.stdscr.getch()
KeyboardInterrupt

How to make fpp only output the file list, so that you can plug in any file picker

Hi,

I already use https://github.com/junegunn/fzf as my general fuzzyfinder, and would really enjoy using the calculated filenames of fpp to feed into fzf. Is it possible to only output the list of files, instead of giving always a UI ?
It would also make more sense because a unix tool should try to do one thing well. I think with this in mind, it would even make sense to have two utilities that could together work as a path picker : the first one which does only the conversion from an output to a list of filenames, the second one which gives an UI to select one or more elements from a list.

Hope that you agree with that.

Unicode Handling

Unicode character is not displayed correctly, and unicode filename cannot be recognized, either.

To reproduce:

git init .
mkdir test
touch test/test
touch test/简体中文
git add test
git config core.quotepath false

Case 1

Expected output of LANG=C git status | fpp:

On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

    new file:   test/test
    new file:   test/简体中文

Actural output:

On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

    new file:   test/test
    new file:   test/��[email protected]��~S中�~V~G

The 2nd "new file" cannot be selected.

Case 2

Actural output of LANG=zh_CN.UTF-8 git status | fpp


�~H~]��~K�~O~P交

��~A�~O~P交�~Z~D�~O~X�~[���~Z
  ��~H使�~T� "git rm --cached <file>..." �~R��~G��~Z~B��~X�~L���~I

V��VG件: test/test
V��VG件: test/��[email protected]��S中�V~G


Breaks when not in toplevel Git directory

git status | fpp, selecting files, and applying them to git add works fine when I'm at the top level of a Git repo, but not if I enter a subdirectory. It appears to append the selected file to the git repo path, not pwd.

choose.py Traceback when running fpp

Hi all,

I'm assuming this is either something I did or just an environment error but I'm not able to get the tool working on one of my notebooks. Here is what I'm seeing:

☁  jkup.github.io [master] ⚡ brew install fpp
==> Downloading https://homebrew.bintray.com/bottles/fpp-0.5.5.yosemite.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/fpp-0.5.5.yosemite.bottle.tar.gz
==> Pouring fpp-0.5.5.yosemite.bottle.tar.gz
🍺  /usr/local/Cellar/fpp/0.5.5: 11 files, 80K
☁  jkup.github.io [master] ⚡ fpp
Using old result...
Traceback (most recent call last):
  File "/usr/local/Cellar/fpp/0.5.5/libexec/src/choose.py", line 56, in <module>
    curses.wrapper(doProgram)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/local/Cellar/fpp/0.5.5/libexec/src/choose.py", line 27, in doProgram
    screen.control()
  File "/usr/local/Cellar/fpp/0.5.5/libexec/src/screenControl.py", line 275, in control
    self.printAll()
  File "/usr/local/Cellar/fpp/0.5.5/libexec/src/screenControl.py", line 493, in printAll
    self.printChrome()
  File "/usr/local/Cellar/fpp/0.5.5/libexec/src/screenControl.py", line 503, in printChrome
    self.helperChrome.output(self.mode)
  File "/usr/local/Cellar/fpp/0.5.5/libexec/src/screenControl.py", line 63, in output
    curses.curs_set(INVISIBLE_CURSOR)
_curses.error: curs_set() returned ERR

My current version of python is 2.7.9

☁  jkup.github.io [master] ⚡ python --version
Python 2.7.9

I tried it in both zsh and bash but getting the same errors. Not sure if there is any other helpful info I can include. Would love it if you all had any suggestions!

Allow use of shell aliases

I have a ton of git aliases and would like to use them with command mode. Otherwise the mode is practically worthless.

fbPager.sh: line 4: gco: command not found

BashRC

It'd be nice to load up your .bachrc and .bash_profile in command mode so you can use your aliases etc.

Offer a pure Python alternative script

I don't know if you are ok with replacing the shell script with a pure Python script, but even if you prefer to have the shell part, at least provide a pure Python version as an alternative.

This way you can us the tool under windows, and for any shell flavor (bash, sh, zsh, shell fish, etc).

In the end, i feel like it would be easier to get rid of the bash part completely though, since you can make a Python code working on any Python version, you can make it easily install a command (even if you don't have homebrew) and it's way simpler to unit test.

Use Python2 when available

In the two systems I use python is already pointing to 3.x whereas python2 is used as a fallback. I believe it's good to select python2 to run if it's available in the system.

fpp fails when called from a symlink in Linux

I'm creating an Arch package for PathPicker right now but I can't make a symlink to fpp work. This is the error I get:

/home/lsmag/my-symlink-fpp: line 18: cd: /home/lsmag//home/lsmag/PathPicker: No such file or directory
python2: can't open file '/src/processInput.py': [Errno 2] No such file or directory
python2: can't open file '/src/choose.py': [Errno 2] No such file or directory
:D

As you can see, the problem is /home/lsmag//home/lsmag/PathPicker = /home/lsmag/ + /home/lsmag/PathPicker, which is the predictable output of both dirname and readlink.

Using readlink -f, however, the command runs just fine. This is how it is on my machine now:

while [ -h "$WHEREAMI" ]; do
  WHEREAMI=$(readlink -f "$WHEREAMI")
done

I don't know if it still works on Macs, though.

False positive on `and/or`

As part of its output, git status prints this:

use "git add" and/or "git commit -a"

PathPicker picks up and/or as a path. I don't know if excluding and/or specifically is a good idea, but given the popularity of git, I think that use "git add" and/or "git commit -a" could be specifically excluded.

Incorrect matching on files with multiple dots

If you have a file like "Company.Project.sln" or "archive.tar.gz", the highlighting and file name matching are incorrect. For example, fpp highlight and try to execute a command on "Project.sln" or "tar.gz".

Linux packages

It would be good to have Linux packages available, at least .deb and .rpm versions. I don't know anyone that uses Linuxbrew, it doesn't seem ideal on Linux when better solutions exist.

The HHVM team distribute Linux packages, you could probably see how they do it.

No available formula when installing via brew.

Gave following command a go from the project homepage, and saw the following:

~|⇒ brew install fpp
Error: No available formula for fpp
Searching formulae...
Searching taps...
~|⇒

Git installation troubles

I have a couple issues with the installation via git. I'm on OS X 10.10.3 with Python 2.7.6.

  1. The installation instructions create a cyclic symbolic link: ls -ltr | tail -n 1

lrwxr-xr-x (etc) fpp -> ./fpp

Adjusting the ln command to use the full path for the source fixes that.

  1. After the symbolic link is setup correctly I get the following error when running fpp --help:

/usr/local/bin/fpp: line 18: cd: /usr/local/bin//usr/local/PathPicker: No such file or directory
python: can't open file '/src/printHelp.py': [Errno 2] No such file or directory

I have placed PathPicker in /usr/local/PathPicker and linked the binary to /usr/local/bin/fpp.

Allow selection of items interactively with search keywords

The basic idea is great... But manually picking a bunch of items is ok, but you should also be able to interactively search for items to add to the selection list. Why? Because sometimes, you have alot of matching files, and manually picking them is tedious. Regex's are ok, but only basic regexs are what 99% of people understand. Think as simple as . or *.jpg, or *.js, and you've reached 90% of the understanding of the regex crowd.

For example, say I was in interactive mode, and had selected a few files by hitting f on each file.

I should also be able to enter "search mode" by typing / and then specifying a search query like the following:

test ez ab super$ ^black

which would match any file that has:

  • the words test, ez, ab in their filename
  • begins with the world black
  • ends with the word super
  • the results of this search would be shown in a filtered search result, and users could select matching items in this sub search by using the f shortcut.

If you did this.... this tool would be extra awesome!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.