facebook / PathPicker

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.
https://facebook.github.io/PathPicker/
MIT License
5.11k stars 283 forks source link

fpp not opening files in $EDITOR #420

Closed Zane- closed 2 years ago

Zane- commented 2 years ago

Hello,

I have my $EDITOR set to vim, however when I attempt to open a file using fpp, it opens in nano instead.

Here's a video reproduction: https://user-images.githubusercontent.com/6345012/163692696-1ca19d72-12a6-47b9-b565-ca8d6cf4e805.mp4

Zane- commented 2 years ago

Thought it might be using $VISUAL, which was set to nano, but I've changed that to vim as well, and still opening in nano.

Deckluhm commented 2 years ago

If you didn't already read that, maybe that can help:

The $FPP_EDITOR environment variable can be set to tell PathPicker which editor to open the selected files with. If that variable is not set, $VISUAL and then $EDITOR are used as fallbacks, with "vim" as a last resort.

Also, be sure to restart your terminal after updating an environment variable.

Zane- commented 2 years ago

I set that variable, and it works now, but I'll still keep this open as it didn't pick any of the fallbacks, nor the last resort.

Deckluhm commented 2 years ago

Are you sure $FPP_EDITOR wasn't already defined elsewhere? (maybe not by you but by a plugin or something like that)

Zane- commented 2 years ago

I ripgrep'd my whole system, no results. I'm using a tmux-fpp plugin, but it doesn't set it anywhere (and I was also able to reproduce this outside of tmux)

I removed $FPP_EDITOR from my .zshrc, re-sourced it, and ran echo $FPP_EDITOR, which didn't return anything.

Deckluhm commented 2 years ago

https://github.com/tmux-plugins/tmux-fpp/issues/18

It doesn't seem to be an issue with PathPicker but rather with tmux (and how it handles environment variables).

Zane- commented 2 years ago

Works now that I've moved the EXPORT statements above tmux's execution in my .zshrc. Thanks!