Skip to content
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

Support editors with arguments, using shlex #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os.path
import subprocess
import tempfile
import shlex
from distutils.spawn import find_executable


Expand Down Expand Up @@ -75,7 +76,7 @@ def get_tty_filename():

def edit(filename=None, contents=None, use_tty=None):
editor = get_editor()
args = [editor] + get_editor_args(os.path.basename(os.path.realpath(editor)))
args = shlex.split(editor) + get_editor_args(os.path.basename(os.path.realpath(editor)))

if use_tty is None:
use_tty = sys.stdin.isatty() and not sys.stdout.isatty()
Expand Down