Idiom for shelling out to $EDITOR/$PAGER?

Owen Jacobson angrybaldguy at gmail.com
Fri Dec 23 21:41:07 EST 2011


On 2011-12-23 06:02:18 +0000, Cameron Simpson said:

> MacOSX has "open", though it won't be running a blocking editor, alas.

But it can be. From the man page:

     -t  Causes the file to be opened with the default text editor, as deter-
         mined via LaunchServices

and

     -W  Causes open to wait until the applications it opens (or that were
         already open) have exited.  Use with the -n flag to allow open to
         function as an appropriate app for the $EDITOR environment variable.

and finally

     -n  Open a new instance of the application(s) even if one is already run-
         ning.

can be combined to make 'open' (the shell interface to OS X's 
LaunchServices system) into a workable $EDITOR.

-o





More information about the Python-list mailing list