STEPS TO REPRODUCE 1. On the command line, i have a file named test.kdev4 in the current folder. 2. Execute one of the following: kdevelop -p test.kdev4 kdevelop -n -p test.kdev4 kdevelop -s default -p test.kdev4 kdevelop --project test.kdev4 kdevelop --project=test.kdev4 kdevelop -p /home/user/projects/test/test.kdev4 kdevelop --project /home/user/projects/test/test.kdev4 kdevelop -p "/home/user/projects/test/test.kdev4" kdevelop --project "/home/user/projects/test/test.kdev4" OBSERVED RESULT An empty KDevelop environment opens, project doesn't load, no errors nor messages appear, just nothing. EXPECTED RESULT Project should be loaded on the projects list side bar SOFTWARE/OS VERSIONS Linux/KDE Plasma: 5.15.28-1-MANJARO (64-bit) KDE Plasma Version: 5.24.3 KDE Frameworks Version: 5.91.0 Qt Version: 5.15.3 ADDITIONAL INFORMATION If i don't put -p option and just project filename, kdevelop opens kdev4 file as a text file and show it in text editor, not as a project. I am able to open projects from inside kdevelop open project menu just fine, but i need to open it on command line.
Take a look at https://invent.kde.org/kdevelop/kdevelop/-/blob/3427bd11ff34b18d3efdec3b4f23c65c0316a6e0/app/main.cpp#L720. KDevelop looks for a session that contains the project specified on the command line. If such a session exists, it is opened. Otherwise, the last used session is opened. You can debug this with: QT_LOGGING_RULES='kdevelop.app.debug=true' kdevelop -p '/path/to/project' Note that the project URL must match the one stored in the session verbatim, because unfortunately KDevelop does not seamlessly resolve symlinks. You could implement creating and opening a new session with the project passed on the command line if there is no suitable existing session.
Seems like an unexpected behaviour from a software. I have never seen such behavior in any other kde or non kde software before. I think i need this in daily life and this bug reduces productivity.
> I think i need this in daily life and this bug reduces productivity. Fortunately KDevelop is free software. You can implement the feature to boost productivity.
KDevelop accepts positional arguments on the command line. From the output of `kdevelop --help`: > Arguments: > files Files to load, or directories to load as projects So you can load a project into the last used session by passing its directory to KDevelop on the command line. For the current directory: kdevelop .
Created attachment 170592 [details] workaround script that can be used This is a workaround bash script to be used if you want to open kdevelop projects directly by double clicking on the project files, it will search a session with the project and if it doesn't find it, creates a session with the project then opens the project in this new session. I wish i could implement this in kdevelop source code itself, but i just did a quick workaround instead of a full work.