<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 6, 2016 at 5:41 PM, Ryan Schmidt <span dir="ltr"><<a href="mailto:ryandesign@macports.org" target="_blank">ryandesign@macports.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I would like `port edit` to open TextWrangler when I'm at my Mac or vi when I'm sshing in from another machine.</blockquote></div><br>Check for $SSH_CONNECTION in the environment and set MP_EDITOR to "open -a TextWrangler" (or maybe "open -t") or "vi" accordingly.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Your notion of handling ssh to another machine and back to the Mac likely won't work, because Apple's sshd creates a session that is distinct from the GUI session and will return permission errors if you try to access the GUI from it. (There *may* be ways around this. There used to be, but Apple has several times tightened their GUI isolation over the years and I have no idea if there is a current way to evade it, or whether such evasion will continue to work in e.g. Sierra or future macOS releases.)<br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div></div>
</div></div>