I imagine Jon would need to code a -find_window_if_exists command line option. In which case, if a directory is supplied as the parameter, the first Sublime window which has that directory open is shown, or in the case of a file, the first window containing that file in a tab with the tab activated.
I’m wondering if this could be done with a plugin. Subl has the --command switch which can be used to run, presumably, any type of command. If parameters can be passed to the command via the command line, it’s feasible for a plugin to find the corresponding window (or tab) and activate it?
As an aside (OT and just an opinion) Sublime’s current command line behaviour leaves stuff to be desired at present. Apart from a number of little bugs (eg. new blank windows sometime appearing and sometimes not when launching subl with the --project switch) it would be really useful to be able to launch new “incognito” sublime process(s) entirely isolated from the main sublime process, ignoring any hot_exit/previous project/tabs etc, and with any state saving features on exit disabled. This would make sublime much more usable as a go-to command line editor a la vim, plus it allows for sublime to be run elevated (sudo etc), even if the existing sublime process is run in user context (a regular PITA for me). It means that the main sublime “app” could be left open with projects etc, while incognito sublimes can be run at will for ad-hoc editing. Also, it means that if sublime is not running, it could be run for ad-hoc editing without touching the state, projects and tabs of the main sublime app.