mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 16:42:42 +01:00
config -e: Parse arguments in $EDITOR (fix #1200)
This commit is contained in:
parent
1f3fc60bad
commit
e13e7ed727
2 changed files with 9 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ import time
|
|||
import codecs
|
||||
import platform
|
||||
import re
|
||||
import shlex
|
||||
|
||||
import beets
|
||||
from beets import ui
|
||||
|
|
@ -1503,7 +1504,12 @@ def config_edit():
|
|||
|
||||
if 'EDITOR' in os.environ:
|
||||
editor = os.environ['EDITOR']
|
||||
args = [editor, editor, path]
|
||||
try:
|
||||
editor = shlex.split(editor)
|
||||
except ValueError: # Malformed shell tokens.
|
||||
editor = [editor]
|
||||
args = editor + [path]
|
||||
args.insert(1, args[0])
|
||||
elif platform.system() == 'Darwin':
|
||||
args = ['open', 'open', '-n', path]
|
||||
elif platform.system() == 'Windows':
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@ Fixed:
|
|||
twice in the artist string. Thanks to Marc Addeo. :bug:`1179` :bug:`1181`
|
||||
* :doc:`/plugins/lastgenre`: Match songs more robustly when they contain
|
||||
dashes. Thanks to :user:`djl`. :bug:`1156`
|
||||
* The :ref:`config-cmd` command can now use ``$EDITOR`` variables with
|
||||
arguments.
|
||||
|
||||
.. _API changes: http://developer.echonest.com/forums/thread/3650
|
||||
.. _Plex: https://plex.tv/
|
||||
|
|
|
|||
Loading…
Reference in a new issue