[Lazarus] open pas file from command line

Michael Van Canneyt michael at freepascal.org
Thu Oct 21 09:52:51 CEST 2010



On Wed, 20 Oct 2010, David Emerson wrote:

> Hi there,
>
> Suppose I have a lazarus source editor open. I would like to, from my command
> line shell, issue a command to open a new source in the already-open source
> editor. Is this possible?
>
> Why? If I have a shell open in a directory, it's very quick to tab-complete a
> file within a directory. It's nice to be able to issue a quick command to open
> that file in my editor, rather than using the cumbersome gui file selection
> interface. I've written scripts to do this with a few other apps, but it
> requires support from the app in question.

It should in fact be easy to program this, using the simpleIPC protocol.
IDE acts as a server, and when the IDE starts, it checks whether the server
is available. If so, it sends a command to open the file.

Or, on Linux, D-BUS could be used for this. Windows might  have some easy
DDE schedule for this.

Michael.




More information about the Lazarus mailing list