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

Ryan Schmidt ryandesign at macports.org
Tue Dec 6 17:41:39 CET 2016


On Dec 6, 2016, at 10:03, René J.V. Bertin wrote:
> 
> Has there ever been discussion about if and how to let `port edit` invoke a different editor when you're working locally vs. over SSH?
> 
> I realise this could theoretically be handled by setting a different MP_EDITOR value in your shell's .*profile/.*rc file but I cannot think of a reliable way to detect local vs. remote access right now, esp. not one that will distinguish between local "aqua vs non aqua" sessions. And to make things yet more complex: ssh to a remote host and from there back to a Mac, all from within an Aqua session, and you can still do things like `open -e` to edit a file in TextEdit.

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.

I haven't taken the time to look into how I could configure that. So instead, I configure EDITOR to run TextWrangler, and whenever I ssh in and need to edit a portfile, which is rare, I use 'vi $(port file someport)` instead of `port edit someport`. 


More information about the macports-dev mailing list