instances

Post Reply
phi
Posts: 21
Joined: 02.05.2024 08:50

instances

Post by phi »

It is possible to lunch many instances of cuda as long as no instance is already running with option "Allow to run only one instance (main window) of CudaText." set to true (which is the case by default).

when launching
cudatext.exe -id=xxx -s=c:\cuda\cfg_x filex
cudatext.exe -id=yyy -s=c:\cuda\cfg_y filey1
cudatext.exe -id=yyy -s=c:\cuda\cfg_y filey2
one gets 1 instance (option one instance=true) or 3 instances (option one instance=false for the instance already running). Even if you use different copies of cud (seems that no new copy is launched).

Is it possible to have filex in instance xxx and both filey1 and filey2 in one same yyy instance ?
(ok, if option one instance=true for instance yyy, but then, what if you launch yyy first?)

It seems that would need a more fine-grained option
0: only one instance in any case (different tabs could have different ids or cfg ?)
1: only one instance of each cfg (different tabs could have different ids ?)
2: only one instance of each cfg . id
3: multiple instances in any case

I didn't test all the possibilities ; some might be already implemented.
Last edited by phi on 17.01.2026 13:24, edited 1 time in total.
main Alexey
Posts: 2906
Joined: 25.08.2021 18:15

Re: instances

Post by main Alexey »

This is complex question, I cannot tell now: it's possible or not; maybe I will study the Lazarus component features, later.

but no promise, this is very minor feature-req.
phi
Posts: 21
Joined: 02.05.2024 08:50

Re: instances

Post by phi »

Well, not so minor: managing the yyy type might induce the recourse to another editor, like NPP...
:-)

There are already potential issues if different instances change some settings.

There is already the -n command line option to force a new instance. A -nyyy could do so unless there is an id=yyy instance running, in which case it would be merged in it. Or is it already the case simply with -id=yyy in Unix ?

In Windows, you get a new instance merging the first one.
i.e.
cudatext.exe -id=yyy -s=c:\cuda\cfg_y filey1
cudatext.exe -id=yyy -s=c:\cuda\cfg_y filey2
you get 2 windows, the first with filey1 and the second with filey1 AND filey2, actually as expected.

But with -nsl option:
cudatext.exe -id=yyy -nsl -s=c:\cuda\cfg_y filey1
cudatext.exe -id=yyy -nsl -s=c:\cuda\cfg_y filey2
you get 2 windows, the first with only filey1 and the second with only filey2 as expected
main Alexey
Posts: 2906
Joined: 25.08.2021 18:15

Re: instances

Post by main Alexey »

I worked a little on this topic. And found that in my code, 'id=' cmd-line param is supported only on Unix-like OS'es. And I see it is written in the wiki in the topic about cmd-line params - "Unix only". Sorry. Windows-code for single instance is different. you need it for Windows.
Post Reply