rkitover / vimpager

Use Vim as PAGER
http://www.vim.org/scripts/script.php?script_id=1723
Other
769 stars 72 forks source link

Don't force filetype when python is a parent process #243

Closed ao2 closed 5 years ago

ao2 commented 5 years ago

Matching "python" as the parent process is too generic to force filetype: sometimes it happens that a python program launches a shell and from that shell vimpager would have a broken filetype detection.

See the following example:

------------- launch-shell.py ------------------------
import subprocess

subprocess.check_call(['/bin/bash'])
--------------------------------------------------------

In the new subshell everything would look like a man page, e.g.:

$ python launch-shell.py $ vimpager launch-shell.py

In particular I experienced this with gst-build (https://gitlab.freedesktop.org/gstreamer/gst-build/) which launches a subshell with a modified environment.

So don't match against python when forcing the file type.

The same may apply to Ruby, vimpager is trying too hard sometimes. :)

rkitover commented 5 years ago

You are absolutely right. I've learned a lot of things since I worked on this repo last, and I really need to get back to it and clean everything up. Hopefully soon. Thank you!