Bug 509761 - dolphin <path-to-file> executes the file rather than opening a dolphin window with the file highlighted
Summary: dolphin <path-to-file> executes the file rather than opening a dolphin window...
Status: CONFIRMED
Alias: None
Product: dolphin
Classification: Applications
Component: general (other bugs)
Version First Reported In: 25.08.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-21 21:50 UTC by darkphoenix534
Modified: 2025-09-25 17:16 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description darkphoenix534 2025-09-21 21:50:18 UTC
SUMMARY
I am using application launcher which provides option to open location of .desktop file, dolphin defaults to executing the <file> instead of opening the folder with <file> being selected.

Also when closing whichever app that get launched for <file>, the dolphin window doesn’t show the containing folder.

STEPS TO REPRODUCE
1. dolphin <file-path>

OBSERVED RESULT
<file-path> gets executed with its respective application.

EXPECTED RESULT
<file-path> should be selected instead. The rationale is, if i wanted to execute the file i would have used xdg-open <file-path> and not dolphin, dolphin is a file-manager and should open in file managing mode.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.2
Kernel Version: 6.16.7-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 12 × Intel® Core™ i7-9750H CPU @ 2.60GHz
Memory: 16 GiB of RAM (15.4 GiB usable)
Graphics Processor: Intel® UHD Graphics 630

ADDITIONAL INFORMATION
Or please provice config option for changing this.
Comment 1 darkphoenix534 2025-09-21 21:55:18 UTC
nautilus <file-path> also defaults to selecting the file in file-manager.
Comment 2 TraceyC 2025-09-23 19:51:44 UTC
I confirm this behavior on git-master. It does seem counter intuitive that if I try to open a file using Dolphin that it would be executed, rather than opened in Dolphin like I asked

As a user, I'd expect that if I wanted to execute a file when passed to Dolphin, it would be available with a flag, rather than be done as default.

I'm not sure if this behavior is intentional, so I'm keeping it as a bug for now, since it's not consistent with other file managers and (some) user expectations.
Comment 3 TraceyC 2025-09-23 19:52:48 UTC
Original summary

dolphin <path-to-file> should default to --selection and dolphin window doesn’t show the containing folder.
Comment 4 matdubuisson 2025-09-25 13:03:44 UTC
I would be interested to do this if it's still possible this is what I proposed on matrix :
I write the path of a file directly in the search bar it doesn't open the file or display the current folder of the file ? Would it be interesting to implement this feature when setting the path of a file, the file is open with kate (1) the current directory of the file is shown (2) ? I would say for text files solution (1) is preferable but for binary files solution (2) is preferable. I have an idea text extensions as txt, cpp, js, csv, .... are recognized and the file is open else the current path of the file is displayed and it's the user to do something ? Could it be an idea or do you have an advice or something better ?

What do you think ?
Comment 5 darkphoenix534 2025-09-25 13:21:04 UTC
@matdubuisson Your message was quite confusing.

For how to implement this, --selection code is already there in the codebase, just make --selection the default, i.e no need to pass --selection on command-line. And introduce new command-line --execute whose implementaion would be the current default behaviour. I would have done PR myself but will have to install KDE build environment in contrast to the change which is very minimal, also wanted developer opinions.
Comment 6 matdubuisson 2025-09-25 13:23:11 UTC
Ok sorry I did't understand that was for command line I thought it was about the search bar in the gui. Actually I try to contribute for the first time
Comment 7 darkphoenix534 2025-09-25 13:29:41 UTC
(In reply to matdubuisson from comment #6)
> Ok sorry I did't understand that was for command line I thought it was about
> the search bar in the gui. Actually I try to contribute for the first time

Ohhhh ok, now that you mention this, i see the behaviour is set to execution behaviour for file-path and when i compared this to nautilus file manager - it defaults to opening the directory and selecting the file. Maybe this also needs fixing. But i have a feeling that command-line and file-path in address-bar is using the same code.
Comment 8 matdubuisson 2025-09-25 13:33:10 UTC
I would want to try if you are ok ? I think it could be
Comment 9 matdubuisson 2025-09-25 13:33:25 UTC Comment hidden (spam)
Comment 10 darkphoenix534 2025-09-25 13:38:03 UTC
(In reply to matdubuisson from comment #9)
> (In reply to matdubuisson from comment #8)
> > I would want to try if you are ok ? I think it could be a first good move

i haven't contributed in terms of code in kde at all, i just created this bug report. So i don't know what are the guidelines for contributing code to kde.

From my side i don't have any issue, refer to my previous message of what changes i expect, thats all.

You can maybe ask in dolphin matrix group on how to process with the PR and all.

Thank you for working on this.
Comment 11 matdubuisson 2025-09-25 13:41:39 UTC
I have already done a request on matrix actually but I haven't received messages yet
Comment 12 TraceyC 2025-09-25 17:16:13 UTC
(In reply to matdubuisson from comment #6)
> Ok sorry I did't understand that was for command line I thought it was about
> the search bar in the gui. Actually I try to contribute for the first time

Welcome to the KDE community. Make sure to check out https://community.kde.org/Get_Involved for detailed info on getting started as a new contributor.

The KDE bug tracker is for bugs rather than development work. The New Contributor channel in Matrix is a better place to ask questions or ask for advice about development work on fixes.