Alexey-T / CudaText

Cross-platform text editor, written in Free Pascal
Mozilla Public License 2.0
2.39k stars 166 forks source link

Retain actual location of file opened as root #5483

Closed pintassilgo closed 2 months ago

pintassilgo commented 2 months ago

When I open a file as root with Cuda, running the command file: open folder containing the current file opens a different location, like ~/.cache/kioexec/krun/12678_0/. I understand the file is saved to a different temporary location then moved to its actual location on saving, but Cuda should open the actual location when running that command.

I also use Breadcrumbs plugin and it should display actual location.

Kate, for instance, works as expected.

Alexey-T commented 2 months ago

I don't know where the dir ~/.cache is from. My code uses it? seems no. what file manager do you use, from which you call Cud as root?

pintassilgo commented 2 months ago

I use KDE Plasma. I guess other DE's will have slightly different path (won't use kioexec), but probably still under ~./cache. File was opened using Dolphin (default Plasma file manager, by the way the best one imo)

Alexey-T commented 2 months ago

Cud just opens the full filename passed in the command line. IMO this filename has ~/.cache/...

pintassilgo commented 2 months ago

But as I said, doing the same with Kate works as expected (right-click the file in file manager, open with, Kate/CudaText). Kate retains original location, calling "Open Containing Folder" works fine, while Cuda opens the temp location (`~/.cache/...).

Alexey-T commented 2 months ago

Kate may have special integration into KDE.

pintassilgo commented 2 months ago

OK, if you're right it looks this is out of reach for Cuda. Opening a root protected file using Cuda "File > Open file" works as expected, so maybe opening from file explorer really just passes the wrong path so there's nothing Cuda can do.

If you agree there's no way to fix, this can be closed.

Alexey-T commented 2 months ago

I agree, no way.