`port edit`, local/console vs. remote use

René J.V. Bertin rjvbertin at gmail.com
Tue Dec 6 18:08:11 CET 2016


On Tuesday December 06 2016 11:41:39 Ryan Schmidt wrote:

> I would like `port edit` to open TextWrangler when I'm at my Mac or vi when I'm sshing in from another machine. But I consider it to be something that a user would configure in their own environment to suit their taste, not something that would involve changes to MacPorts base code.

That's more or less what I'd want too (but KDevelop5 instead of TextWrangler). Evidently the editor choice should remain the user's.

This is all implemented in the port client, btw.

> I haven't taken the time to look into how I could configure that.

2 possibilities come to mind:
- support for a script that returns the editor to use
- use the fallback editor also if $MP_EDITOR or $VISUAL_EDITOR fail(s)

A long time ago I wrote an application that returns the name (or IP) of the host you're logged in from. I don't think I ever got it to work reliably on modern Linux and OS X machines, but maybe someone here knows the correct way to obtain this information (if still possible)?

With this information the edit action could also check for ${MP_EDITOR_$RHOST} .

R.


More information about the macports-dev mailing list