How to edit all files in the same kate process

Hello.
I have try many things but I cannot have a single kate process holding all the files I want to edit.
I got one kate process by file to edit; or I got one process by folder path to edit.

I have tryied with

kate -n TEST1 &
kate -n TEST1 -b &
kate --pid PID_OF_CURRENT_RUNNING_KATE &

Using xargs does not help in this situation.

Here is my last try and I would like it to work.

MAIN_PATH1, …,.MAIN_PATHn — are full path of style ‘/run/media/$(logname)/usb_disk_name/a/b/c’

for A_FOLDER in “$MAIN_PATH1” “$MAIN_PATH2” “$MAIN_PATH3” “$MAIN_PATH4” “$MAIN_PATH5” “$MAIN_PATH6” “$MAIN_PATH7” “$MAIN_PATH8” “$MAIN_PATH9” “$MAIN_PATH10” “$MAIN_PATH11” ; do
find “$A_FOLDER” -type f -print0 | xargs -0 kate &
done

PS : the full path return by find for each founded files may contains space ( generally with .desktop file names.

Any help is very welcome.

Would setting a start name help? As per the man file:

   -s, --start name
       Start Kate with a given session.

If you open something from the command line like kate -s mysession <filename> and use that for each instance of opening something, it should re-use the existing session.

Thank you for helping.
I am not working from command line.

And I don’t see no reason for not working.
I have tried with other bash command and it works as expected even with filename which contains space.

I supect some kind of bug or kate limitation.

I am not working from command line.

If you want anything opened via Kate (e.g. by double-clicking or right-clicking and Open With > Kate) to open in a common session, you could try modifying the .desktop file to add the session name, though that would mean everything you open would open in the same session.

Under /usr/share/applications/, you should hopefully have the org.kde.kate.desktop file there, which you can copy to ~/.local/share/applications/ and modify the file by changing the Exec= line. The line for me is originally Exec=kate -b %U which you could change to something like Exec=kate -s mysession -b %U (change mysession to what you want of course).