-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
envy edit vim issues #4
Comments
It sounds like you might want to use https://docs.python.org/2/library/os.html#os.execl something like import os
os.execl("/usr/local/bin/vim", "--", "/tmp/editme") |
This seems to work. However, many have mentioned to be that it is bad practice to use Using this approach would require users to specify the full path to the executable when exporting Thank you very much though-- I will certainly consider this to fix my issue. |
Couple things to note:
args = ["/usr/local/bin/vim", "--", "/tmp/editme"]
os.execl(args[0], *args) But there's technically no need for $ pgrep -a vim
3002 --
Now if you look at subprocess's source (https://github.com/python/cpython/blob/2.7/Lib/subprocess.py) you can see how it does things. It basically wraps forking, exec (it uses Continuing on from my previous comments (I'm OCCASIONAL_CATNAPPER on reddit), I'd suspect maybe you have two copies of vim, on in /usr/bin/local and one elsewhere and maybe that's the difference for why os.execl worked. |
Thanks so much for taking the time to write up such a helpful response! As far as why I'm fairly certain I only have one vim installation-- the only one I can find lives in Anyways, thanks again! |
One last thing actually, try attach strace to the stuck vim process and see what its hanging on. It'll tell you which syscall its stuck on, which can be useful in figuring out exactly whats broken. |
vim
does not want to play nicely when launched from anenvy edit
call using python'ssubprocess
module. Currently, if$EDITOR
is set to bevim
, it will launch, but in a frozen state.Not quite sure if there is a workaround for this yet (I see others having similar issues on stackoverflow).
vi
works just fine, so in the meantime (see 06c4392, and as of 0.0.8),envy edit
will default tovi
if :$EDITOR
is not set.$EDITOR
is set to bevim
While it does feel a little strange to both rely on
$EDITOR
but ignore it in a specific case (ievim
), the logic is thatenvy edit
is not useful AT ALL if$EDITOR
is set tovim
. (vi
should be available on most systems..)Any suggestions as to how to better work around (or solve!) this issue would be greatly appreciated!
The text was updated successfully, but these errors were encountered: