External Editor Arguments issue

When trying to set up an external editor, the values in the ‘External Script Editor Args’ field in the ‘External Tools’ section of the Preferences screen are passed wholesale to the external editor as one big argument, rather than split into separate space-delimited arguments, the way that most command lines would do it.

For example, if I, being a hopeless emacs cripple, want to use emacsclient to send files to a running emacs instance, or fire up a new emacs window if emacs isn’t already running - something like the way MonoDevelop ordinarily behaves with Unity - I’d expect to put something like

--alternate-editor=emacs +$(Line):1 "$(File)"

in the box, and have the arguments passed to emacsclient as three separate ones , such as (“–alternate-editor=emacs”, “+69:1”, “"/home/wibble/UnityProject/Assets/foobar.cs"”).

However, currently, it’ll just send one argument (“–alternate-editor=emacs +69:1 "/home/wibble/UnityProject/Assets/foobar.cs"”) to the editor, which then either fails outright if it can’t find an emacs server, or uselessly tries to open the whole command line as a filename, if it can.

The upshot is that putting almost anything other than $(File) in there is futile, and the external editor feature is a chunk less useful than it could easily be/already is on Windows. I expect this is also a problem for users of other, lesser, editors too, though maybe they're not as Monodevelop-averse as I am, and switching editors wasn't the very first thing they did with the shiny new Linux Unity.

(Running the .deb version of Unity 5.1.0f3 on Debian Sid, but this isn’t the sort of issue that’s usually distro-specific).

Thanks, we’ll investigate.

Ping…

I’m having similar issues on macOS Unity 2017.1.05b5 and was wondering if there was any fix/workaround?

ping

Sorry for the delayed response - we’ve reworked this for an upcoming release.

1 Like