Ticket #33 (closed defect: fixed)

Opened 8 years ago

Last modified 7 years ago

Recognise command line parameters

Reported by: phil Owned by: armin
Priority: normal Milestone: Gobby 0.4.0
Component: Gobby Version:
Severity: normal Keywords:
Cc: Launchpad Bug:

Description (last modified by phil) (diff)

Command line parameters should be parsed and processed. Especially it would be nice if Gobby accepted one or more files in it to open it in the currently active Gobby session (to use Open With in your favourite desktop environment). However this will get complicated when more than one Gobby is open.

We could use X properties on X11 for interprocess communication and some WinAPI calls on Windows.

Change History

Changed 8 years ago by phil

  • milestone set to Gobby 0.3.0

It would be really nice to get this feature in Gobby 0.3.0, but further discussion has to take place.

Changed 8 years ago by phil

  • description modified (diff)
  • milestone changed from Gobby 0.3.0 to Gobby 0.4.0

Changed 7 years ago by armin

  • status changed from new to assigned

[824] features command line parameters for Gobby. Currently it behaves as follows:

  • If no command line arguments are given, Gobby starts up as it has before.
  • If command line arguments are given, Gobby interprets them as files to open:
    • If another gobby is running, gobby sends the files to the other gobby which will open them in the current session. If the other gobby has no session open, it opens a new session with the latest known settings and loads the files.
    • If more than one other gobby is running, gobby takes the first it finds to send the files. This could be a point for future improvements.
    • If no other gobby is running, gobby opens a new session with the latest known settings and loads the files.

A Win32 implementation is included but has not yet been tested. If no one complains about the behaviour described above and Win32 is known to work I will close this ticket. Tests on Mac OS X are appreciated although it uses the same technique as linux and should work.

Changed 7 years ago by phil

This is the Mac OS X test report:

If no command line arguments are given, Gobby starts up as it has before.

Confirmed.

If command line arguments are given, Gobby interprets them as files to open: If another gobby is running, gobby sends the files to the other gobby which will open them in the current session. If the other gobby has no session open, it opens a new session with the latest known settings and loads the files.

Confirmed to work.

If more than one other gobby is running, gobby takes the first it finds to send the files. This could be a point for future improvements.

Works.

If no other gobby is running, gobby opens a new session with the latest known settings and loads the files.

Works, too.

Wow.

Changed 7 years ago by phil

On Mac OS X the sockets are saved in /var/tmp, which is not auto-cleaned. But this should not be a problem. What happens when a given socket already exists?

Changed 7 years ago by armin

Gobby tries to remove any socket file after the socket has been closed. If Gobby encounters a socket file in the temp directory it tries to connect. If it cannot connect it deletes that socket file (since it seems not to be in use anymore, maybe from an earlier gobby that crashed and had no opportunity to remove the file) and looks for the next file.

Changed 7 years ago by phil

Does this work reliably with concurrent users? (Gnome support User Switch since 2.14.) You don't bail out when the delete fails, do you? How is the "first" process detected? Lowest PID? Or smallest (as in comparison) filename (so gobby_10000.sock would be more current than say gobby_2000.sock)?

Changed 7 years ago by armin

Uhm. Perhaps we should check the file's owner before connecting to such a socket?

Changed 7 years ago by phil

Indeed.

Changed 7 years ago by armin

  • status changed from assigned to closed
  • resolution set to fixed

[839] has working WIN32 support, [841] only connects to other gobby processes from the same user.

Note: See TracTickets for help on using tickets.